4 * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion
6 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
7 * SPDX-License-Identifier: Apache-2.0
9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
10 * not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * This file is part of mbed TLS (https://tls.mbed.org)
23 #ifndef MBEDTLS_HAVEGE_H
24 #define MBEDTLS_HAVEGE_H
28 #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024
35 * \brief HAVEGE state structure
39 int PT1, PT2, offset[2];
40 int pool[MBEDTLS_HAVEGE_COLLECT_SIZE];
46 * \brief HAVEGE initialization
48 * \param hs HAVEGE state to be initialized
50 void mbedtls_havege_init( mbedtls_havege_state *hs );
53 * \brief Clear HAVEGE state
55 * \param hs HAVEGE state to be cleared
57 void mbedtls_havege_free( mbedtls_havege_state *hs );
60 * \brief HAVEGE rand function
62 * \param p_rng A HAVEGE state
63 * \param output Buffer to fill
64 * \param len Length of buffer
68 int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len );