This commit is contained in:
Frank Denis 2019-01-02 16:14:15 +01:00
parent d333f509a2
commit bdfda5dc83
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ tv_kdf(void)
context = (char *) sodium_malloc(crypto_kdf_CONTEXTBYTES);
master_key = (unsigned char *) sodium_malloc(crypto_kdf_KEYBYTES);
memcpy(context, "KDF test", strlen("KDF test"));
memcpy(context, "KDF test", sizeof "KDF test" -1U);
for (i = 0; i < crypto_kdf_KEYBYTES; i++) {
master_key[i] = i;
}

View File

@ -1259,7 +1259,7 @@ int main(void)
}
sodium_hex2bin(sk, crypto_sign_SECRETKEYBYTES,
"833fe62409237b9d62ec77587520911e9a759cec1d19755b7da901b96dca3d42",
2 * crypto_sign_SECRETKEYBYTES , NULL, NULL, NULL);
2 * crypto_sign_SECRETKEYBYTES / 2, NULL, NULL, NULL);
sodium_hex2bin(pk, crypto_sign_PUBLICKEYBYTES,
"ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf",
2 * crypto_sign_PUBLICKEYBYTES, NULL, NULL, NULL);