-void testrun_nessie_trivium(void){
- nessie_stream_ctx.outsize_b = 8; /* actually unused */
- nessie_stream_ctx.keysize_b = 80; /* this is the one we have refrence vectors for */
- nessie_stream_ctx.ivsize_b = 32;
- nessie_stream_ctx.name = cipher_name;
- nessie_stream_ctx.ctx_size_B = sizeof(trivium_ctx_t);
- nessie_stream_ctx.cipher_genctx = (nessie_stream_genctx_fpt)trivium_genctx_dummy;
- nessie_stream_ctx.cipher_enc = (nessie_stream_genenc_fpt)trivium_getbyte_dummy;
-
- nessie_stream_run();
+void testrun_trivium(void){
+ uint8_t key[10];
+ uint8_t iv[4];
+ uint8_t buffer[64];
+ scgen_ctx_t ctx;
+ memset(key, 0, 10);
+ memset(iv, 0, 4);
+ key[0] = 0x80;
+ scal_cipher_init(&trivium_desc, key, 80, iv, 32, &ctx);
+ scal_cipher_gen_fillblock(buffer, 64, &ctx);
+ cli_putstr_P(PSTR("\r\nTest:\r\n Key = "));
+ cli_hexdump(key, 10);
+ cli_putstr_P(PSTR("\r\n IV = "));
+ cli_hexdump(iv, 4);
+ cli_putstr_P(PSTR("\r\n Cipher = "));
+ cli_hexdump_block(buffer, 64, 4, 16);
+ scal_cipher_free(&ctx);
+ key[0] = 0x40;
+ scal_cipher_init(&trivium_desc, key, 80, iv, 32, &ctx);
+ scal_cipher_gen_fillblock(buffer, 64, &ctx);
+ cli_putstr_P(PSTR("\r\nTest:\r\n Key = "));
+ cli_hexdump(key, 10);
+ cli_putstr_P(PSTR("\r\n IV = "));
+ cli_hexdump(iv, 4);
+ cli_putstr_P(PSTR("\r\n Cipher = "));
+ cli_hexdump_block(buffer, 64, 4, 16);
+ scal_cipher_free(&ctx);
+ key[0] = 0x20;
+ scal_cipher_init(&trivium_desc, key, 80, iv, 32, &ctx);
+ scal_cipher_gen_fillblock(buffer, 64, &ctx);
+ cli_putstr_P(PSTR("\r\nTest:\r\n Key = "));
+ cli_hexdump(key, 10);
+ cli_putstr_P(PSTR("\r\n IV = "));
+ cli_hexdump(iv, 4);
+ cli_putstr_P(PSTR("\r\n Cipher = "));
+ cli_hexdump_block(buffer, 64, 4, 16);
+ scal_cipher_free(&ctx);
+ key[0] = 0x10;
+ scal_cipher_init(&trivium_desc, key, 80, iv, 32, &ctx);
+ scal_cipher_gen_fillblock(buffer, 64, &ctx);
+ cli_putstr_P(PSTR("\r\nTest:\r\n Key = "));
+ cli_hexdump(key, 10);
+ cli_putstr_P(PSTR("\r\n IV = "));
+ cli_hexdump(iv, 4);
+ cli_putstr_P(PSTR("\r\n Cipher = "));
+ cli_hexdump_block(buffer, 64, 4, 16);
+ scal_cipher_free(&ctx);