From 8b36bb92998d4081ae99ea733a8f4ec57c0a8f04 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 26 Aug 2014 10:56:22 -0400 Subject: [PATCH] Add headers as needed to make ed25519_ref10 compile. --- src/ext/ed25519/ref10/crypto_hash_sha512.h | 4 ++++ src/ext/ed25519/ref10/crypto_int32.h | 3 +++ src/ext/ed25519/ref10/crypto_int64.h | 3 +++ src/ext/ed25519/ref10/crypto_sign.h | 6 ++++++ src/ext/ed25519/ref10/crypto_uint32.h | 3 +++ src/ext/ed25519/ref10/crypto_uint64.h | 3 +++ src/ext/ed25519/ref10/crypto_verify_32.h | 5 +++++ src/ext/ed25519/ref10/ed25519_ref10.h | 16 ++++++++++++++++ src/ext/ed25519/ref10/randombytes.h | 4 ++++ 9 files changed, 47 insertions(+) create mode 100644 src/ext/ed25519/ref10/crypto_hash_sha512.h create mode 100644 src/ext/ed25519/ref10/crypto_int32.h create mode 100644 src/ext/ed25519/ref10/crypto_int64.h create mode 100644 src/ext/ed25519/ref10/crypto_sign.h create mode 100644 src/ext/ed25519/ref10/crypto_uint32.h create mode 100644 src/ext/ed25519/ref10/crypto_uint64.h create mode 100644 src/ext/ed25519/ref10/crypto_verify_32.h create mode 100644 src/ext/ed25519/ref10/ed25519_ref10.h create mode 100644 src/ext/ed25519/ref10/randombytes.h diff --git a/src/ext/ed25519/ref10/crypto_hash_sha512.h b/src/ext/ed25519/ref10/crypto_hash_sha512.h new file mode 100644 index 0000000000..fa768aca24 --- /dev/null +++ b/src/ext/ed25519/ref10/crypto_hash_sha512.h @@ -0,0 +1,4 @@ +/* Added for Tor. */ +#include +#define crypto_hash_sha512(out, inp, len) \ + SHA512((inp), (len), (out)) diff --git a/src/ext/ed25519/ref10/crypto_int32.h b/src/ext/ed25519/ref10/crypto_int32.h new file mode 100644 index 0000000000..cd5c7c28c5 --- /dev/null +++ b/src/ext/ed25519/ref10/crypto_int32.h @@ -0,0 +1,3 @@ +/* Added for Tor. */ +#include "torint.h" +#define crypto_int32 int32_t diff --git a/src/ext/ed25519/ref10/crypto_int64.h b/src/ext/ed25519/ref10/crypto_int64.h new file mode 100644 index 0000000000..de0b602068 --- /dev/null +++ b/src/ext/ed25519/ref10/crypto_int64.h @@ -0,0 +1,3 @@ +/* Added for Tor. */ +#include "torint.h" +#define crypto_int64 int64_t diff --git a/src/ext/ed25519/ref10/crypto_sign.h b/src/ext/ed25519/ref10/crypto_sign.h new file mode 100644 index 0000000000..627ba0a421 --- /dev/null +++ b/src/ext/ed25519/ref10/crypto_sign.h @@ -0,0 +1,6 @@ +/* Added for Tor */ +#define crypto_sign ed25519_ref10_sign +#define crypto_sign_keypair ed25519_ref10_keygen +#define crypto_sign_open ed25519_ref10_open + +#include "ed25519_ref10.h" diff --git a/src/ext/ed25519/ref10/crypto_uint32.h b/src/ext/ed25519/ref10/crypto_uint32.h new file mode 100644 index 0000000000..62655a5b66 --- /dev/null +++ b/src/ext/ed25519/ref10/crypto_uint32.h @@ -0,0 +1,3 @@ +/* Added for Tor. */ +#include "torint.h" +#define crypto_uint32 uint32_t diff --git a/src/ext/ed25519/ref10/crypto_uint64.h b/src/ext/ed25519/ref10/crypto_uint64.h new file mode 100644 index 0000000000..cbda882a6a --- /dev/null +++ b/src/ext/ed25519/ref10/crypto_uint64.h @@ -0,0 +1,3 @@ +/* Added for Tor. */ +#include "torint.h" +#define crypto_uint64 uint64_t diff --git a/src/ext/ed25519/ref10/crypto_verify_32.h b/src/ext/ed25519/ref10/crypto_verify_32.h new file mode 100644 index 0000000000..0f63efc7a3 --- /dev/null +++ b/src/ext/ed25519/ref10/crypto_verify_32.h @@ -0,0 +1,5 @@ +/* Added for Tor. */ +#include "di_ops.h" +#define crypto_verify_32(a,b) \ + (! tor_memeq((a), (b), 32)) + diff --git a/src/ext/ed25519/ref10/ed25519_ref10.h b/src/ext/ed25519/ref10/ed25519_ref10.h new file mode 100644 index 0000000000..fc10a26700 --- /dev/null +++ b/src/ext/ed25519/ref10/ed25519_ref10.h @@ -0,0 +1,16 @@ +/* Added for Tor */ +#ifndef SRC_EXT_ED25519_REF10_H_INCLUDED_ +#define SRC_EXT_ED25519_REF10_H_INCLUDED_ +#include + +int ed25519_ref10_keygen(unsigned char *pk,unsigned char *sk); +int ed25519_ref10_open( + unsigned char *m,uint64_t *mlen, + const unsigned char *sm,uint64_t smlen, + const unsigned char *pk); +int ed25519_ref10_sign( + unsigned char *sm,uint64_t *smlen, + const unsigned char *m,uint64_t mlen, + const unsigned char *sk); + +#endif diff --git a/src/ext/ed25519/ref10/randombytes.h b/src/ext/ed25519/ref10/randombytes.h new file mode 100644 index 0000000000..fc709fcefc --- /dev/null +++ b/src/ext/ed25519/ref10/randombytes.h @@ -0,0 +1,4 @@ +/* Added for Tor. */ +#include "crypto.h" +#define randombytes(b, n) \ + (crypto_strongest_rand((b), (n)))