XDRBG pseudorandom number generator. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
error_t | xdrbgInit (XdrbgContext *context, const XofAlgo *xofAlgo) |
Initialize PRNG context. More... | |
error_t | xdrbgSeed (XdrbgContext *context, const uint8_t *seed, size_t length) |
Seed the PRNG state. More... | |
error_t | xdrbgSeedEx (XdrbgContext *context, const uint8_t *seed, size_t seedLen, const uint8_t *alpha, size_t alphaLen) |
Seed the PRNG state (with nonce and personalization string) More... | |
error_t | xdrbgReseed (XdrbgContext *context, const uint8_t *seed, size_t length) |
Reseed the PRNG state. More... | |
error_t | xdrbgReseedEx (XdrbgContext *context, const uint8_t *seed, size_t seedLen, const uint8_t *alpha, size_t alphaLen) |
Reseed the PRNG state (with additional input) More... | |
error_t | xdrbgGenerate (XdrbgContext *context, uint8_t *output, size_t length) |
Generate pseudorandom data. More... | |
error_t | xdrbgGenerateEx (XdrbgContext *context, const uint8_t *alpha, size_t alphaLen, uint8_t *output, size_t outputLen) |
Generate pseudorandom data (with additional input) More... | |
void | xdrbgDeinit (XdrbgContext *context) |
Release PRNG context. More... | |
Variables | |
const PrngAlgo | xdrbgPrngAlgo |
Detailed Description
XDRBG pseudorandom number generator.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneCRYPTO Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.5.4
Definition in file xdrbg.c.
Macro Definition Documentation
◆ TRACE_LEVEL
Function Documentation
◆ xdrbgDeinit()
void xdrbgDeinit | ( | XdrbgContext * | context | ) |
◆ xdrbgGenerate()
error_t xdrbgGenerate | ( | XdrbgContext * | context, |
uint8_t * | output, | ||
size_t | length | ||
) |
◆ xdrbgGenerateEx()
error_t xdrbgGenerateEx | ( | XdrbgContext * | context, |
const uint8_t * | alpha, | ||
size_t | alphaLen, | ||
uint8_t * | output, | ||
size_t | outputLen | ||
) |
Generate pseudorandom data (with additional input)
- Parameters
-
[in] context Pointer to the XDRBG context [in] alpha Optional data [in] alphaLen Length of the additional data, in bytes [out] output Buffer where to store the pseudorandom bytes [in] outputLen Requested number of bytes
- Returns
- Error code
◆ xdrbgInit()
error_t xdrbgInit | ( | XdrbgContext * | context, |
const XofAlgo * | xofAlgo | ||
) |
◆ xdrbgReseed()
error_t xdrbgReseed | ( | XdrbgContext * | context, |
const uint8_t * | seed, | ||
size_t | length | ||
) |
◆ xdrbgReseedEx()
error_t xdrbgReseedEx | ( | XdrbgContext * | context, |
const uint8_t * | seed, | ||
size_t | seedLen, | ||
const uint8_t * | alpha, | ||
size_t | alphaLen | ||
) |
Reseed the PRNG state (with additional input)
- Parameters
-
[in] context Pointer to the XDRBG context [in] seed Seed material [in] seedLen Length of the seed material, in bytes [in] alpha Optional data [in] alphaLen Length of the additional data, in bytes
- Returns
- Error code
◆ xdrbgSeed()
error_t xdrbgSeed | ( | XdrbgContext * | context, |
const uint8_t * | seed, | ||
size_t | length | ||
) |
◆ xdrbgSeedEx()
error_t xdrbgSeedEx | ( | XdrbgContext * | context, |
const uint8_t * | seed, | ||
size_t | seedLen, | ||
const uint8_t * | alpha, | ||
size_t | alphaLen | ||
) |
Seed the PRNG state (with nonce and personalization string)
- Parameters
-
[in] context Pointer to the XDRBG context [in] seed Seed material [in] seedLen Length of the seed material, in bytes [in] alpha Optional data [in] alphaLen Length of the additional data, in bytes
- Returns
- Error code
Variable Documentation
◆ xdrbgPrngAlgo
const PrngAlgo xdrbgPrngAlgo |