From 70d39b9bfc34e332ef8dbd3c8fa802c86011e72f Mon Sep 17 00:00:00 2001 From: ~hatteb-mitlyd Date: Thu, 10 Apr 2014 17:08:20 -0700 Subject: [PATCH] fix/create ed25519 build, muffle warnings --- outside/ed25519/.gitignore | 1 + outside/ed25519/Makefile | 23 +++++++++++++++++++++++ outside/ed25519/src/sha512.c | 8 ++++---- 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 outside/ed25519/.gitignore create mode 100644 outside/ed25519/Makefile diff --git a/outside/ed25519/.gitignore b/outside/ed25519/.gitignore new file mode 100644 index 0000000000..9c8cd8d8b6 --- /dev/null +++ b/outside/ed25519/.gitignore @@ -0,0 +1 @@ +ed25519.a diff --git a/outside/ed25519/Makefile b/outside/ed25519/Makefile new file mode 100644 index 0000000000..ce70c2bd32 --- /dev/null +++ b/outside/ed25519/Makefile @@ -0,0 +1,23 @@ +# A simple makefile. +# +CFLAGS= -O2 -g -Wall + +.c.o: + $(CC) -c $(CFLAGS) -o $@ $< + +OFILES=\ + src/add_scalar.o \ + src/fe.o \ + src/ge.o \ + src/key_exchange.o \ + src/keypair.o \ + src/sc.o \ + src/seed.o \ + src/sha512.o \ + src/sign.o \ + src/verify.o + +all: ed25519.a($(OFILES)) + +clean: + -rm $(OFILES) ed25519.a diff --git a/outside/ed25519/src/sha512.c b/outside/ed25519/src/sha512.c index 635d8ae097..cb8ae71753 100644 --- a/outside/ed25519/src/sha512.c +++ b/outside/ed25519/src/sha512.c @@ -268,8 +268,8 @@ int sha512(const unsigned char *message, size_t message_len, unsigned char *out) { sha512_context ctx; int ret; - if (ret = sha512_init(&ctx)) return ret; - if (ret = sha512_update(&ctx, message, message_len)) return ret; - if (ret = sha512_final(&ctx, out)) return ret; + if ((ret = sha512_init(&ctx))) return ret; + if ((ret = sha512_update(&ctx, message, message_len))) return ret; + if ((ret = sha512_final(&ctx, out))) return ret; return 0; -} \ No newline at end of file +}