From 2058eaea999b336fad108999638b3bd5302a96a3 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 6 Jun 2014 08:22:11 -0700 Subject: [PATCH] Revert bd8cbd3175cd2041945ea28bf0d4521fa79de26b Go back to masking the high bit in curve25519 instead of processing the key as a 256-bit value. --- .gitignore | 2 -- test/default/Makefile.am | 12 ------------ test/default/scalarmult7.c | 32 -------------------------------- test/default/scalarmult7.exp | 1 - test/default/scalarmult8.c | 32 -------------------------------- test/default/scalarmult8.exp | 1 - 6 files changed, 80 deletions(-) delete mode 100644 test/default/scalarmult7.c delete mode 100644 test/default/scalarmult7.exp delete mode 100644 test/default/scalarmult8.c delete mode 100644 test/default/scalarmult8.exp diff --git a/.gitignore b/.gitignore index c10fb6dc..d0144d62 100644 --- a/.gitignore +++ b/.gitignore @@ -88,8 +88,6 @@ test/default/scalarmult test/default/scalarmult2 test/default/scalarmult5 test/default/scalarmult6 -test/default/scalarmult7 -test/default/scalarmult8 test/default/secretbox test/default/secretbox2 test/default/secretbox7 diff --git a/test/default/Makefile.am b/test/default/Makefile.am index 0ca1ab52..ff6db8f9 100644 --- a/test/default/Makefile.am +++ b/test/default/Makefile.am @@ -37,8 +37,6 @@ EXTRA_DIST = \ scalarmult2.exp \ scalarmult5.exp \ scalarmult6.exp \ - scalarmult7.exp \ - scalarmult8.exp \ secretbox.exp \ secretbox2.exp \ secretbox7.exp \ @@ -94,8 +92,6 @@ DISTCLEANFILES = \ scalarmult2.res \ scalarmult5.res \ scalarmult6.res \ - scalarmult7.res \ - scalarmult8.res \ secretbox.res \ secretbox2.res \ secretbox7.res \ @@ -159,8 +155,6 @@ TESTS_TARGETS = \ scalarmult2 \ scalarmult5 \ scalarmult6 \ - scalarmult7 \ - scalarmult8 \ secretbox \ secretbox2 \ secretbox7 \ @@ -292,12 +286,6 @@ scalarmult5_LDADD = $(TESTS_LDADD) scalarmult6_SOURCE = cmptest.h scalarmult6.c scalarmult6_LDADD = $(TESTS_LDADD) -scalarmult7_SOURCE = cmptest.h scalarmult7.c -scalarmult7_LDADD = $(TESTS_LDADD) - -scalarmult8_SOURCE = cmptest.h scalarmult8.c -scalarmult8_LDADD = $(TESTS_LDADD) - secretbox_SOURCE = cmptest.h secretbox.c secretbox_LDADD = $(TESTS_LDADD) diff --git a/test/default/scalarmult7.c b/test/default/scalarmult7.c deleted file mode 100644 index 7b6227bc..00000000 --- a/test/default/scalarmult7.c +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#define TEST_NAME "scalarmult7" -#include "cmptest.h" - -unsigned char p1[32] = { - 0x72, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, - 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, - 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, - 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0xea -}; - -unsigned char p2[32] = { - 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, - 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, - 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, - 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a -}; - -unsigned char scalar[32]; -unsigned char out1[32]; -unsigned char out2[32]; - -int main(void) -{ - scalar[0] = 1U; - crypto_scalarmult_curve25519(out1, scalar, p1); - crypto_scalarmult_curve25519(out2, scalar, p2); - printf("%d\n", memcmp(out1, out2, sizeof out1)); - - return 0; -} diff --git a/test/default/scalarmult7.exp b/test/default/scalarmult7.exp deleted file mode 100644 index 573541ac..00000000 --- a/test/default/scalarmult7.exp +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/test/default/scalarmult8.c b/test/default/scalarmult8.c deleted file mode 100644 index 3ccbd292..00000000 --- a/test/default/scalarmult8.c +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#define TEST_NAME "scalarmult7" -#include "cmptest.h" - -unsigned char p1[32] = { - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF -}; - -unsigned char p2[32] = { - 0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -unsigned char scalar[32]; -unsigned char out1[32]; -unsigned char out2[32]; - -int main(void) -{ - scalar[0] = 1U; - crypto_scalarmult_curve25519(out1, scalar, p1); - crypto_scalarmult_curve25519(out2, scalar, p2); - printf("%d\n", memcmp(out1, out2, sizeof out1)); - - return 0; -} diff --git a/test/default/scalarmult8.exp b/test/default/scalarmult8.exp deleted file mode 100644 index 573541ac..00000000 --- a/test/default/scalarmult8.exp +++ /dev/null @@ -1 +0,0 @@ -0