X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=hfal-performance.c;h=5371f80d9f255594524fee8023a3eb37e3b9a9ad;hb=c6a15ac3ba0c10bfb904be257a2fe5bda7b3dea3;hp=6f51dc68bb2d21dcd93a78a776571cef9bd4afe0;hpb=056b130e8185a29017a3f3feb0b7db4e84080b09;p=avr-crypto-lib.git diff --git a/hfal-performance.c b/hfal-performance.c index 6f51dc6..5371f80 100644 --- a/hfal-performance.c +++ b/hfal-performance.c @@ -139,13 +139,12 @@ void hfal_stacksize(const hfdesc_t* hd){ uint8_t data[(hf.blocksize_b+7)/8]; uint8_t digest[(hf.hashsize_b+7)/8]; uint16_t t1, t2; - uint8_t i; if(hf.type!=HFDESC_TYPE_HASHFUNCTION) return; cli_putstr_P(PSTR("\r\n\r\n === ")); cli_putstr_P(hf.name); - cli_putstr_P(PSTR(" stack-usage === " + cli_putstr_P(PSTR(" stack-usage === ")); cli(); stack_measure_init(&smctx, PATTERN_A); @@ -153,7 +152,7 @@ void hfal_stacksize(const hfdesc_t* hd){ t1 = stack_measure_final(&smctx); stack_measure_init(&smctx, PATTERN_B); hf.init(&ctx); - t1 = stack_measure_final(&smctx); + t2 = stack_measure_final(&smctx); sei(); t1 = (t1>t2)?t1:t2; @@ -166,7 +165,7 @@ void hfal_stacksize(const hfdesc_t* hd){ t1 = stack_measure_final(&smctx); stack_measure_init(&smctx, PATTERN_B); hf.nextBlock(&ctx, data); - t1 = stack_measure_final(&smctx); + t2 = stack_measure_final(&smctx); sei(); t1 = (t1>t2)?t1:t2; @@ -179,7 +178,7 @@ void hfal_stacksize(const hfdesc_t* hd){ t1 = stack_measure_final(&smctx); stack_measure_init(&smctx, PATTERN_B); hf.lastBlock(&ctx, data, 0); - t1 = stack_measure_final(&smctx); + t2 = stack_measure_final(&smctx); sei(); t1 = (t1>t2)?t1:t2; @@ -192,7 +191,7 @@ void hfal_stacksize(const hfdesc_t* hd){ t1 = stack_measure_final(&smctx); stack_measure_init(&smctx, PATTERN_B); hf.ctx2hash(digest, &ctx); - t1 = stack_measure_final(&smctx); + t2 = stack_measure_final(&smctx); sei(); t1 = (t1>t2)?t1:t2;