7 #include "serial-tools.h"
12 #include "nessie_hash_test.h"
17 char* algo_name = "SHA-256";
19 /*****************************************************************************
20 * additional validation-functions *
21 *****************************************************************************/
22 void sha256_next_dummy(void* buffer, void* ctx){
23 sha256_nextBlock(ctx, buffer);
26 void sha256_last_dummy(void* buffer, uint16_t size_b, void* ctx){
27 sha256_lastBlock(ctx, buffer, size_b);
30 void testrun_nessie_sha256(void){
31 nessie_hash_ctx.hashsize_b = 256;
32 nessie_hash_ctx.blocksize_B = 512/8;
33 nessie_hash_ctx.ctx_size_B = sizeof(sha256_ctx_t);
34 nessie_hash_ctx.name = algo_name;
35 nessie_hash_ctx.hash_init = (nessie_hash_init_fpt)sha256_init;
36 nessie_hash_ctx.hash_next = (nessie_hash_next_fpt)sha256_next_dummy;
37 nessie_hash_ctx.hash_last = (nessie_hash_last_fpt)sha256_last_dummy;
38 nessie_hash_ctx.hash_conv = (nessie_hash_conv_fpt)sha256_ctx2hash;
45 /*****************************************************************************
47 *****************************************************************************/
54 uart_putstr_P(PSTR("\r\n\r\nCrypto-VS ("));
55 uart_putstr(algo_name);
56 uart_putstr_P(PSTR(")\r\nloaded and running\r\n"));
60 if (!getnextwordn(str,20)) {DEBUG_S("DBG: W1\r\n"); goto error;}
61 if (strcmp(str, "nessie")) {DEBUG_S("DBG: 1b\r\n"); goto error;}
62 testrun_nessie_sha256();
66 uart_putstr("ERROR\r\n");