]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - test_src/shavs.c
host tools for verification +testvectors
[avr-crypto-lib.git] / test_src / shavs.c
index 39c87bb754932354391233e4e4a9220b6de2bdbd..c6518610504f1668dd4d765d70097a02b763eb33 100644 (file)
@@ -177,7 +177,9 @@ void shavs_test1(void){
                cli_putstr_P(PSTR("\r\n"));
                while((c=cli_getc_cecho())!='M' && c!='m'){
                        if(!isblank(c)){
-                               cli_putstr_P(PSTR("\r\nERROR: wrong input (1)!\r\n"));
+                               cli_putstr_P(PSTR("\r\nERROR: wrong input (1) [0x"));
+                               cli_hexdump(&c, 1);
+                               cli_putstr_P(PSTR("]!\r\n"));
                                return;
                        }
                }
@@ -212,7 +214,7 @@ void shavs_test1(void){
                }
                
                uint8_t diggest[pgm_read_word(shavs_algo->hashsize_b)/8];
-               if(length%(buffersize_B*8)==0)
+               if(length && length%(buffersize_B*8)==0)
                        hfal_hash_nextBlock(&ctx, buffer);
                hfal_hash_lastBlock(&ctx, buffer, length%(buffersize_B*8));
                hfal_hash_ctx2hash(diggest, &ctx);