-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17161 from kaspar030/update_pkg_relic
pkg/relic: bump to current master
- Loading branch information
Showing
7 changed files
with
65 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
From 7a93775269a7bfc8f01aef9bf4af9760b11504b2 Mon Sep 17 00:00:00 2001 | ||
From 14b985c86fd0f97b186adc445c224794c3c1b97b Mon Sep 17 00:00:00 2001 | ||
From: maksim-ka <42pema1bif@hft-stuttgart.de> | ||
Date: Fri, 31 Jan 2020 15:15:46 +0100 | ||
Subject: [PATCH 1/2] use modul random for seeding | ||
|
||
--- | ||
src/rand/relic_rand_core.c | 4 ++++ | ||
1 file changed, 4 insertions(+) | ||
src/rand/relic_rand_core.c | 5 +++++ | ||
1 file changed, 5 insertions(+) | ||
|
||
diff --git a/src/rand/relic_rand_core.c b/src/rand/relic_rand_core.c | ||
index 5f453802..3e62c7fd 100644 | ||
index 10f8929f..804b4455 100644 | ||
--- a/src/rand/relic_rand_core.c | ||
+++ b/src/rand/relic_rand_core.c | ||
@@ -159,6 +159,10 @@ void rand_init(void) { | ||
@@ -171,6 +171,11 @@ void rand_init(void) { | ||
} | ||
} | ||
|
||
+#elif SEED == RIOTRND && defined(MODULE_RANDOM) | ||
+ | ||
+ random_bytes(buf,SEED_SIZE); | ||
+ void random_bytes(uint8_t *buf, size_t size); | ||
+ random_bytes(buf, RLC_RAND_SEED); | ||
+ | ||
#endif | ||
|
||
#endif /* RAND == UDEV */ | ||
-- | ||
2.24.1 | ||
2.33.1 | ||
|
38 changes: 38 additions & 0 deletions
38
pkg/relic/patches/0002-add-RIOT-random-support-to-cmake-and-relic_conf.h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From ce1cd836aafefa92c3138f3e923147a42e95c886 Mon Sep 17 00:00:00 2001 | ||
From: Kaspar Schleiser <kaspar@schleiser.de> | ||
Date: Mon, 8 Nov 2021 22:37:38 +0100 | ||
Subject: [PATCH 2/2] add RIOT random support to cmake and relic_conf.h | ||
|
||
--- | ||
cmake/rand.cmake | 1 + | ||
include/relic_conf.h.in | 2 ++ | ||
2 files changed, 3 insertions(+) | ||
|
||
diff --git a/cmake/rand.cmake b/cmake/rand.cmake | ||
index ed90c769..9f79fd6d 100644 | ||
--- a/cmake/rand.cmake | ||
+++ b/cmake/rand.cmake | ||
@@ -12,6 +12,7 @@ message(" SEED=LIBC Use rand()/random() functions. (insecure!)") | ||
message(" SEED=RDRND Use Intel RdRand instruction directly.") | ||
message(" SEED=UDEV Use non-blocking /dev/urandom. (recommended)") | ||
message(" SEED=WCGR Use Windows' CryptGenRandom. (recommended)\n") | ||
+message(" SEED=RIOTRND Use RIOT's random module for seeding. (recommended on RIOT)") | ||
|
||
# Choose the pseudo-random number generator. | ||
set(RAND "HASHD" CACHE STRING "Pseudo-random number generator") | ||
diff --git a/include/relic_conf.h.in b/include/relic_conf.h.in | ||
index 1245edc0..4e807621 100644 | ||
--- a/include/relic_conf.h.in | ||
+++ b/include/relic_conf.h.in | ||
@@ -656,6 +656,8 @@ | ||
#define UDEV 3 | ||
/** Use Windows' CryptGenRandom. */ | ||
#define WCGR 4 | ||
+/** Use RIOT's random module for seeding */ | ||
+#define RIOTRND 5 | ||
/** Chosen random generator seeder. */ | ||
#cmakedefine SEED @SEED@ | ||
|
||
-- | ||
2.33.1 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters