xref: /freebsd/crypto/libecc/src/utils/utils_rand.h (revision f0865ec9906d5a18fa2a3b61381f22ce16e606ad)
1*f0865ec9SKyle Evans /*
2*f0865ec9SKyle Evans  *  Copyright (C) 2023 - This file is part of libecc project
3*f0865ec9SKyle Evans  *
4*f0865ec9SKyle Evans  *  Authors:
5*f0865ec9SKyle Evans  *      Ryad BENADJILA <ryadbenadjila@gmail.com>
6*f0865ec9SKyle Evans  *      Arnaud EBALARD <arnaud.ebalard@ssi.gouv.fr>
7*f0865ec9SKyle Evans  *
8*f0865ec9SKyle Evans  *  This software is licensed under a dual BSD and GPL v2 license.
9*f0865ec9SKyle Evans  *  See LICENSE file at the root folder of the project.
10*f0865ec9SKyle Evans  */
11*f0865ec9SKyle Evans #ifndef __UTILS_RAND_H__
12*f0865ec9SKyle Evans #define __UTILS_RAND_H__
13*f0865ec9SKyle Evans 
14*f0865ec9SKyle Evans #include <libecc/words/words.h>
15*f0865ec9SKyle Evans #include "../external_deps/rand.h"
16*f0865ec9SKyle Evans 
17*f0865ec9SKyle Evans /* WARNING: use with care, this is useful when "fast" but somehow unsafe
18*f0865ec9SKyle Evans  * random must be provided.
19*f0865ec9SKyle Evans  */
20*f0865ec9SKyle Evans ATTRIBUTE_WARN_UNUSED_RET int get_unsafe_random(unsigned char *buf, u16 len);
21*f0865ec9SKyle Evans 
22*f0865ec9SKyle Evans #endif /* __UTILS_RAND_H__ */
23