diff options
author | Dan Klein <danklei@cisco.com> | 2015-08-24 13:22:48 +0300 |
---|---|---|
committer | Dan Klein <danklei@cisco.com> | 2015-08-24 13:22:48 +0300 |
commit | dab741a80699f86e86c91718872a052cca9bbb25 (patch) | |
tree | 1959c4a2cea440170a5113dcb067796cb20ffb64 /external_libs/python/pyzmq-14.7.0/bundled/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c | |
parent | d3f26ece7d4383df0b22fe9c3cb3e695381ec737 (diff) |
Fixed dependencies of Control Plane to use external_lib sources
Diffstat (limited to 'external_libs/python/pyzmq-14.7.0/bundled/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c')
-rw-r--r-- | external_libs/python/pyzmq-14.7.0/bundled/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/external_libs/python/pyzmq-14.7.0/bundled/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c b/external_libs/python/pyzmq-14.7.0/bundled/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c new file mode 100644 index 00000000..e2a03faa --- /dev/null +++ b/external_libs/python/pyzmq-14.7.0/bundled/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c @@ -0,0 +1,27 @@ +#include <string.h> + +#include "crypto_hash_sha512.h" +#include "crypto_scalarmult_curve25519.h" +#include "api.h" +#include "randombytes.h" + +int crypto_box_seed_keypair( + unsigned char *pk, + unsigned char *sk, + const unsigned char *seed +) +{ + unsigned char hash[64]; + crypto_hash_sha512(hash,seed,32); + memmove(sk,hash,32); + return crypto_scalarmult_curve25519_base(pk,sk); +} + +int crypto_box_keypair( + unsigned char *pk, + unsigned char *sk +) +{ + randombytes_buf(sk,32); + return crypto_scalarmult_curve25519_base(pk,sk); +} |