-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mlx5: Use getrandom() to seed a strong PRNG
Add get_random() API to get random data with static seed, which is generated with getrandom() for better randomness. Signed-off-by: Mark Zhang <[email protected]> Signed-off-by: Yishai Hadas <[email protected]>
- Loading branch information
1 parent
3932eff
commit 1927017
Showing
5 changed files
with
49 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _FIXUP_SYS_RANDOM_H | ||
#define _FIXUP_SYS_RANDOM_H | ||
|
||
#include <sys/types.h> | ||
|
||
/* Flags for use with getrandom. */ | ||
#define GRND_NONBLOCK 0x01 | ||
|
||
static inline ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) | ||
{ | ||
return -1; | ||
} | ||
#endif |
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