00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef MBEDTLS_HAVEGE_H
00025 #define MBEDTLS_HAVEGE_H
00026
00027 #if !defined(MBEDTLS_CONFIG_FILE)
00028 #include "config.h"
00029 #else
00030 #include MBEDTLS_CONFIG_FILE
00031 #endif
00032
00033 #include <stddef.h>
00034
00035 #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024
00036
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040
00044 typedef struct
00045 {
00046 int PT1, PT2, offset[2];
00047 int pool[MBEDTLS_HAVEGE_COLLECT_SIZE];
00048 int WALK[8192];
00049 }
00050 mbedtls_havege_state;
00051
00057 void mbedtls_havege_init( mbedtls_havege_state *hs );
00058
00064 void mbedtls_havege_free( mbedtls_havege_state *hs );
00065
00075 int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len );
00076
00077 #ifdef __cplusplus
00078 }
00079 #endif
00080
00081 #endif