diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-17 11:27:08 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-31 19:46:00 -0400 |
commit | 17ea931ac70af3cc11c1729b09b8e1ff17a53348 (patch) | |
tree | e5662451f912f09d57bbc469f4931080ace12640 /src/lib/crypt_ops/crypto_dh.c | |
parent | 32bbc8f6b5e7d964439c6ba91f87f7d5fba673cc (diff) | |
download | tor-17ea931ac70af3cc11c1729b09b8e1ff17a53348.tar.gz tor-17ea931ac70af3cc11c1729b09b8e1ff17a53348.zip |
Implement DH in NSS.
Diffstat (limited to 'src/lib/crypt_ops/crypto_dh.c')
-rw-r--r-- | src/lib/crypt_ops/crypto_dh.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/crypt_ops/crypto_dh.c b/src/lib/crypt_ops/crypto_dh.c index 6f763e37a1..673ef311f9 100644 --- a/src/lib/crypt_ops/crypto_dh.c +++ b/src/lib/crypt_ops/crypto_dh.c @@ -43,6 +43,28 @@ const char OAKLEY_PRIME_2[] = "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" "49286651ECE65381FFFFFFFFFFFFFFFF"; +void +crypto_dh_init(void) +{ +#ifdef ENABLE_OPENSSL + crypto_dh_init_openssl(); +#endif +#ifdef ENABLE_NSS + crypto_dh_init_nss(); +#endif +} + +void +crypto_dh_free_all(void) +{ +#ifdef ENABLE_OPENSSL + crypto_dh_free_all_openssl(); +#endif +#ifdef ENABLE_NSS + crypto_dh_free_all_nss(); +#endif +} + /** Given a DH key exchange object, and our peer's value of g^y (as a * <b>pubkey_len</b>-byte value in <b>pubkey</b>) generate * <b>secret_bytes_out</b> bytes of shared key material and write them |