From 0e666e7d6a65d4b51bf64876e38dc02d2b36b4cc Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 21 Jan 2020 10:53:11 -0500 Subject: [PATCH] encoding fail test --- tests/test-elligator.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test-elligator.cpp b/tests/test-elligator.cpp index 94798e80..e73eb8ab 100644 --- a/tests/test-elligator.cpp +++ b/tests/test-elligator.cpp @@ -58,6 +58,12 @@ const uint8_t key3[32] = 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 }; +const uint8_t failed_key[32] = +{ + 0xe6, 0xf6, 0x6f, 0xdf, 0x6e, 0x23, 0x0c, 0x60, 0x3c, 0x5e, 0x6e, 0x59, 0xa2, 0x54, 0xea, 0x14, + 0x76, 0xa1, 0x3e, 0xb9, 0x51, 0x1b, 0x95, 0x49, 0x84, 0x67, 0x81, 0xe1, 0x2e, 0x52, 0x23, 0x0a +}; + int main () { uint8_t buf[32]; @@ -74,4 +80,6 @@ int main () assert(memcmp (buf, key2, 32) == 0); el.Decode (encoded3, buf); assert(memcmp (buf, key3, 32) == 0); + // encoding fails + assert (!el.Encode (failed_key, buf)); }