From c4797b14ed1ccf70d2882aa9e9075ebef564d34b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 26 Nov 2019 21:20:02 +0100 Subject: DCE / GNUNET_TWEETNACL prefix for exported symbols --- src/util/tweetnacl-gnunet.h | 105 ++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 71 deletions(-) (limited to 'src/util/tweetnacl-gnunet.h') diff --git a/src/util/tweetnacl-gnunet.h b/src/util/tweetnacl-gnunet.h index d413541ff..239166ffc 100644 --- a/src/util/tweetnacl-gnunet.h +++ b/src/util/tweetnacl-gnunet.h @@ -13,75 +13,38 @@ #ifndef TWEETNACL_H #define TWEETNACL_H #include -#define crypto_scalarmult_PRIMITIVE "curve25519" -#define crypto_scalarmult crypto_scalarmult_curve25519 -#define crypto_scalarmult_base crypto_scalarmult_curve25519_base -#define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES -#define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES -#define crypto_scalarmult_IMPLEMENTATION \ - crypto_scalarmult_curve25519_IMPLEMENTATION -#define crypto_scalarmult_VERSION crypto_scalarmult_curve25519_VERSION -#define crypto_scalarmult_curve25519_tweet_BYTES 32 -#define crypto_scalarmult_curve25519_tweet_SCALARBYTES 32 -extern int crypto_scalarmult_curve25519_tweet (uint8_t *, - const uint8_t *, - const uint8_t *); -extern int crypto_scalarmult_curve25519_tweet_base (uint8_t *, - const uint8_t *); -#define crypto_scalarmult_curve25519_tweet_VERSION "-" -#define crypto_scalarmult_curve25519 crypto_scalarmult_curve25519_tweet -#define crypto_scalarmult_curve25519_base \ - crypto_scalarmult_curve25519_tweet_base -#define crypto_scalarmult_curve25519_BYTES \ - crypto_scalarmult_curve25519_tweet_BYTES -#define crypto_scalarmult_curve25519_SCALARBYTES \ - crypto_scalarmult_curve25519_tweet_SCALARBYTES -#define crypto_scalarmult_curve25519_VERSION \ - crypto_scalarmult_curve25519_tweet_VERSION -#define crypto_scalarmult_curve25519_IMPLEMENTATION \ - "crypto_scalarmult/curve25519/tweet" -#define crypto_sign_PRIMITIVE "ed25519" -#define crypto_sign crypto_sign_ed25519 -#define crypto_sign_BYTES crypto_sign_ed25519_BYTES -#define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES -#define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES -#define crypto_sign_IMPLEMENTATION crypto_sign_ed25519_IMPLEMENTATION -#define crypto_sign_VERSION crypto_sign_ed25519_VERSION -#define crypto_sign_ed25519_tweet_BYTES 64 -#define crypto_sign_ed25519_tweet_PUBLICKEYBYTES 32 -#define crypto_sign_ed25519_tweet_SECRETKEYBYTES 64 -extern int crypto_sign_ed25519_tweet (uint8_t *, - uint64_t *, - const uint8_t *, - uint64_t, - const uint8_t *); -extern int crypto_sign_ed25519_tweet_open (uint8_t *, - uint64_t *, - const uint8_t *, - uint64_t, - const uint8_t *); -extern int crypto_sign_ed25519_tweet_keypair (uint8_t *,uint8_t *); -#define crypto_sign_ed25519_tweet_VERSION "-" -#define crypto_sign_ed25519 crypto_sign_ed25519_tweet -#define crypto_sign_ed25519_open crypto_sign_ed25519_tweet_open -#define crypto_sign_ed25519_keypair crypto_sign_ed25519_tweet_keypair -#define crypto_sign_ed25519_BYTES crypto_sign_ed25519_tweet_BYTES -#define crypto_sign_ed25519_PUBLICKEYBYTES \ - crypto_sign_ed25519_tweet_PUBLICKEYBYTES -#define crypto_sign_ed25519_SECRETKEYBYTES \ - crypto_sign_ed25519_tweet_SECRETKEYBYTES -#define crypto_sign_ed25519_VERSION crypto_sign_ed25519_tweet_VERSION -#define crypto_sign_ed25519_IMPLEMENTATION "crypto_sign/ed25519/tweet" -void crypto_sign_pk_from_seed (uint8_t *pk, const uint8_t *seed); -void crypto_sign_sk_from_seed (uint8_t *sk, const uint8_t *seed); -int crypto_sign_ed25519_pk_to_curve25519 (uint8_t *x25519_pk, - const uint8_t *ed25519_pk); -int crypto_sign_detached_verify (const uint8_t *sig, - const uint8_t *m, - uint64_t n, - const uint8_t *pk); -int crypto_sign_detached (uint8_t *sig, - const uint8_t *m, - uint64_t n, - const uint8_t *sk); + + +#define GNUNET_TWEETNACL_SIGN_SECRETKEYBYTES 64 +#define GNUNET_TWEETNACL_SIGN_PUBLICBYTES 32 +#define GNUNET_TWEETNACL_SCALARMULT_BYTES 32 + +int +GNUNET_TWEETNACL_scalarmult_curve25519 (uint8_t *, + const uint8_t *, + const uint8_t *); +extern int +GNUNET_TWEETNACL_scalarmult_curve25519_base (uint8_t *, + const uint8_t *); +void +GNUNET_TWEETNACL_sign_pk_from_seed (uint8_t *pk, const uint8_t *seed); + +void +GNUNET_TWEETNACL_sign_sk_from_seed (uint8_t *sk, const uint8_t *seed); + +int +GNUNET_TWEETNACL_sign_ed25519_pk_to_curve25519 (uint8_t *x25519_pk, + const uint8_t *ed25519_pk); + +int +GNUNET_TWEETNACL_sign_detached_verify (const uint8_t *sig, + const uint8_t *m, + uint64_t n, + const uint8_t *pk); + +int +GNUNET_TWEETNACL_sign_detached (uint8_t *sig, + const uint8_t *m, + uint64_t n, + const uint8_t *sk); #endif -- cgit v1.2.3