Skip to content

Commit

Permalink
Merge pull request RIOT-OS#20670 from benpicco/pkg/monocypher-bump
Browse files Browse the repository at this point in the history
pkg/monocypher: bump to 4.0.2
  • Loading branch information
benpicco authored May 14, 2024
2 parents 28beadd + 8dc317e commit e4e3aeb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/monocypher/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 8 additions & 6 deletions tests/pkg/monocypher/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -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);
}

Expand All @@ -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);
}

Expand Down

0 comments on commit e4e3aeb

Please sign in to comment.