Skip to content

Commit

Permalink
Update Relic anchor to aecdcae. Addresses issue Chia-Network#271 (Chi…
Browse files Browse the repository at this point in the history
…a-Network#277)

* Update Relic anchor to aecdcae7956f542fbee2392c1f0feb0a8ac41dc5. Addresses issue Chia-Network#271.

* Update tests

* Switch relic_ietf_64 to the aecdcae version.

* Use our main repo as the related PR got merged.

Co-authored-by: Mariano Sorgente <sorgente711@gmail.com>
  • Loading branch information
2 people authored and UdjinM6 committed Dec 1, 2021
1 parent c729963 commit c237ae8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -44,8 +44,8 @@ FetchContent_MakeAvailable(Sodium)
if (DEFINED ENV{RELIC_MAIN})
set(RELIC_GIT_TAG "origin/main")
else ()
# This is currently anchored to upstream b7b2266a0e4ee6f628f61d3ab638f524a18b52f1
set(RELIC_GIT_TAG "31ca41446528f4c35525d5690da249ce6c0d43a1")
# This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5
set(RELIC_GIT_TAG "1d98e5abf3ca5b14fd729bd5bcced88ea70ecfd7")
endif ()

message(STATUS "Relic will be built from: ${RELIC_GIT_TAG}")
Expand Down
7 changes: 1 addition & 6 deletions src/test.cpp
Expand Up @@ -468,13 +468,9 @@ TEST_CASE("Error handling")
SECTION("Should throw on a bad public key")
{
vector<uint8_t> buf(G1Element::SIZE, 0);
// This are all the "first byte values" which are tested to be valid G1 elements if the remaining bytes are zero.
std::vector<uint8_t> vecValid{0x85, 0x86, 0x87, 0x88, 0x89, 0x8C, 0x8F, 0x91, 0x93, 0x94, 0x96, 0x98, 0x99, 0x9A,
0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAC, 0xAF, 0xB1, 0xB3, 0xB4, 0xB6, 0xB8, 0xB9, 0xBA,
0xC0};
for (int i = 0; i < 0xFF; i++) {
buf[0] = (uint8_t)i;
if (std::find(vecValid.begin(), vecValid.end(), i) != vecValid.end()) {
if (i == 0xc0) { // Infinity prefix shouldn't throw here as we have only zero values
REQUIRE_NOTHROW(G1Element::FromByteVector(buf));
} else {
REQUIRE_THROWS(G1Element::FromByteVector(buf));
Expand All @@ -485,7 +481,6 @@ TEST_CASE("Error handling")
SECTION("Should throw on a bad G2Element")
{
vector<uint8_t> buf(G2Element::SIZE, 0);

for (int i = 0; i < 0xFF; i++) {
buf[0] = (uint8_t)i;
if (i == 0xc0) { // Infinity prefix shouldn't throw here as we have only zero values
Expand Down

0 comments on commit c237ae8

Please sign in to comment.