X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=blake_large.c;h=e4a35b6a7d4e07e4448cfbdef65e585640b47a7a;hb=214c1e035b25e56895483227588cf5c36392feef;hp=722d27717e7e65640b1613910ec09678d482ccea;hpb=4e31ebdb0529eeb61efd3fe181b9de1abe6d7f6c;p=avr-crypto-lib.git diff --git a/blake_large.c b/blake_large.c index 722d277..e4a35b6 100644 --- a/blake_large.c +++ b/blake_large.c @@ -32,32 +32,9 @@ #include "blake_large.h" #include "blake_common.h" -#define DEBUG 0 -#define DEBUG_2 0 - #define BUG_3 0 /* bug compatibility with reference code */ #define BUG_4 0 /* bug compatibility with reference code */ -#if DEBUG_2 - #include "cli.h" -#endif - -#if DEBUG - #include "cli.h" - void dump_v(uint64_t* v){ - uint8_t i; - cli_putstr_P(PSTR("\r\n=== v dump ===")); - for(i=0; i<16; ++i){ - if(i%4==0) - cli_putstr_P(PSTR("\r\n\t")); - cli_hexdump_rev(v+i, 8); - cli_putc(' '); - } - } -#else - #define dump_v(v) -#endif - uint64_t pgm_read_qword(void* p){ union{ uint64_t v64; @@ -98,18 +75,6 @@ void blake_large_g(uint8_t r, uint8_t i, uint64_t* v, const uint64_t* m){ d = pgm_read_byte(blake_index_lut+4*i+3); s0 = pgm_read_byte(blake_sigma+16*r+2*i+0); s1 = pgm_read_byte(blake_sigma+16*r+2*i+1); -#if DEBUG - if(i==0){ - cli_putstr_P(PSTR("\r\n s0 = ")); - cli_hexdump(&s0, 1); - cli_putstr_P(PSTR(" s1 = ")); - cli_hexdump(&s1, 1); - cli_putstr_P(PSTR("\r\n m[s0] = ")); - cli_hexdump_rev(m+s0, 4); - cli_putstr_P(PSTR("\r\n m[s1] = ")); - cli_hexdump_rev(m+s1, 4); - } -#endif v[a] += v[b] + (m[s0] ^ pgm_read_qword(&(blake_c[s1]))); v[d] = ROTR64(v[d]^v[a], 32); v[c] += v[d]; @@ -143,26 +108,9 @@ void blake_large_changeendian(void* dest, const void* src){ void blake_large_compress(uint64_t* v,const void* m){ uint8_t r,i; -#if DEBUG - cli_putstr_P(PSTR("\r\n== compress 64 ==")); - dump_v(v); -#endif -#if DEBUG_2 - cli_putstr_P(PSTR("\r\n=== message block ===\r\n m =")); - cli_hexdump_block(m, 1024/8, 4, 16); -#endif for(r=0; r<14; ++r){ for(i=0; i<8; ++i){ blake_large_g(r%10, i, v, (uint64_t*)m); -#if DEBUG - if(1){ - cli_putstr_P(PSTR("\r\n ROUND: ")); - cli_hexdump(&r,1); - cli_putstr_P(PSTR(" I: ")); - cli_hexdump(&i,1); - dump_v(v); - } -#endif } } }