Skip to content

Commit

Permalink
Initial TrustInSoft CI configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-millot committed Oct 2, 2020
1 parent 4cb3f7c commit c96e6d2
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ test_hash(void)
uint8_t dk[hydro_random_SEEDBYTES];
uint8_t h[100];
uint8_t key[hydro_hash_KEYBYTES];
#ifdef __TRUSTINSOFT_ANALYZER__
uint8_t msg[32];
#else
uint8_t msg[1000];
#endif
char hex[100 * 2 + 1];
size_t i;

Expand All @@ -96,25 +100,33 @@ test_hash(void)
}
hydro_hash_final(&st, h, sizeof h);
hydro_bin2hex(hex, sizeof hex, h, sizeof h);
#ifndef __TRUSTINSOFT_ANALYZER__
assert_streq(
"e5d2beb77a039965850ee76327e06b2fa6cb5121db8038b11bce4641a9c4bd843658104bdf07342570bb5fd1d7"
"2c0d31a8981b47c718fddaffbd4171605c873cbaf921bb57988dd814f3a3fbef9799ff7c762705c4bf37ab2981"
"5981bf0d8833d60afe14",
hex);
#endif
hydro_hash_hash(h, sizeof h, msg, sizeof msg, ctx, key);
hydro_bin2hex(hex, sizeof hex, h, sizeof h);
#ifndef __TRUSTINSOFT_ANALYZER__
assert_streq(
"724bd8883df73320ffd70923cb997f9a99bc670c4d78887be4975add0099fbf489b266a85d1f56743062d60a05"
"590cbce47e45108367879bf4641cbaefe584e8618cbeb8c230ae956da22c7c5c4f11a8804ca576ec20fa5da239"
"dde3d03a6018383c21f5",
hex);
#endif
hydro_hash_hash(h, hydro_hash_BYTES, msg, sizeof msg, ctx, key);
hydro_bin2hex(hex, sizeof hex, h, hydro_hash_BYTES);
#ifndef __TRUSTINSOFT_ANALYZER__
assert_streq("7dfa45ce18210e2422fd658bf7beccb6e534e44f99ae359f4af3ba41af8ca463", hex);
#endif
/* total input length is a multiple of the rate */
hydro_hash_hash(h, hydro_hash_BYTES, msg, 13, ctx, key);
hydro_bin2hex(hex, sizeof hex, h, hydro_hash_BYTES);
#ifndef __TRUSTINSOFT_ANALYZER__
assert_streq("d57a9800549bb4bab6a06fa6e16e08aad68d7d4313fb69a81b9f5d5af375dbe7", hex);
#endif
}

static void
Expand Down Expand Up @@ -240,7 +252,11 @@ test_kdf(void)
static void
test_sign(void)
{
#ifdef __TRUSTINSOFT_ANALYZER__
uint8_t msg[32];
#else
uint8_t msg[500];
#endif
uint8_t sig[hydro_sign_BYTES];
hydro_sign_state st;
hydro_sign_keypair kp;
Expand Down
8 changes: 8 additions & 0 deletions tis-ci/common.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"files": [ "../tests/tests.c", "../hydrogen.c" ],
"filesystem": {
"files": [ { "name": "/dev/urandom", "from": "urandom_1" } ]
},
"val-timeout": 10800,
"no-results": "true"
}
4 changes: 4 additions & 0 deletions tis-ci/gcc_ppc_32.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"machdep": "gcc_ppc_32",
"compilation_cmd": "-I../. -U__SSE2__ -Dvolatile= -D__BYTE_ORDER__=__ORDER_BIG_ENDIAN__ -U__SIZEOF_INT128__"
}
4 changes: 4 additions & 0 deletions tis-ci/gcc_ppc_64.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"machdep": "gcc_ppc_64",
"compilation_cmd": "-I../. -U__SSE2__ -Dvolatile= -D__BYTE_ORDER__=__ORDER_BIG_ENDIAN__"
}
4 changes: 4 additions & 0 deletions tis-ci/gcc_x86_32.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"machdep": "gcc_x86_32",
"compilation_cmd": "-I../. -U__SSE2__ -Dvolatile="
}
4 changes: 4 additions & 0 deletions tis-ci/gcc_x86_64.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"machdep": "gcc_x86_64",
"compilation_cmd": "-I../. -U__SSE2__ -Dvolatile="
}
Binary file added tis-ci/urandom_1
Binary file not shown.
123 changes: 123 additions & 0 deletions tis.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
[
{
"name": "hash - gcc_x86_32",
"main": "test_hash",
"include": "tis-ci/gcc_x86_32.config",
"include": "tis-ci/common.config"
},
{
"name": "hash - gcc_x86_64",
"main": "test_hash",
"include": "tis-ci/gcc_x86_64.config",
"include": "tis-ci/common.config"
},
{
"name": "hash - gcc_ppc_32",
"main": "test_hash",
"include": "tis-ci/gcc_ppc_32.config",
"include": "tis-ci/common.config"

},
{
"name": "hash - gcc_ppc_64",
"main": "test_hash",
"include": "tis-ci/gcc_ppc_64.config",
"include": "tis-ci/common.config"
},
{
"name": "kdf - gcc_x86_32",
"main": "test_kdf",
"include": "tis-ci/gcc_x86_32.config",
"include": "tis-ci/common.config"
},
{
"name": "kdf - gcc_x86_64",
"main": "test_kdf",
"include": "tis-ci/gcc_x86_64.config",
"include": "tis-ci/common.config"
},
{
"name": "kdf - gcc_ppc_32",
"main": "test_kdf",
"include": "tis-ci/gcc_ppc_32.config",
"include": "tis-ci/common.config"
},
{
"name": "kdf - gcc_ppc_64",
"main": "test_kdf",
"include": "tis-ci/gcc_ppc_64.config",
"include": "tis-ci/common.config"
},
{
"name": "pwhash - gcc_x86_32",
"main": "test_pwhash",
"include": "tis-ci/gcc_x86_32.config",
"include": "tis-ci/common.config"
},
{
"name": "pwhash - gcc_x86_64",
"main": "test_pwhash",
"include": "tis-ci/gcc_x86_64.config",
"include": "tis-ci/common.config"
},
{
"name": "pwhash - gcc_ppc_32",
"main": "test_pwhash",
"include": "tis-ci/gcc_ppc_32.config",
"include": "tis-ci/common.config"
},
{
"name": "pwhash - gcc_ppc_64",
"main": "test_pwhash",
"include": "tis-ci/gcc_ppc_64.config",
"include": "tis-ci/common.config"
},
{
"name": "secretbox - gcc_x86_32",
"main": "test_secretbox",
"include": "tis-ci/gcc_x86_32.config",
"include": "tis-ci/common.config"
},
{
"name": "secretbox - gcc_x86_64",
"main": "test_secretbox",
"include": "tis-ci/gcc_x86_64.config",
"include": "tis-ci/common.config"
},
{
"name": "secretbox - gcc_ppc_32",
"main": "test_secretbox",
"include": "tis-ci/gcc_ppc_32.config",
"include": "tis-ci/common.config"
},
{
"name": "secretbox - gcc_ppc_64",
"main": "test_secretbox",
"include": "tis-ci/gcc_ppc_64.config",
"include": "tis-ci/common.config"
},
{
"name": "sign - gcc_x86_32",
"main": "test_sign",
"include": "tis-ci/gcc_x86_32.config",
"include": "tis-ci/common.config"
},
{
"name": "sign - gcc_x86_64",
"main": "test_sign",
"include": "tis-ci/gcc_x86_64.config",
"include": "tis-ci/common.config"
},
{
"name": "sign - gcc_ppc_32",
"main": "test_sign",
"include": "tis-ci/gcc_ppc_32.config",
"include": "tis-ci/common.config"
},
{
"name": "sign - gcc_ppc_64",
"main": "test_sign",
"include": "tis-ci/gcc_ppc_64.config",
"include": "tis-ci/common.config"
}
]

0 comments on commit c96e6d2

Please sign in to comment.