prng_algorithms.h
Go to the documentation of this file.
1 /**
2  * @file prng_algorithms.h
3  * @brief Collection of PRNG algorithms
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneCRYPTO Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.5.4
29  **/
30 
31 #ifndef _PRNG_ALGORITHMS_H
32 #define _PRNG_ALGORITHMS_H
33 
34 //Dependencies
35 #include "core/crypto.h"
36 
37 //Hash_DRBG PRNG support?
38 #if (HASH_DRBG_SUPPORT == ENABLED)
39  #include "rng/hash_drbg.h"
40 #endif
41 
42 //HMAC_DRBG PRNG support?
43 #if (HMAC_DRBG_SUPPORT == ENABLED)
44  #include "rng/hmac_drbg.h"
45 #endif
46 
47 //CTR_DRBG PRNG support?
48 #if (CTR_DRBG_SUPPORT == ENABLED)
49  #include "rng/ctr_drbg.h"
50 #endif
51 
52 //XDRBG PRNG support?
53 #if (XDRBG_SUPPORT == ENABLED)
54  #include "rng/xdrbg.h"
55 #endif
56 
57 //Yarrow PRNG support?
58 #if (YARROW_SUPPORT == ENABLED)
59  #include "rng/yarrow.h"
60 #endif
61 
62 //C++ guard
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 
68 /**
69  * @brief Generic PRNG algorithm context
70  **/
71 
72 typedef union
73 {
74 #if (HASH_DRBG_SUPPORT == ENABLED)
76 #endif
77 #if (HMAC_DRBG_SUPPORT == ENABLED)
79 #endif
80 #if (CTR_DRBG_SUPPORT == ENABLED)
82 #endif
83 #if (XDRBG_SUPPORT == ENABLED)
85 #endif
86 #if (YARROW_SUPPORT == ENABLED)
88 #endif
89 } PrngContext;
90 
91 
92 //C++ guard
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif
XDRBG PRNG context.
Definition: xdrbg.h:60
XdrbgContext xdrbgContext
YarrowContext yarrowContext
HMAC_DRBG PRNG context.
Definition: hmac_drbg.h:55
CtrDrbgContext ctrDrbgContext
TRNG (True Random Number Generator)
Hash_DRBG pseudorandom number generator.
Generic PRNG algorithm context.
HMAC_DRBG pseudorandom number generator.
General definitions for cryptographic algorithms.
XDRBG pseudorandom number generator.
HashDrbgContext hashDrbgContext
Hash_DRBG PRNG context.
Definition: hash_drbg.h:57
CTR_DRBG pseudorandom number generator.
CTR_DRBG PRNG context.
Definition: ctr_drbg.h:59
Yarrow PRNG context.
Definition: yarrow.h:64
HmacDrbgContext hmacDrbgContext