X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;ds=sidebyside;f=test_src%2Fnessie_hash_test.c;h=dbb98a0781ad10df79680c646574a4f341838018;hb=17332291e15183d71d88ed868275e3cb53917180;hp=a870b8283ca58dc09ce69b76bee89f8ee4d30cd2;hpb=2159c273c9d3361571a6ff1ab63d9bc76582fbab;p=avr-crypto-lib.git diff --git a/test_src/nessie_hash_test.c b/test_src/nessie_hash_test.c index a870b82..dbb98a0 100644 --- a/test_src/nessie_hash_test.c +++ b/test_src/nessie_hash_test.c @@ -1,6 +1,6 @@ /* nessie_hash_test.c */ /* - This file is part of the Crypto-avr-lib/microcrypt-lib. + This file is part of the This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify @@ -151,12 +151,22 @@ static void tv4_hash(void){ uint8_t ctx[nessie_hash_ctx.ctx_size_B]; uint8_t hash[(nessie_hash_ctx.hashsize_b+7)/8]; - uint8_t block[256/8]; - uint16_t n=256; + uint8_t block[nessie_hash_ctx.hashsize_b/8]; + uint16_t n=nessie_hash_ctx.hashsize_b; uint32_t i; uart_putstr_P(PSTR("\r\n message=")); - uart_putstr(PSTR("256 zero bits")); + if(nessie_hash_ctx.hashsize_b>=10000) + uart_putc('0' + (nessie_hash_ctx.hashsize_b/10000)%10); + if(nessie_hash_ctx.hashsize_b>=1000) + uart_putc('0' + (nessie_hash_ctx.hashsize_b/1000)%10); + if(nessie_hash_ctx.hashsize_b>=100) + uart_putc('0' + (nessie_hash_ctx.hashsize_b/100)%10); + if(nessie_hash_ctx.hashsize_b>=10) + uart_putc('0' + (nessie_hash_ctx.hashsize_b/10)%10); + uart_putc('0' + nessie_hash_ctx.hashsize_b%10); + + uart_putstr_P(PSTR(" zero bits")); memset(block, 0, 256/8); nessie_hash_ctx.hash_init(ctx);