#include "memxor.h"
#include <avr/pgmspace.h>
+#ifndef NESSIE_ESTREAM
+#define NESSIE_ESTREAM 0
+#endif
+
+
static const uint8_t normal_hooks[] PROGMEM = {
0, 192/64, 256/64, 448/64
};
static const char stream1_n[] PROGMEM = "stream[192..255]";
static const char stream2_n[] PROGMEM = "stream[256..319]";
static const char stream3_n[] PROGMEM = "stream[448..511]";
+
+#if NESSIE_ESTREAM
+static const char streamX_n[] PROGMEM = "xor-digest";
+#else
static const char streamX_n[] PROGMEM = "stream[0..511]xored";
+#endif
static const char* stream_n_str[] PROGMEM = {
stream0_n,
static const char stream1_l[] PROGMEM = "stream[65472..65535]";
static const char stream2_l[] PROGMEM = "stream[65536..65599]";
static const char stream3_l[] PROGMEM = "stream[131008..131071]";
+#if NESSIE_ESTREAM
+static const char streamX_l[] PROGMEM = "xor-digest";
+#else
static const char streamX_l[] PROGMEM = "stream[0..131071]xored";
+#endif
static const char* stream_l_str[] PROGMEM = {
stream0_n,
hook_str_ptr = (uint8_t*)hook_str_ptr + 2;
nessie_print_item(str, block, 64);
}
+ if(i%64==0){
+ NESSIE_SEND_ALIVE;
+ }
}
strcpy_P(str, (PGM_VOID_P)pgm_read_word(hook_str_ptr));
nessie_print_item(str, xor_block, 64);
memset(key, 0, (keysize_b+7)/8);
/*** Test SET 1 ***/
nessie_print_setheader(1);
+#if NESSIE_ESTREAM
+ for(v=0;v<keysize_b; v+=9){
+#else
for(v=0;v<keysize_b; ++v){
+#endif
nessie_print_set_vector(1,v);
key[v/8] |= 0x80>>(v&7);
nessie_print_item("key", key, (keysize_b+7)/8);
}
/*** Test SET 2 ***/
nessie_print_setheader(2);
+#if NESSIE_ESTREAM
+ for(v=0;v<256; v+=9){
+#else
for(v=0;v<256; ++v){
+#endif
nessie_print_set_vector(2,v);
memset(key, v&0xff, (keysize_b+7)/8);
nessie_print_item("key", key, (keysize_b+7)/8);
}
/*** Test SET 3 ***/
nessie_print_setheader(3);
+#if NESSIE_ESTREAM
+ for(v=0;v<256; v+=9){
+#else
for(v=0;v<256; ++v){
+#endif
uint8_t i;
nessie_print_set_vector(3,v);
for(i=0; i<((keysize_b+7)/8); ++i){
/*** Test SET 5 ***/
nessie_print_setheader(5);
memset(key, 0, (keysize_b+7)/8);
+#if NESSIE_ESTREAM
+ for(v=0;v<ivsize_b; v+=9){
+#else
for(v=0;v<ivsize_b; ++v){
+#endif
nessie_print_set_vector(5,v);
iv[v/8] |= 0x80>>(v&7);
nessie_print_item("key", key, (keysize_b+7)/8);
scal_cipher_free(&ctx);
}
/*** Test SET 7 ***/
+#if !NESSIE_ESTREAM
nessie_print_setheader(7);
uint8_t u;
for(v=0;v<3; ++v){
long_block(&ctx);
scal_cipher_free(&ctx);
}
+#endif
nessie_print_footer();
}