summaryrefslogtreecommitdiff
path: root/crypto_aead/lilliputaeii256v1/ref/test
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@airbus.com>2018-12-04 10:30:50 +0100
committerKévin Le Gouguec <kevin.legouguec@airbus.com>2018-12-04 10:40:58 +0100
commitca5d23276808b6b6c4d069e0ce77d776b5d93306 (patch)
tree3a67c1f7b1cd6282484a27b114eb6dba21bf43c8 /crypto_aead/lilliputaeii256v1/ref/test
parenta5dff3123ce3bcb0d20b72f0797e6f2c9e3eb99d (diff)
downloadlilliput-ae-implem-ca5d23276808b6b6c4d069e0ce77d776b5d93306.tar.xz
[WIP] Réorganisation des traces
Diffstat (limited to 'crypto_aead/lilliputaeii256v1/ref/test')
-rw-r--r--crypto_aead/lilliputaeii256v1/ref/test/traces-ae-256-ii.c129
-rw-r--r--crypto_aead/lilliputaeii256v1/ref/test/traces-tbc-256-ii.c62
2 files changed, 0 insertions, 191 deletions
diff --git a/crypto_aead/lilliputaeii256v1/ref/test/traces-ae-256-ii.c b/crypto_aead/lilliputaeii256v1/ref/test/traces-ae-256-ii.c
deleted file mode 100644
index 343617f..0000000
--- a/crypto_aead/lilliputaeii256v1/ref/test/traces-ae-256-ii.c
+++ /dev/null
@@ -1,129 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-
-#include "lilliput-ae.h"
-
-#include "debug.h"
-#include "test-helpers.h"
-
-
-FILE *DUMP;
-
-
-struct vector
-{
- char *name;
- uint8_t key[KEY_BYTES];
- uint8_t nonce[NONCE_BYTES];
- size_t auth_len;
- uint8_t *auth;
- size_t message_len;
- uint8_t *message;
-};
-
-typedef struct vector vector;
-
-
-const vector VECTORS[] = {
- {
- .name = "order",
- .key = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
- },
- .nonce = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e
- },
- .auth_len = 64,
- .auth = (uint8_t[]) {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f
- },
- .message_len = 64,
- .message = (uint8_t[]) {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f
- }
- },
- {
- .name = "order-padded",
- .key = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
- },
- .nonce = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e
- },
- .auth_len = 66,
- .auth = (uint8_t[]) {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x01
- },
- .message_len = 66,
- .message = (uint8_t[]) {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x01
- }
- }
-};
-
-
-int main()
-{
- for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++)
- {
- debug_open_dump("ae-256-ii", v->name);
- debug_dump_buffer("message", v->message_len, v->message, 0);
- debug_dump_buffer("associated data", v->auth_len, v->auth, 0);
- debug_dump_buffer("key", KEY_BYTES, v->key, 0);
- debug_dump_buffer("nonce", NONCE_BYTES, v->nonce, 0);
-
- uint8_t ciphertext[v->message_len];
- uint8_t tag[TAG_BYTES];
-
- lilliput_ae_encrypt(
- v->message_len, v->message,
- v->auth_len, v->auth,
- v->key, v->nonce,
- ciphertext,
- tag
- );
-
- debug_dump_buffer("ciphertext", v->message_len, ciphertext, 0);
- debug_dump_buffer("tag", TAG_BYTES, tag, 0);
-
- fclose(DUMP);
- }
-}
diff --git a/crypto_aead/lilliputaeii256v1/ref/test/traces-tbc-256-ii.c b/crypto_aead/lilliputaeii256v1/ref/test/traces-tbc-256-ii.c
deleted file mode 100644
index 217d335..0000000
--- a/crypto_aead/lilliputaeii256v1/ref/test/traces-tbc-256-ii.c
+++ /dev/null
@@ -1,62 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-
-#include "cipher.h"
-
-#include "debug.h"
-#include "test-helpers.h"
-
-
-FILE *DUMP;
-
-
-struct vector
-{
- char *name;
- uint8_t key[KEY_BYTES];
- uint8_t tweak[TWEAK_BYTES];
- uint8_t message[BLOCK_BYTES];
-};
-
-typedef struct vector vector;
-
-
-const vector VECTORS[] = {
- {
- .name = "order",
- .key = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
- },
- .tweak = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- },
- .message = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
- }
- }
-};
-
-
-int main()
-{
- for (const vector *v=VECTORS; v<ARRAY_END(VECTORS); v++)
- {
- debug_open_dump("tbc-256-ii", v->name);
- debug_dump_buffer("message", BLOCK_BYTES, v->message, 0);
- debug_dump_buffer("key", KEY_BYTES, v->key, 0);
- debug_dump_buffer("tweak", TWEAK_BYTES, v->tweak, 0);
-
- uint8_t ciphertext[BLOCK_BYTES];
-
- lilliput_tbc_encrypt(v->key, v->tweak, v->message, ciphertext);
-
- debug_dump_buffer("ciphertext", BLOCK_BYTES, ciphertext, 0);
-
- fclose(DUMP);
- }
-}