1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 00:49:45 +01:00

Merge pull request #20670 from benpicco/pkg/monocypher-bump

pkg/monocypher: bump to 4.0.2
This commit is contained in:
benpicco 2024-05-14 15:53:21 +00:00 committed by GitHub
commit e4e3aeb71d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 8 deletions

View File

@ -1,7 +1,7 @@
PKG_NAME=monocypher
PKG_URL=https://github.com/LoupVaillant/Monocypher
# v3.1.2
PKG_VERSION=baca5d31259c598540e4d1284bc8d8f793abf83a
# v4.0.2
PKG_VERSION=0d85f98c9d9b0227e42cf795cb527dff372b40a4
PKG_LICENSE=CC-0
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -27,7 +27,7 @@
static uint8_t message[] = "0123456789abcdef";
static uint8_t sign_sk[32];
static uint8_t sign_sk[64];
static uint8_t sign_pk[32];
static uint8_t signature[64];
@ -39,15 +39,17 @@ static void setUp(void)
static void test_monocypher_signverify(void)
{
int res;
uint8_t seed[32];
/* Creating keypair ... */
random_bytes(sign_sk, sizeof(sign_sk));
crypto_sign_public_key(sign_pk, sign_sk);
random_bytes(seed, sizeof(seed));
crypto_eddsa_key_pair(sign_sk, sign_pk, seed);
/* Sign */
crypto_sign(signature, sign_sk, sign_pk, message, sizeof(message));
crypto_eddsa_sign(signature, sign_sk, message, sizeof(message));
/* Verifying... */
res = crypto_check(signature, sign_pk, message, sizeof(message));
res = crypto_eddsa_check(signature, sign_pk, message, sizeof(message));
TEST_ASSERT_EQUAL_INT(0, res);
}
@ -59,7 +61,7 @@ static void test_monocypher_verifynegative(void)
message[0] = 'A';
/* Verifying... */
res = crypto_check(signature, sign_pk, message, sizeof(message));
res = crypto_eddsa_check(signature, sign_pk, message, sizeof(message));
TEST_ASSERT_EQUAL_INT(-1, res);
}