From ff97825ea54f098624008b3324c0b3e51f8e7021 Mon Sep 17 00:00:00 2001 From: Kris Kwiatkowski Date: Wed, 16 Jan 2019 17:20:24 +0000 Subject: [PATCH] Updates --- csidh/Makefile | 4 ++++ csidh/ref/csidh | 2 +- csidh/test/main.c | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/csidh/Makefile b/csidh/Makefile index 0617cbe..13f1b63 100644 --- a/csidh/Makefile +++ b/csidh/Makefile @@ -5,6 +5,7 @@ LDFLAGS= BUILD_DIR=build AR=ar rcs RANLIB=ranlib +GOPATH=/home/hdc/repos/nobs/build CODE_SRC_C = \ ref/csidh/rng.c \ @@ -30,5 +31,8 @@ all: $(CODE_OBJ) $(RANLIB) $(BUILD_DIR)/libcsidh.a $(CC) -o $(BUILD_DIR)/test test/main.c -L$(BUILD_DIR) -lcsidh +run: all + GOPATH=$(GOPATH) go run test/test.go + clean: rm -rf build diff --git a/csidh/ref/csidh b/csidh/ref/csidh index 08d5c77..7d60c84 160000 --- a/csidh/ref/csidh +++ b/csidh/ref/csidh @@ -1 +1 @@ -Subproject commit 08d5c77d3a92c6b1391be6ac71ab30f32ebcb632 +Subproject commit 7d60c846d3fa5298451b93dbb1ad6080b7a2bcec diff --git a/csidh/test/main.c b/csidh/test/main.c index 7244a15..ec9cfb9 100644 --- a/csidh/test/main.c +++ b/csidh/test/main.c @@ -17,6 +17,12 @@ static void fp_print(fp const *x) u512_print(&y); } +static void int_print(const int8_t v[37]) { + for (size_t i = 0; i<37; i++) + printf("%02hhx", v[i]); + printf("\n"); +} + int main() { for(size_t i=0; i<1000; i++) { private_key prA, prB; @@ -34,7 +40,8 @@ int main() { //csidh csidh(&shA, &pkA, &prB); csidh(&shB, &pkB, &prA); - fp_print(&shA.A); + int_print(prA.e); + fp_print(&pkA.A); assert(memcmp(&shA, &shB, sizeof(shB))==0); } }