Esempio n. 1
0
void testrun_performance_noekeon(void){
	uint64_t t;
	char str[16];
	uint8_t key[16], data[16];
	noekeon_ctx_t ctx;
	
	calibrateTimer();
	print_overhead();
	
	memset(key,  0, 16);
	memset(data, 0, 16);
	
	startTimer(1);
	noekeon_init(key, &ctx);
	t = stopTimer();
	uart_putstr_P(PSTR("\r\n\tctx-gen time: "));
	ultoa((unsigned long)t, str, 10);
	uart_putstr(str);	
	
	startTimer(1);
	noekeon_enc(data, &ctx);
	t = stopTimer();
	uart_putstr_P(PSTR("\r\n\tencrypt time: "));
	ultoa((unsigned long)t, str, 10);
	uart_putstr(str);	
	
	startTimer(1);
	noekeon_dec(data, &ctx);
	t = stopTimer();
	uart_putstr_P(PSTR("\r\n\tdecrypt time: "));
	ultoa((unsigned long)t, str, 10);
	uart_putstr(str);
	
	uart_putstr_P(PSTR("\r\n"));
}
void testrun_stdtest_rundirect(void* data, void* key) {
    cli_putstr_P(PSTR("\r\n                     "));
    cli_putstr_P(PSTR("k = "));
    cli_hexdump(key,16);

    cli_putstr_P(PSTR("\r\n                     "));
    cli_putstr_P(PSTR("a = "));
    cli_hexdump(data,16);

    noekeon_enc(data, key);
    cli_putstr_P(PSTR("\r\nafter NESSIEencrypt, b = "));
    cli_hexdump(data,16);

    noekeon_dec(data, key);
    cli_putstr_P(PSTR("\r\nafter NESSIEdecrypt, a?= "));
    cli_hexdump(data,16);
    cli_putstr_P(PSTR("\r\n"));
}
Esempio n. 3
0
void testrun_stdtest_runindirect(void* data, void* key){
	noekeon_ctx_t ctx;
	uart_putstr_P(PSTR("\r\n                     "));
	uart_putstr_P(PSTR("k = "));
	uart_hexdump(key,16);
	
	uart_putstr_P(PSTR("\r\n                     "));
	uart_putstr_P(PSTR("a = "));
	uart_hexdump(data,16);
	noekeon_init(key, &ctx);
	noekeon_enc(data, &ctx);
	uart_putstr_P(PSTR("\r\nafter NESSIEencrypt, b = "));
	uart_hexdump(data,16);
	
	noekeon_dec(data, &ctx);
	uart_putstr_P(PSTR("\r\nafter NESSIEdecrypt, a?= "));
	uart_hexdump(data,16);
	uart_putstr_P(PSTR("\r\n"));
}