From 0cdf963799ef7b95f3c5973d30b9694125deb66d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 5 Jan 2019 23:11:02 +0100 Subject: [PATCH] Add another test --- test/default/core_ed25519.c | 18 ++++++++++++++++-- test/default/core_ed25519.exp | 6 ++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/test/default/core_ed25519.c b/test/default/core_ed25519.c index 782291b3..b6bdfab9 100644 --- a/test/default/core_ed25519.c +++ b/test/default/core_ed25519.c @@ -312,13 +312,27 @@ main(void) crypto_core_ed25519_scalar_add(sc, sc2, sc); sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, sc, crypto_core_ed25519_SCALARBYTES); - printf("add: %s\n", hex); + printf("add1: %s\n", hex); crypto_core_ed25519_scalar_sub(sc, sc2, sc); crypto_core_ed25519_scalar_sub(sc, sc, sc2); sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, sc, crypto_core_ed25519_SCALARBYTES); - printf("sub: %s\n", hex); + printf("sub1: %s\n", hex); + + memset(sc, 0xcd, crypto_core_ed25519_UNIFORMBYTES); + memset(sc2, 0x42, crypto_core_ed25519_UNIFORMBYTES); + crypto_core_ed25519_scalar_add(sc, sc, sc2); + crypto_core_ed25519_scalar_add(sc, sc2, sc); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("add2: %s\n", hex); + + crypto_core_ed25519_scalar_sub(sc, sc2, sc); + crypto_core_ed25519_scalar_sub(sc, sc, sc2); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("sub2: %s\n", hex); sodium_free(hex); sodium_free(sc64); diff --git a/test/default/core_ed25519.exp b/test/default/core_ed25519.exp index 6b8c1686..89fbaa33 100644 --- a/test/default/core_ed25519.exp +++ b/test/default/core_ed25519.exp @@ -10,6 +10,8 @@ comp1: e56b69758fd3193097398c9717b11e48111112131415161718191a1b1c1d1e0f comp2: 09688ce78a8ff8273f636b0bc748c0cceeeeedecebeae9e8e7e6e5e4e3e2e100 comp3: ceb4d73ffe47f83ebe85e18dcae6cc03f0f0f1f2f3f4f5f6f7f8f9fafbfcfd0e comp4: 201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a090807060504030201 -add: f7567cd87c82ec1c355a6304c143bcc9ecedededededededededededededed0d -sub: f67c79849de0253ba142949e1db6224b13121212121212121212121212121202 +add1: f7567cd87c82ec1c355a6304c143bcc9ecedededededededededededededed0d +sub1: f67c79849de0253ba142949e1db6224b13121212121212121212121212121202 +add2: b02e8581ce62f69922427c23f970f7e951525252525252525252525252525202 +sub2: 3da570db4b001cbeb35a7b7fe588e72aaeadadadadadadadadadadadadadad0d OK