uint16_t *keysize_list=NULL;
uint16_t items,i;
- items = get_keysizes(pgm_read_word(&(bcd->valid_keysize_desc)), &keysize_list);
+ items = get_keysizes((PGM_VOID_P)pgm_read_word(&(bcd->valid_keysize_desc)), &keysize_list);
if(items){
for(i=0; i<items; ++i){
nessie_bc_ctx.keysize_b = keysize_list[i];
#include <avr/pgmspace.h>
#include <stdlib.h>
+#include <string.h>
#include "blockcipher_descriptor.h"
#include "des.h"
#include "keysize_descriptor.h"
#include <stdint.h>
#include <string.h>
#include "cast5.h"
- #include "config.h"
- #include "debug.h"
#undef DEBUG
void cscipher_init(const void* key, cscipher_ctx_t* ctx){
uint8_t tmp_key[16], tmp[8];
- uint8_t i,j,k,t;
+ uint8_t i,j,k,t=0;
memcpy(tmp_key, key, 16);
for(i=0; i<9; ++i){
#if DEBUG
dsa_domainparameters_t domain;
} dsa_ctx_t;
+typedef uint8_t(*rand_func_ptr_t)(void);
+
#define DSA_SIGNATURE_OK 1
#define DSA_SIGNATURE_FAIL 0
const dsa_ctx_t* ctx, const bigint_t* k);
uint8_t dsa_sign_message(dsa_signature_t* s, const void* m, uint16_t m_len_b,
const hfdesc_t* hash_desc, const dsa_ctx_t* ctx,
- const uint8_t(*rand_in)(void));
+ const rand_func_ptr_t rand_in);
uint8_t dsa_verify_bigint(const dsa_signature_t* s, const bigint_t* m,
const dsa_ctx_t* ctx);
uint8_t dsa_verify_message(const dsa_signature_t* s, const void* m, uint16_t m_len_b,
uint8_t dsa_sign_message(dsa_signature_t* s, const void* m, uint16_t m_len_b,
const hfdesc_t* hash_desc, const dsa_ctx_t* ctx,
- const uint8_t(*rand_in)(void)){
+ const rand_func_ptr_t rand_in){
bigint_t z, k;
uint8_t i, n_B = ctx->domain.q.length_B;
uint8_t hash_value[(n_B>(hfal_hash_getHashsize(hash_desc)+7)/8)?n_B:(hfal_hash_getHashsize(hash_desc)+7)/8];
static inline
void group(uint8_t *a){
uint8_t b[128];
- uint8_t i,j,k,x;
+ uint8_t i,j,k,x=0;
for(i=0; i<128; ++i){
j=i/8;
for(k=0;k<8;++k){
jh_round(a, rc);
jh_next_round_const(rc);
}
- uint8_t r,x,y;
+ uint8_t r=0,x,y;
for(i=0; i<128; ++i){
if(i%4==0){
for(i=0;i<35;++i){
jh_round(a, i);
}
- uint8_t r;
+ uint8_t r=0;
uint8_t *pr;
pr = jh_round_const + 32*35;
ALGO_NAME := BIGINT
# comment out the following line for removement of BigInt from the build process
-AUX += $(ALGO_NAME)
+#AUX += $(ALGO_NAME)
$(ALGO_NAME)_DIR := bigint/
$(ALGO_NAME)_INCDIR := memxor/ noekeon/
$(ALGO_NAME)_DIR := dsa/
$(ALGO_NAME)_INCDIR := memxor/ bigint/ sha1/ noekeon/ base64/ hfal/
-$(ALGO_NAME)_OBJ := bigint.o bigint_io.o bigint_add_u.o sha1-asm.o dsa_sign.o dsa_verify.o dsa_key_blob.o base64_enc.o
+$(ALGO_NAME)_OBJ := bigint.o bigint_io.o sha1-asm.o dsa_sign.o dsa_verify.o dsa_key_blob.o base64_enc.o
$(ALGO_NAME)_TEST_BIN := main-dsa-test.o $(CLI_STD) hfal_sha1.o $(HFAL_STD) \
noekeon_asm.o noekeon_prng.o memxor.o
$(ALGO_NAME)_DIR := mqq-sign/
$(ALGO_NAME)_INCDIR := memxor/
-$(ALGO_NAME)_OBJ := mqq160-sign.o mqq160-sign_P.o mqq160-sign_testkey.o memxor.o
+$(ALGO_NAME)_OBJ := mqq160-sign.o mqq160-sign_P.o mqq160-sign_testkey.o memxor.o memxor_p.o
$(ALGO_NAME)_TEST_BIN := main-mqq160-sign-test.o performance_test.o stack_measuring.o $(CLI_STD)
$(ALGO_NAME)_NESSIE_TEST := test
$(ALGO_NAME)_PERFORMANCE_TEST := performance
$(ALGO_NAME)_DIR := rsa/
$(ALGO_NAME)_INCDIR := bigint/ noekeon/ memxor/ hfal/
-$(ALGO_NAME)_OBJ := bigint.o bigint_io.o bigint_add_u.o rsa.o rsa_key_blob.o
+$(ALGO_NAME)_OBJ := bigint.o bigint_io.o rsa.o rsa_key_blob.o
$(ALGO_NAME)_TEST_BIN := main-rsa-test.o $(CLI_STD) \
noekeon_asm.o noekeon_prng.o memxor.o
8, 9, 10, 11, 12, 13, 14, 15,
};
-static void memxor_P(void* dest, const void* src, uint16_t length){
- while(length--){
- *((uint8_t*)dest) ^= pgm_read_byte(src);
- dest = (uint8_t*)dest +1;
- src = (uint8_t*)src +1;
- }
-}
-
static void memxor_idx_P(uint8_t* dest, const uint8_t* src, uint16_t length, uint8_t dist){
while(length--){
*((uint8_t*)dest) ^= pgm_read_byte((uint8_t*)src);
#include "aes.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "dump.h"
#include "bcal-eax.h"
#include "cmacvs.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include <stdint.h>
#include <string.h>
*****************************************************************************/
void testrun_nessie_aes(void){
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(aes128_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)aes128_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)aes128_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)aes_init;
- nessie_bc_run();
-
- nessie_bc_ctx.keysize_b = 192;
- nessie_bc_ctx.ctx_size_B = sizeof(aes192_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)aes192_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)aes192_dec;
- nessie_bc_run();
-
- nessie_bc_ctx.keysize_b = 256;
- nessie_bc_ctx.ctx_size_B = sizeof(aes256_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)aes256_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)aes256_dec;
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
void testrun_test_aes(void){
#include "debug.h"
#include "aes.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "blockcipher_descriptor.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_aes128.h"
#include <stdint.h>
#include <string.h>
*****************************************************************************/
void testrun_nessie_aes(void){
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(aes128_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)aes128_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)aes128_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)aes_init;
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
void testrun_test_aes(void){
#include "debug.h"
#include "aes.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "blockcipher_descriptor.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_aes192.h"
#include <stdint.h>
#include <string.h>
*****************************************************************************/
void testrun_nessie_aes(void){
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 192;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(aes192_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)aes192_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)aes192_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)aes_init;
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
void testrun_testkey_aes192(void){
#include "debug.h"
#include "aes.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "blockcipher_descriptor.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_aes256.h"
#include <stdint.h>
#include <string.h>
*****************************************************************************/
void testrun_nessie_aes(void){
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 256;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(aes256_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)aes256_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)aes256_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)aes_init;
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
void testrun_testkey_aes256(void){
cli_putstr_P(PSTR(" + "));
bigint_print_hex(&b);
cli_putstr_P(PSTR("<<8*"));
- bigint_print_hex(&scale);
+ cli_hexdump_rev(&scale, 2);
cli_putstr_P(PSTR(" = "));
uint8_t *c_b;
c_b = malloc(((a.length_B>(b.length_B+scale))?a.length_B:(b.length_B+scale))+2);
#include "debug.h"
#include "camellia.h"
-#include "nessie_bc_test.h"
#include "performance_test.h"
#include "cli.h"
#include "bcal_camellia128.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
/*****************************************************************************
* additional validation-functions *
*****************************************************************************/
-void camellia128_init_dummy(void* key, uint16_t keysize_b, void* ctx){
- camellia128_init(key, ctx);
-}
void testrun_nessie_camellia(void){
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(camellia128_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)camellia128_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)camellia128_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)camellia128_init_dummy;
-
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
/*
#include "debug.h"
#include <cast5.h>
-#include "nessie_bc_test.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_cast5.h"
#include "cli.h"
*****************************************************************************/
void testrun_nessie_cast5(void){
- nessie_bc_ctx.blocksize_B = 8;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(cast5_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)cast5_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)cast5_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)cast5_init;
-
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
/*****************************************************************************
#include "debug.h"
#include "cast6.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_cast6.h"
#include <stdint.h>
void testrun_nessie_cast6(void){
- nessie_bc_init();
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(cast6_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)cast6_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)cast6_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)cast6_init;
-
- nessie_bc_run();
-
- nessie_bc_ctx.keysize_b = 192;
- nessie_bc_run();
-
- nessie_bc_ctx.keysize_b = 256;
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
void testrun_rfc_cast6(void){
#include "debug.h"
#include "des.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
* additional validation-functions *
*****************************************************************************/
void test_256(void){
- uint8_t data[] = {0x53, 0x58, 0x7B, 0xC8 };
uint8_t hash[32];
uint8_t null[KECCAK256_BLOCKSIZE_B];
memset(null, 0, KECCAK256_BLOCKSIZE_B);
#include "debug.h"
#include "noekeon.h"
-#include "nessie_bc_test.h"
#include "bcal-nessie.h"
#include "performance_test.h"
#include "bcal-performance.h"
*****************************************************************************/
void testrun_nessie_noekeon(void){
- bcal_nessie_multiple(&algolist);
+ bcal_nessie_multiple(algolist);
}
#include "debug.h"
#include <present.h>
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_present.h"
#include <stdlib.h>
}
void testrun_nessie_present(void){
- nessie_bc_ctx.blocksize_B = 8;
- nessie_bc_ctx.keysize_b = 80;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(present_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)present_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)present_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)present_genctx_dummy;
-
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
void testrun_selfenc(uint8_t* key, uint8_t* buffer){
#include "debug.h"
#include "rc5.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_rc5.h"
#include <stdint.h>
}
void testrun_nessie_rc5(void){
- nessie_bc_init();
- nessie_bc_ctx.blocksize_B = 8;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(rc5_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)rc5_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)rc5_dec;
- nessie_bc_ctx.cipher_free = (nessie_bc_free_fpt)rc5_free;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)rc5_genctx_dummy;
-
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
#include "debug.h"
#include "rc6.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_rc6.h"
#include <stdint.h>
}
void testrun_nessie_rc6(void){
- nessie_bc_init();
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(rc6_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)rc6_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)rc6_dec;
- nessie_bc_ctx.cipher_free = (nessie_bc_free_fpt)rc6_free;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)rc6_init;
-
- nessie_bc_run();
-
- nessie_bc_ctx.keysize_b = 192;
- nessie_bc_run();
-
- nessie_bc_ctx.keysize_b = 256;
- nessie_bc_run();
-
+ bcal_nessie_multiple(algolist);
}
bigint_t m,c,m_;
uint8_t mw[rsa_ctx.modulus.length_B], cw[rsa_ctx.modulus.length_B], m_w[rsa_ctx.modulus.length_B];
- uint8_t i;
print_rsa_ctx(&rsa_ctx);
m.wordv = mw;
#include "debug.h"
#include "seed.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_seed.h"
#include <stdint.h>
}
void testrun_nessie_seed(void){
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(seed_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)seed_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)seed_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)seed_genctx_dummy;
-
- nessie_bc_run();
-
+ bcal_nessie_multiple(algolist);
}
#include "debug.h"
#include "serpent.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_serpent.h"
#include <stdint.h>
}
void testrun_nessie_serpent(void){
- nessie_bc_ctx.blocksize_B = 16;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(serpent_ctx_t);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)serpent_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)serpent_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)serpent_genctx_dummy;
-
- nessie_bc_run();
-
- nessie_bc_ctx.keysize_b = 192;
- nessie_bc_run();
-
- nessie_bc_ctx.keysize_b = 256;
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
void testrun_test_serpent(void){
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_skipjack.h"
#include <stdint.h>
}
void testrun_nessie_skipjack(void){
- nessie_bc_ctx.blocksize_B = 8;
- nessie_bc_ctx.keysize_b = 80;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = 10;
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)skipjack_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)skipjack_dec;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)skipjack_genctx_dummy;
-
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
#include "debug.h"
#include "des.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_tdes.h"
#include "bcal_tdes2.h"
/*****************************************************************************
* additional validation-functions *
*****************************************************************************/
-void tdes_init_dummy(const void* key, uint16_t keysize_b, void* ctx){
- memcpy(ctx, key, 8*3);
-}
-
-void tdes_enc_dummy(void* buffer, void* ctx){
- tdes_enc(buffer, buffer, ctx);
-}
-
-void tdes_dec_dummy(void* buffer, void* ctx){
- tdes_dec(buffer, buffer, ctx);
-}
-
void testrun_nessie_tdes(void){
- nessie_bc_init();
- nessie_bc_ctx.blocksize_B = 8;
- nessie_bc_ctx.keysize_b = 192;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = sizeof(8*3);
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)tdes_enc_dummy;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)tdes_dec_dummy;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)tdes_init_dummy;
-
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
#include "debug.h"
#include "threefish.h"
-#include "nessie_bc_test.h"
#include "cli.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_threefish256.h"
#include "bcal_threefish512.h"
#include "bcal_threefish1024.h"
}
}
-void threefish256_dummy_init(const uint8_t* key, uint16_t keysize_b, void* ctx){
- threefish256_init(key, NULL, ctx);
-}
-
-void testrun_nessie_threefish256(void){
- nessie_bc_ctx.keysize_b = 256;
- nessie_bc_ctx.blocksize_B = 32;
- nessie_bc_ctx.ctx_size_B = sizeof(threefish256_ctx_t);
- nessie_bc_ctx.name = "Threefish256";
- nessie_bc_ctx.cipher_genctx = threefish256_dummy_init;
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)threefish256_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)threefish256_dec;
- nessie_bc_ctx.cipher_free = NULL;
-
- nessie_bc_run();
-}
-
-void threefish512_dummy_init(const uint8_t* key, uint16_t keysize_b, void* ctx){
- threefish512_init(key, NULL, ctx);
-}
-
-void testrun_nessie_threefish512(void){
- nessie_bc_ctx.keysize_b = 512;
- nessie_bc_ctx.blocksize_B = 64;
- nessie_bc_ctx.ctx_size_B = sizeof(threefish512_ctx_t);
- nessie_bc_ctx.name = "Threefish512";
- nessie_bc_ctx.cipher_genctx = threefish512_dummy_init;
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)threefish512_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)threefish512_dec;
- nessie_bc_ctx.cipher_free = NULL;
-
- nessie_bc_run();
-}
-
-void threefish1024_dummy_init(const uint8_t* key, uint16_t keysize_b, void* ctx){
- threefish1024_init(key, NULL, ctx);
-}
-
-void testrun_nessie_threefish1024(void){
- nessie_bc_ctx.keysize_b = 1024;
- nessie_bc_ctx.blocksize_B = 128;
- nessie_bc_ctx.ctx_size_B = sizeof(threefish1024_ctx_t);
- nessie_bc_ctx.name = "Threefish1024";
- nessie_bc_ctx.cipher_genctx = threefish1024_dummy_init;
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)threefish1024_enc;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)threefish1024_dec;
- nessie_bc_ctx.cipher_free = NULL;
-
- nessie_bc_run();
-}
-
void testrun_nessie_threefish(void){
- testrun_nessie_threefish256();
- testrun_nessie_threefish512();
- testrun_nessie_threefish1024();
+ bcal_nessie_multiple(algolist);
}
void testrun_stdtest_threefish256(void){
#include "nessie_bc_test.h"
#include "performance_test.h"
#include "bcal-performance.h"
+#include "bcal-nessie.h"
#include "bcal_xtea.h"
#include "cli.h"
/******************************************************************************/
-void xtea_genctx_dummy(uint8_t* key, uint16_t keysize, void* ctx){
- memcpy(ctx, key, (keysize+7)/8);
-}
-
-void xtea_enc_dummy(uint8_t* buffer, void* ctx){
- xtea_enc((uint32_t*)buffer, (uint32_t*)buffer, ctx);
-}
-
-void xtea_dec_dummy(uint8_t* buffer, void* ctx){
- xtea_dec((uint32_t*)buffer, (uint32_t*)buffer, ctx);
-}
-
void testrun_nessie_xtea(void){
- nessie_bc_ctx.blocksize_B = 8;
- nessie_bc_ctx.keysize_b = 128;
- nessie_bc_ctx.name = algo_name;
- nessie_bc_ctx.ctx_size_B = 128/8;
- nessie_bc_ctx.cipher_enc = (nessie_bc_enc_fpt)xtea_enc_dummy;
- nessie_bc_ctx.cipher_dec = (nessie_bc_dec_fpt)xtea_dec_dummy;
- nessie_bc_ctx.cipher_genctx = (nessie_bc_gen_fpt)xtea_genctx_dummy;
-
- nessie_bc_run();
+ bcal_nessie_multiple(algolist);
}
void testrun_performance_xtea(void){