diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-12-13 20:22:34 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-30 08:37:22 -0500 |
commit | e2aeaeb76c2fd04a8b5934b7682823d77dc6f064 (patch) | |
tree | 3317493ff9a96506017bf4122cf2aaf55f57b120 /src/common/crypto_ed25519.h | |
parent | 60769e710f1099168f7508fe6834e458ce435ad9 (diff) | |
download | tor-e2aeaeb76c2fd04a8b5934b7682823d77dc6f064.tar.gz tor-e2aeaeb76c2fd04a8b5934b7682823d77dc6f064.zip |
Make a bunch of signature/digest-checking functions mockable
Diffstat (limited to 'src/common/crypto_ed25519.h')
-rw-r--r-- | src/common/crypto_ed25519.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/common/crypto_ed25519.h b/src/common/crypto_ed25519.h index 56782cc12e..f4a4adad68 100644 --- a/src/common/crypto_ed25519.h +++ b/src/common/crypto_ed25519.h @@ -51,9 +51,9 @@ int ed25519_keypair_generate(ed25519_keypair_t *keypair_out, int extra_strong); int ed25519_sign(ed25519_signature_t *signature_out, const uint8_t *msg, size_t len, const ed25519_keypair_t *key); -int ed25519_checksig(const ed25519_signature_t *signature, - const uint8_t *msg, size_t len, - const ed25519_public_key_t *pubkey); +MOCK_DECL(int,ed25519_checksig,(const ed25519_signature_t *signature, + const uint8_t *msg, size_t len, + const ed25519_public_key_t *pubkey)); MOCK_DECL(int, ed25519_sign_prefixed,(ed25519_signature_t *signature_out, @@ -84,9 +84,9 @@ typedef struct { size_t len; } ed25519_checkable_t; -int ed25519_checksig_batch(int *okay_out, - const ed25519_checkable_t *checkable, - int n_checkable); +MOCK_DECL(int, ed25519_checksig_batch,(int *okay_out, + const ed25519_checkable_t *checkable, + int n_checkable)); int ed25519_keypair_from_curve25519_keypair(ed25519_keypair_t *out, int *signbit_out, @@ -132,5 +132,9 @@ void crypto_ed25519_testing_force_impl(const char *name); void crypto_ed25519_testing_restore_impl(void); #endif +#ifdef CRYPTO_ED25519_PRIVATE +MOCK_DECL(STATIC int, ed25519_impl_spot_check, (void)); +#endif + #endif |