mbed TLS v2.2.0
Data Structures | Macros | Functions
trng.h File Reference

Detailed Description

True Random Number Generator (TRNG) driver for Silicon Labs devices.

Copyright (C) 2016, Silicon Labs, http://www.silabs.com SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file trng.h.

#include <config-sl-crypto-all-acceleration.h>
#include "em_device.h"
#include "mbedtls_ecode.h"
#include <stddef.h>
Include dependency graph for trng.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mbedtls_trng_context
 TRNG context structure. More...
 

Macros

#define MBEDTLS_ERR_TRNG_CONDITIONING_TEST_FAILED   ((int)MBEDTLS_ERR_TRNG_BASE | 0x00000001)
 Conditioning test failed. More...
 
#define MBEDTLS_ERR_TRNG_NO_DATA   ((int)MBEDTLS_ERR_TRNG_BASE | 0x00000002)
 No data received in the TRNG FIFO. More...
 
#define MBEDTLS_ERR_TRNG_REPETITION_COUNT_TEST_FAILED   ((int)MBEDTLS_ERR_TRNG_BASE | 0x00000003)
 Repetition Count test failed. More...
 
#define MBEDTLS_ERR_TRNG_ADAPTIVE_PROPORTION_TEST_64_FAILED   ((int)MBEDTLS_ERR_TRNG_BASE | 0x00000004)
 Adaptive Proportion test over 64 samples failed. More...
 
#define MBEDTLS_ERR_TRNG_ADAPTIVE_PROPORTION_TEST_4096_FAILED   ((int)MBEDTLS_ERR_TRNG_BASE | 0x00000005)
 Adaptive Proportion test over 4096 samples failed. More...
 
#define MBEDTLS_ERR_TRNG_NOISE_ALARM   ((int)MBEDTLS_ERR_TRNG_BASE | 0x00000006)
 AIS31 test noise alarm. More...
 
#define MBEDTLS_ERR_TRNG_PRELIMINARY_NOISE_ALARM   ((int)MBEDTLS_ERR_TRNG_BASE | 0x00000007)
 AIS31 test Preliminary Noise alarm. More...
 

Functions

void mbedtls_trng_init (mbedtls_trng_context *ctx)
 Initialize TRNG context. More...
 
void mbedtls_trng_free (mbedtls_trng_context *ctx)
 Free TRNG context. More...
 
int mbedtls_trng_set_key (mbedtls_trng_context *ctx, const unsigned char *key)
 Check the TRNG conditioning function. More...
 
int mbedtls_trng_check_conditioning (mbedtls_trng_context *ctx)
 Check the TRNG conditioning function. More...
 
int mbedtls_trng_check_entropy (mbedtls_trng_context *ctx)
 Check the TRNG entropy source is producing random data. More...
 
int mbedtls_trng_poll (mbedtls_trng_context *ctx, unsigned char *output, size_t len, size_t *olen)
 Poll for entropy data. More...
 
void mbedtls_trng_soft_reset (mbedtls_trng_context *ctx)
 Execute TRNG soft reset. More...