3 #include "crypto_uint8.h"
5 #define TEST_NAME "generichash2"
11 crypto_generichash_state st
;
12 crypto_uint8 in
[MAXLEN
], out
[crypto_generichash_BYTES_MAX
], k
[crypto_generichash_KEYBYTES_MAX
];
15 for(h
= 0; h
< crypto_generichash_KEYBYTES_MAX
; ++h
) k
[h
] = h
;
17 for(i
= 0; i
< MAXLEN
; ++i
) {
19 crypto_generichash_init(&st
, k
, 1 + i
% crypto_generichash_KEYBYTES_MAX
,
20 1 + i
% crypto_generichash_BYTES_MAX
);
21 crypto_generichash_update(&st
, in
, i
);
22 crypto_generichash_update(&st
, in
, i
);
23 crypto_generichash_update(&st
, in
, i
);
24 crypto_generichash_final(&st
, out
, 1 + i
% crypto_generichash_BYTES_MAX
);
25 for (j
= 0;j
< 1 + i
% crypto_generichash_BYTES_MAX
;++j
) {
26 printf("%02x",(unsigned int) out
[j
]);