X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fmain-des-test.c;h=c1ef54f48d931a92a3d71541099a927be09978fc;hb=701cee0d98aab48dd3192c8cc7c77eb42581bc56;hp=19ddadd6228a2bb59514af8f82e79a82457f9382;hpb=7b5401ab9ce23a5da1de8b6c7de3a1aa20ac4cf8;p=avr-crypto-lib.git diff --git a/test_src/main-des-test.c b/test_src/main-des-test.c index 19ddadd..c1ef54f 100644 --- a/test_src/main-des-test.c +++ b/test_src/main-des-test.c @@ -27,11 +27,13 @@ #include "debug.h" #include "des.h" -#include "nessie_bc_test.h" #include "cli.h" #include "performance_test.h" -#include "bcal/bcal-performance.h" -#include "bcal/bcal_des.h" +#include "bcal-performance.h" +#include "bcal-nessie.h" +#include "bcal_des.h" +#include "bcal_tdes.h" +#include "bcal_tdes2.h" #include #include @@ -39,39 +41,20 @@ char* algo_name = "DES"; -const bcdesc_t* algolist[] PROGMEM = { +const bcdesc_t* const algolist[] PROGMEM = { (bcdesc_t*)&des_desc, + (bcdesc_t*)&tdes2_desc, + (bcdesc_t*)&tdes_desc, NULL }; /***************************************************************************** * additional validation-functions * *****************************************************************************/ -void des_init_dummy(const void* key, uint16_t keysize_b, void* ctx){ - memcpy(ctx, key, 8); -} - -void des_enc_dummy(void* buffer, void* ctx){ - des_enc(buffer, buffer, ctx); -} - -void des_dec_dummy(void* buffer, void* ctx){ - des_dec(buffer, buffer, ctx); -} void testrun_nessie_des(void){ - nessie_bc_init(); - nessie_bc_ctx.blocksize_B = 8; - nessie_bc_ctx.keysize_b = 64; - nessie_bc_ctx.name = algo_name; - nessie_bc_ctx.ctx_size_B = 8; - nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)des_enc_dummy; - nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)des_dec_dummy; - nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)des_init_dummy; - - nessie_bc_run(); + bcal_nessie_multiple(algolist); } - void testrun_performance_des(void){ bcal_performance_multiple(algolist); } @@ -84,7 +67,7 @@ const char test_str[] PROGMEM = "test"; const char performance_str[] PROGMEM = "performance"; const char echo_str[] PROGMEM = "echo"; -cmdlist_entry_t cmdlist[] PROGMEM = { +const cmdlist_entry_t cmdlist[] PROGMEM = { { nessie_str, NULL, testrun_nessie_des }, { test_str, NULL, testrun_nessie_des }, { performance_str, NULL, testrun_performance_des},