diff options
Diffstat (limited to 'src/lib/crypt_ops')
-rw-r--r-- | src/lib/crypt_ops/crypto_dh.c | 4 | ||||
-rw-r--r-- | src/lib/crypt_ops/crypto_dh.h | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/crypt_ops/crypto_dh.c b/src/lib/crypt_ops/crypto_dh.c index a2622cfc2f..c37e286daf 100644 --- a/src/lib/crypt_ops/crypto_dh.c +++ b/src/lib/crypt_ops/crypto_dh.c @@ -344,7 +344,7 @@ crypto_dh_generate_public(crypto_dh_t *dh) /** Generate g^x as necessary, and write the g^x for the key exchange * as a <b>pubkey_len</b>-byte value into <b>pubkey</b>. Return 0 on - * success, -1 on failure. <b>pubkey_len</b> must be \>= DH_BYTES. + * success, -1 on failure. <b>pubkey_len</b> must be \>= DH1024_KEY_LEN. */ int crypto_dh_get_public(crypto_dh_t *dh, char *pubkey, size_t pubkey_len) @@ -378,7 +378,7 @@ crypto_dh_get_public(crypto_dh_t *dh, char *pubkey, size_t pubkey_len) tor_assert(bytes >= 0); if (pubkey_len < (size_t)bytes) { log_warn(LD_CRYPTO, - "Weird! pubkey_len (%d) was smaller than DH_BYTES (%d)", + "Weird! pubkey_len (%d) was smaller than DH1024_KEY_LEN (%d)", (int) pubkey_len, bytes); return -1; } diff --git a/src/lib/crypt_ops/crypto_dh.h b/src/lib/crypt_ops/crypto_dh.h index 7b03e128a2..73a7bcb521 100644 --- a/src/lib/crypt_ops/crypto_dh.h +++ b/src/lib/crypt_ops/crypto_dh.h @@ -14,9 +14,7 @@ #define TOR_CRYPTO_DH_H #include "orconfig.h" - -/** Length of our DH keys. */ -#define DH_BYTES (1024/8) +#include "lib/defs/dh_sizes.h" typedef struct crypto_dh_t crypto_dh_t; |