C++ compat

This commit is contained in:
Frank Denis 2014-12-18 00:12:50 +01:00
parent 9036d62fc9
commit bfcd1612c7

View File

@ -17,12 +17,12 @@ int main(void)
size_t mlen; size_t mlen;
size_t i; size_t i;
alicepk = sodium_malloc(crypto_box_PUBLICKEYBYTES); alicepk = (unsigned char *) sodium_malloc(crypto_box_PUBLICKEYBYTES);
alicesk = sodium_malloc(crypto_box_SECRETKEYBYTES); alicesk = (unsigned char *) sodium_malloc(crypto_box_SECRETKEYBYTES);
bobpk = sodium_malloc(crypto_box_PUBLICKEYBYTES); bobpk = (unsigned char *) sodium_malloc(crypto_box_PUBLICKEYBYTES);
bobsk = sodium_malloc(crypto_box_SECRETKEYBYTES); bobsk = (unsigned char *) sodium_malloc(crypto_box_SECRETKEYBYTES);
mac = sodium_malloc(crypto_box_MACBYTES); mac = (unsigned char *) sodium_malloc(crypto_box_MACBYTES);
nonce = sodium_malloc(crypto_box_NONCEBYTES); nonce = (unsigned char *) sodium_malloc(crypto_box_NONCEBYTES);
crypto_box_keypair(alicepk, alicesk); crypto_box_keypair(alicepk, alicesk);
crypto_box_keypair(bobpk, bobsk); crypto_box_keypair(bobpk, bobsk);
mlen = (size_t) randombytes_uniform((uint32_t)sizeof m); mlen = (size_t) randombytes_uniform((uint32_t)sizeof m);