]> git.cryptolib.org Git - avr-crypto-lib.git/commitdiff
footer got two newlines at the end
authorbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Sun, 6 Apr 2008 12:24:49 +0000 (12:24 +0000)
committerbg <bg@b1d182e4-1ff8-0310-901f-bddb46175740>
Sun, 6 Apr 2008 12:24:49 +0000 (12:24 +0000)
nessie_bc_test.c
nessie_hash_test.c
nessie_stream_test.c

index fdad8e19d2578f45944a400769b306ca7c8428df..db28588354e46134e9cc101cba8b0c0030f2dad5 100644 (file)
@@ -176,7 +176,7 @@ static void print_header(void){
 }
 
 static void print_footer(void){
-       uart_putstr_P(PSTR("\r\n\r\n\r\n\r\nEnd of test vectors"));
+       uart_putstr_P(PSTR("\r\n\r\n\r\n\r\nEnd of test vectors\r\n\r\n"));
 }
 
 void nessie_run(void){
index 9417623c6f3df07726c1c0a19a98bcbddb65845a..598abc08ae9af13c93f1de40076e2f9c9633f7fb 100644 (file)
@@ -120,7 +120,7 @@ static void print_header(void){
 }
 
 static void print_footer(void){
-       uart_putstr_P(PSTR("\r\n\r\n\r\n\r\nEnd of test vectors"));
+       uart_putstr_P(PSTR("\r\n\r\n\r\n\r\nEnd of test vectors\r\n\r\n"));
 }
 
 static
@@ -225,6 +225,7 @@ void one_in512_hash(uint16_t pos){
        uart_putstr_P(PSTR("*00"));
        
        /* now the real stuff */
+       memset(block, 0, 512/8);
        block[pos>>3] = 0x80>>(pos&0x7);
        nessie_hash_ctx.hash_init(ctx);
        while(n>=nessie_hash_ctx.blocksize_B*8){
@@ -234,8 +235,6 @@ void one_in512_hash(uint16_t pos){
        nessie_hash_ctx.hash_last(block, n, ctx);
        nessie_hash_ctx.hash_conv(hash, ctx);
        printitem("hash", hash, (nessie_hash_ctx.hashsize_b+7)/8);
-       
-       
 }
 
 static
@@ -255,12 +254,12 @@ void tv4_hash(void){
                nessie_hash_ctx.hash_next(block, ctx);
                n    -= nessie_hash_ctx.blocksize_B*8;
        }
-       nessie_hash_ctx.hash_last(block, n*8, ctx);
+       nessie_hash_ctx.hash_last(block, n, ctx);
        nessie_hash_ctx.hash_conv(hash, ctx);
        printitem("hash", hash, (nessie_hash_ctx.hashsize_b+7)/8);
        for(i=1; i<100000L; ++i){ /* this assumes BLOCKSIZE >= HASHSIZE */
                nessie_hash_ctx.hash_init(ctx);
-               nessie_hash_ctx.hash_last(block, nessie_hash_ctx.hashsize_b, ctx);
+               nessie_hash_ctx.hash_last(hash, nessie_hash_ctx.hashsize_b, ctx);
                nessie_hash_ctx.hash_conv(hash, ctx);
        }
        printitem("iterated 100000 times", hash, (nessie_hash_ctx.hashsize_b+7)/8);
index bdd2978fa30b41fe0f0bf2ad666670e8f132591e..b271dea2e86f621474e6f90145d39762b2669adc 100644 (file)
@@ -226,7 +226,7 @@ static void print_header(void){
 }
 
 static void print_footer(void){
-       uart_putstr_P(PSTR("\r\n\r\n\r\n\r\nEnd of test vectors"));
+       uart_putstr_P(PSTR("\r\n\r\n\r\n\r\nEnd of test vectors\r\n\r\n"));
 }
 
 void nessie_stream_run(void){