1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-23 20:15:19 -07:00

Add another test

This commit is contained in:
Frank Denis 2019-01-05 23:11:02 +01:00
parent 909983a9d2
commit 0cdf963799
2 changed files with 20 additions and 4 deletions

View File

@ -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);

View File

@ -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