Example program to test AES-GCM functionality. Used for a workshop

Dependencies:   mbed

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-2011, Brainspark B.V.
00007  *
00008  *  This file is part of PolarSSL (http://www.polarssl.org)
00009  *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
00010  *
00011  *  All rights reserved.
00012  *
00013  *  This program is free software; you can redistribute it and/or modify
00014  *  it under the terms of the GNU General Public License as published by
00015  *  the Free Software Foundation; either version 2 of the License, or
00016  *  (at your option) any later version.
00017  *
00018  *  This program is distributed in the hope that it will be useful,
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *  GNU General Public License for more details.
00022  *
00023  *  You should have received a copy of the GNU General Public License along
00024  *  with this program; if not, write to the Free Software Foundation, Inc.,
00025  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00026  */
00027 #ifndef POLARSSL_ENTROPY_POLL_H
00028 #define POLARSSL_ENTROPY_POLL_H
00029 
00030 #include <string.h>
00031 
00032 #if !defined(POLARSSL_CONFIG_FILE)
00033 #include "config.h"
00034 #else
00035 #include POLARSSL_CONFIG_FILE
00036 #endif
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041 
00042 /*
00043  * Default thresholds for built-in sources
00044  */
00045 #define ENTROPY_MIN_PLATFORM    128     /**< Minimum for platform source    */
00046 #define ENTROPY_MIN_HAVEGE      128     /**< Minimum for HAVEGE             */
00047 #define ENTROPY_MIN_HARDCLOCK    32     /**< Minimum for hardclock()        */
00048 
00049 #if !defined(POLARSSL_NO_PLATFORM_ENTROPY)
00050 /**
00051  * \brief           Platform-specific entropy poll callback
00052  */
00053 int platform_entropy_poll( void *data,
00054                            unsigned char *output, size_t len, size_t *olen );
00055 #endif
00056 
00057 #if defined(POLARSSL_HAVEGE_C)
00058 /**
00059  * \brief           HAVEGE based entropy poll callback
00060  *
00061  * Requires an HAVEGE state as its data pointer.
00062  */
00063 int havege_poll( void *data,
00064                  unsigned char *output, size_t len, size_t *olen );
00065 #endif
00066 
00067 #if defined(POLARSSL_TIMING_C)
00068 /**
00069  * \brief           hardclock-based entropy poll callback
00070  */
00071 int hardclock_poll( void *data,
00072                     unsigned char *output, size_t len, size_t *olen );
00073 #endif
00074 
00075 #ifdef __cplusplus
00076 }
00077 #endif
00078 
00079 #endif /* entropy_poll.h */
00080 
00081