1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-22 11:17:40 +00:00

Initialize PRF with random data when it is enabled.

This commit is contained in:
Andrew Chambers
2020-08-04 12:11:05 +12:00
parent 78c3c6dafa
commit 4d4ca7bb36
6 changed files with 79 additions and 47 deletions

10
jpm
View File

@@ -535,6 +535,16 @@
```
int main(int argc, const char **argv) {
#if defined(JANET_PRF)
uint8_t hash_key[JANET_HASH_KEY_SIZE];
if (janet_cryptorand(hash_key, JANET_HASH_KEY_SIZE) != 0) {
fputs("unable to initialize janet PRF hash function.\n", stderr);
return 1;
}
janet_init_hash_key(hash_key);
#endif
janet_init();
/* Get core env */