]> git.codecow.com Git - Monocypher.git/commitdiff
Add EdDSA pk gen to TIS-CI
authorLoup Vaillant <loup@loup-vaillant.fr>
Tue, 11 Apr 2023 08:33:42 +0000 (10:33 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Tue, 11 Apr 2023 08:33:42 +0000 (10:33 +0200)
tests/tis-ci-gen-config.sh
tests/tis-ci-vectors.h
tests/tis-ci.c
tis.config

index 8ad1a59103d94950445f9dac81ac1bf2e8bdb894..3b7c318d559033045ab70b6c9dd584b4c3e7b564 100755 (executable)
@@ -70,6 +70,7 @@ for entry_point in      \
     "v_sha512_hkdf"     \
     "v_argon2"          \
     "v_edDSA"           \
+    "v_edDSA_pk"        \
     "v_ed_25519"        \
     "v_ed_25519_check"  \
     "v_elligator_dir"   \
index 5e310f5def07d8feaaf2ebd6032acfbaf4ad5e45..b3505d7d1146764d22e6a3108935d02e38bfbdce 100644 (file)
@@ -387,6 +387,11 @@ static const char *edDSA_vectors[]={
   "0bfa8d629fe89bd9591f20575144f0445958fd3574179ec4a9b6ee85787c23d69b4f009d3ed3bd2bb62226638602b95bc4719a1d2c60afb07ed95c959628ff0c",
 };
 static size_t nb_edDSA_vectors=4;
+static const char *edDSA_pk_vectors[]={
+  "e4e4c4054fe35a75d9c0f679ad8770d8227e68e4c1e68ce67ee88e6be251a207",
+  "61435d557c6bedda3b9d652b98982c227ffedb203fc2357cabe8075508f4e6f0",
+};
+static size_t nb_edDSA_pk_vectors=2;
 static const char *ed_25519_vectors[]={
   "50831c8cb43cd6822bf3f6fae0801cb6c843d8066b07346635365fb7d6ee54e5",
   "38bfc0b57ba86490aa2f41a3209e360ea4df055f22c07c7f54326d36780f42f6",
index d1544a7923b6886f5ac2db12afc0137dddca06fa..dda2c78db91480d741da756e87a970d945a52f00 100644 (file)
@@ -217,6 +217,23 @@ static void edDSA(vector_reader *reader)
        crypto_eddsa_sign(out.buf, fat_secret_key, msg.buf, msg.size);
 }
 
+static void edDSA_pk(vector_reader *reader)
+{
+       vector in  = next_input(reader);
+       vector out = next_output(reader);
+       u8 seed      [32];
+       u8 secret_key[64];
+       u8 public_key[32];
+       memcpy(seed, in.buf, 32);
+       crypto_eddsa_key_pair(secret_key, public_key, seed);
+       memcpy(out.buf, public_key, 32);
+
+       u8 zeroes[32] = {0};
+       ASSERT_EQUAL(seed           , zeroes    , 32);
+       ASSERT_EQUAL(secret_key     , in.buf    , 32);
+       ASSERT_EQUAL(secret_key + 32, public_key, 32);
+}
+
 static void ed_25519(vector_reader *reader)
 {
        vector secret_k = next_input(reader);
@@ -402,6 +419,8 @@ TEST(x25519)
 //@ ensures \result == 0;
 TEST(edDSA)
 //@ ensures \result == 0;
+TEST(edDSA_pk)
+//@ ensures \result == 0;
 TEST(ed_25519)
 //@ ensures \result == 0;
 TEST(ed_25519_check)
@@ -425,6 +444,7 @@ int main(void) {
        ASSERT(v_argon2        () == 0);
        ASSERT(v_x25519        () == 0);
        ASSERT(v_edDSA         () == 0);
+       ASSERT(v_edDSA_pk      () == 0);
        ASSERT(v_ed_25519      () == 0);
        ASSERT(v_ed_25519_check() == 0);
        ASSERT(v_elligator_dir () == 0);
index 18c3b92c0132a554eb6b2131e0380bd8d57a1a7d..41ed57b153026e373a884c7743a4b5f892334f0c 100644 (file)
 , "no-results"    : true
 , "main"          : "v_edDSA"
 },
+{ "name"          : "v_edDSA_pk - sparc_32"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "sparc_32"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - x86_32"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "x86_32"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - x86_16"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "x86_16"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - x86_win64"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "x86_win64"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - armeb_eabi"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "armeb_eabi"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - arm_eabi"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "arm_eabi"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - aarch64"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "aarch64"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - rv64ifdq"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "rv64ifdq"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - mips_64"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "mips_64"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
+{ "name"          : "v_edDSA_pk - ppc_64"
+, "files"         :
+  [ "src/monocypher.c"
+  , "src/optional/monocypher-ed25519.c"
+  , "tests/utils.c"
+  , "tests/tis-ci.c"
+  ]
+, "cpp-extra-args": "-Isrc -Isrc/optional -Itests"
+, "machdep"       : "ppc_64"
+, "no-results"    : true
+, "main"          : "v_edDSA_pk"
+},
 { "name"          : "v_ed_25519 - sparc_32"
 , "files"         :
   [ "src/monocypher.c"