00001 00006 /* 00007 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved 00008 * SPDX-License-Identifier: Apache-2.0 00009 * 00010 * Licensed under the Apache License, Version 2.0 (the "License"); you may 00011 * not use this file except in compliance with the License. 00012 * You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, software 00017 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 00018 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00019 * See the License for the specific language governing permissions and 00020 * limitations under the License. 00021 * 00022 * This file is part of mbed TLS (https://tls.mbed.org) 00023 */ 00024 #ifndef MBEDTLS_HAVEGE_H 00025 #define MBEDTLS_HAVEGE_H 00026 00027 #include <stddef.h> 00028 00029 #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00038 typedef struct 00039 { 00040 int PT1, PT2, offset[2]; 00041 int pool[MBEDTLS_HAVEGE_COLLECT_SIZE]; 00042 int WALK[8192]; 00043 } 00044 mbedtls_havege_state; 00045 00051 void mbedtls_havege_init( mbedtls_havege_state *hs ); 00052 00058 void mbedtls_havege_free( mbedtls_havege_state *hs ); 00059 00069 int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); 00070 00071 #ifdef __cplusplus 00072 } 00073 #endif 00074 00075 #endif /* havege.h */