TrustCore SDK Crypto Interface API reference  version 2.0
crypto_interface_nist_ctr_drbg.h
Go to the documentation of this file.
1 /*
2  * crypto_interface_nist_ctr_drbg.h
3  *
4  * Cryptographic Interface header file for declaring NIST CTR DRBG functions
5  * for the Crypto Interface.
6  *
7  * Copyright 2019-2024 DigiCert, Inc. All Rights Reserved.
8  * Proprietary and Confidential Material.
9  *
10  */
11 
19 #ifndef __CRYPTO_INTERFACE_NIST_CTR_DRBG_HEADER__
20 #define __CRYPTO_INTERFACE_NIST_CTR_DRBG_HEADER__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
43  MOC_SYM(hwAccelDescr hwAccelCtx)
44  randomContext **ppNewContext,
45  const ubyte *pEntropyInput,
46  ubyte4 keyLenBytes,
47  ubyte4 outLenBytes,
48  const ubyte *pPersonalization,
49  ubyte4 personalizationLen
50  );
51 
72  MOC_SYM(hwAccelDescr hwAccelCtx)
73  randomContext **ppNewContext,
74  ubyte4 keyLenBytes,
75  ubyte4 outLenBytes,
76  const ubyte *pEntropyInput,
77  ubyte4 entropyInputLen,
78  const ubyte *pNonce,
79  ubyte4 nonceLen,
80  const ubyte *pPersonalization,
81  ubyte4 personalizationLen
82  );
83 
93  MOC_SYM(hwAccelDescr hwAccelCtx)
94  randomContext **ppContext
95  );
96 
109 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_reseed(
110  MOC_SYM(hwAccelDescr hwAccelCtx)
111  randomContext *pContext,
112  const ubyte *pEntropyInput,
113  ubyte4 entropyInputLen,
114  const ubyte *pAdditionalInput,
115  ubyte4 additionalInputLen
116  );
117 
133 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_generate(
134  MOC_SYM(hwAccelDescr hwAccelCtx)
135  randomContext *pContext,
136  const ubyte *pAdditionalInput,
137  ubyte4 additionalInputLen,
138  ubyte *pOutput,
139  ubyte4 outputLenBits
140  );
141 
161  MOC_SYM(hwAccelDescr hwAccelCtx)
162  randomContext *pContext,
163  ubyte *pOutput,
164  sbyte4 outputLenBytes
165  );
166 
180  MOC_SYM(hwAccelDescr hwAccelCtx)
181  randomContext* pContext,
182  ubyte *pAdditionalInput,
183  ubyte4 additionalInputLen,
184  ubyte *pSecret,
185  ubyte4 secretLen
186  );
187 
202  MOC_SYM(hwAccelDescr hwAccelCtx)
203  randomContext* pContext,
204  ubyte *pAdditionalInput,
205  ubyte4 additionalInputLen,
206  ubyte *pSecret,
207  ubyte4 secretLen
208  );
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif /* __CRYPTO_INTERFACE_NIST_CTR_DRBG_HEADER__ */
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_setStateFromSecret(MOC_SYM(hwAccelDescr hwAccelCtx) randomContext *pContext, ubyte *pAdditionalInput, ubyte4 additionalInputLen, ubyte *pSecret, ubyte4 secretLen)
Sets the state of a context to the state within the secret passed in.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_newContext(MOC_SYM(hwAccelDescr hwAccelCtx) randomContext **ppNewContext, const ubyte *pEntropyInput, ubyte4 keyLenBytes, ubyte4 outLenBytes, const ubyte *pPersonalization, ubyte4 personalizationLen)
Creates and seeds a new random context of NIST Counter DRBG type with no derivation function...
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_generate(MOC_SYM(hwAccelDescr hwAccelCtx) randomContext *pContext, const ubyte *pAdditionalInput, ubyte4 additionalInputLen, ubyte *pOutput, ubyte4 outputLenBits)
Generates determinstic random bits from a previously initialized context.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_deleteContext(MOC_SYM(hwAccelDescr hwAccelCtx) randomContext **ppContext)
Deletes a NIST Counter DRBG type context.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_numberGenerator(MOC_SYM(hwAccelDescr hwAccelCtx) randomContext *pContext, ubyte *pOutput, sbyte4 outputLenBytes)
Generates determinstic random bytes from a previously initialized context.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_generateSecret(MOC_SYM(hwAccelDescr hwAccelCtx) randomContext *pContext, ubyte *pAdditionalInput, ubyte4 additionalInputLen, ubyte *pSecret, ubyte4 secretLen)
Generates a "secret" which consist of the internal state, ie the V and key, followed by the determini...
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_newDFContext(MOC_SYM(hwAccelDescr hwAccelCtx) randomContext **ppNewContext, ubyte4 keyLenBytes, ubyte4 outLenBytes, const ubyte *pEntropyInput, ubyte4 entropyInputLen, const ubyte *pNonce, ubyte4 nonceLen, const ubyte *pPersonalization, ubyte4 personalizationLen)
Creates and seeds a new random context of NIST Counter DRBG type with the derivation function...
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_NIST_CTRDRBG_reseed(MOC_SYM(hwAccelDescr hwAccelCtx) randomContext *pContext, const ubyte *pEntropyInput, ubyte4 entropyInputLen, const ubyte *pAdditionalInput, ubyte4 additionalInputLen)
Reseeds a NICE counter DRBG type context.