X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fsec%2Fbenchmarks.c;h=d0e3cdfffaf8aaacc21d34c47c7508a41c10af10;hb=751e0228258e4c9e738fdcbfd43e45cdf873a553;hp=afe727517b39280acbdcc16ff38e3f6cca1bfd51;hpb=d49cf5d4b33cdefaa113ec88d83ac832de179554;p=bertos.git diff --git a/bertos/sec/benchmarks.c b/bertos/sec/benchmarks.c index afe72751..d0e3cdff 100644 --- a/bertos/sec/benchmarks.c +++ b/bertos/sec/benchmarks.c @@ -1,5 +1,4 @@ #include "benchmarks.h" -#include #include #include @@ -31,17 +30,51 @@ void prng_benchmark(PRNG *prng, const char *hname, int numbytes) prng_reseed(prng, buf); ticks_t t = timer_clock(); + enum { CYCLES = 2048 }; - for (int j=0;j<2048;++j) { + for (int j=0;j= cipher_key_len(c)); + cipher_set_key(c, buf); + + uint8_t iv[cipher_block_len(c)]; + memset(iv, 0, sizeof(iv)); + + ticks_t t = timer_clock(); + enum { CYCLES = 64 }; + + for (int j=0;j