joey shelton / LED_Demo

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers entropy_poll.h Source File

entropy_poll.h

Go to the documentation of this file.
00001 /**
00002  * \file entropy_poll.h
00003  *
00004  * \brief Platform-specific and custom entropy polling functions
00005  *
00006  *  Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
00007  *  SPDX-License-Identifier: Apache-2.0
00008  *
00009  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
00010  *  not use this file except in compliance with the License.
00011  *  You may obtain a copy of the License at
00012  *
00013  *  http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  *  Unless required by applicable law or agreed to in writing, software
00016  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00017  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  *  See the License for the specific language governing permissions and
00019  *  limitations under the License.
00020  *
00021  *  This file is part of mbed TLS (https://tls.mbed.org)
00022  */
00023 #ifndef MBEDTLS_ENTROPY_POLL_H
00024 #define MBEDTLS_ENTROPY_POLL_H
00025 
00026 #if !defined(MBEDTLS_CONFIG_FILE)
00027 #include "config.h"
00028 #else
00029 #include MBEDTLS_CONFIG_FILE
00030 #endif
00031 
00032 #include <stddef.h>
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 /*
00039  * Default thresholds for built-in sources, in bytes
00040  */
00041 #define MBEDTLS_ENTROPY_MIN_PLATFORM     32     /**< Minimum for platform source    */
00042 #define MBEDTLS_ENTROPY_MIN_HAVEGE       32     /**< Minimum for HAVEGE             */
00043 #define MBEDTLS_ENTROPY_MIN_HARDCLOCK     4     /**< Minimum for mbedtls_timing_hardclock()        */
00044 #define MBEDTLS_ENTROPY_MIN_HARDWARE     32     /**< Minimum for the hardware source */
00045 
00046 /**
00047  * \brief           Entropy poll callback that provides 0 entropy.
00048  */
00049 #if defined(MBEDTLS_TEST_NULL_ENTROPY)
00050     int mbedtls_null_entropy_poll( void *data,
00051                                 unsigned char *output, size_t len, size_t *olen );
00052 #endif
00053 
00054 #if !defined(MBEDTLS_NO_PLATFORM_ENTROPY)
00055 /**
00056  * \brief           Platform-specific entropy poll callback
00057  */
00058 int mbedtls_platform_entropy_poll( void *data,
00059                            unsigned char *output, size_t len, size_t *olen );
00060 #endif
00061 
00062 #if defined(MBEDTLS_HAVEGE_C)
00063 /**
00064  * \brief           HAVEGE based entropy poll callback
00065  *
00066  * Requires an HAVEGE state as its data pointer.
00067  */
00068 int mbedtls_havege_poll( void *data,
00069                  unsigned char *output, size_t len, size_t *olen );
00070 #endif
00071 
00072 #if defined(MBEDTLS_TIMING_C)
00073 /**
00074  * \brief           mbedtls_timing_hardclock-based entropy poll callback
00075  */
00076 int mbedtls_hardclock_poll( void *data,
00077                     unsigned char *output, size_t len, size_t *olen );
00078 #endif
00079 
00080 #if defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
00081 /**
00082  * \brief           Entropy poll callback for a hardware source
00083  *
00084  * \warning         This is not provided by mbed TLS!
00085  *                  See \c MBEDTLS_ENTROPY_HARDWARE_ALT in config.h.
00086  *
00087  * \note            This must accept NULL as its first argument.
00088  */
00089 int mbedtls_hardware_poll( void *data,
00090                            unsigned char *output, size_t len, size_t *olen );
00091 #endif
00092 
00093 #if defined(MBEDTLS_ENTROPY_NV_SEED)
00094 /**
00095  * \brief           Entropy poll callback for a non-volatile seed file
00096  *
00097  * \note            This must accept NULL as its first argument.
00098  */
00099 int mbedtls_nv_seed_poll( void *data,
00100                           unsigned char *output, size_t len, size_t *olen );
00101 #endif
00102 
00103 #ifdef __cplusplus
00104 }
00105 #endif
00106 
00107 #endif /* entropy_poll.h */