]>
iEval git - authen-passphrase-scrypt.git/blob - scrypt-1.2.1/tests/test_scrypt.c
5 #include "crypto_scrypt.h"
8 static struct scrypt_test
{
16 { "password", "NaCl", 1024, 8, 16 },
17 { "pleaseletmein", "SodiumChloride", 16384, 8, 1 },
18 { "pleaseletmein", "SodiumChloride", 1048576, 8, 1 }
22 main(int argc
, char * argv
[])
24 struct scrypt_test
* test
;
30 (void)argc
; /* UNUSED */
31 (void)argv
; /* UNUSED */
34 test
< tests
+ sizeof(tests
) / sizeof(tests
[0]);
36 crypto_scrypt((const uint8_t *)test
->passwd
,
37 strlen(test
->passwd
), (const uint8_t *)test
->salt
,
38 strlen(test
->salt
), test
->N
, test
->r
, test
->p
,
40 printf("scrypt(\"%s\", \"%s\", %u, %u, %u, 64) =\n",
41 test
->passwd
, test
->salt
, (unsigned int)test
->N
,
42 (unsigned int)(test
->r
), (unsigned int)test
->p
);
43 for (i
= 0; i
< 64; i
++) {
44 printf("%02x ", (uint8_t)kbuf
[i
]);
This page took 0.037758 seconds and 4 git commands to generate.