mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-08 03:25:44 +00:00
815e9a21a3
Remove cryptography related files and a few utility header files that are shared between Mbed TLS and Mbed Crypto. Mbed TLS will use an Mbed Crypto sourced version of each of these header files in order to ease the maintenance burden of both libraries, and to make it easier to keep Mbed TLS and Mbed Crypto in sync. As part of removing cryptography related files, tell Doxygen to source information from the removed the headers, so that it will consider them for inclusion within Doxygen output. Later, as part of the Mbed TLS 3.0 (API breaking version), we'll restructure the organization of the 3 libraries a bit, to move some things out of Mbed Crypto that don't belong there. Candidates of not belonging in Mbed Crypto, but are in libmbedcrypto.so for legacy reasons: - asn1.h - asn1write.h - base64.h - memory_buffer_alloc.h - platform.h - platform_time.h - platform_util.h - threading.h - timing.h - version.h
83 lines
1.9 KiB
C
83 lines
1.9 KiB
C
/**
|
|
* \file havege.h
|
|
*
|
|
* \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion
|
|
*/
|
|
/*
|
|
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
* not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
* This file is part of mbed TLS (https://tls.mbed.org)
|
|
*/
|
|
#ifndef MBEDTLS_HAVEGE_H
|
|
#define MBEDTLS_HAVEGE_H
|
|
|
|
#if !defined(MBEDTLS_CONFIG_FILE)
|
|
#include "mbedtls/config.h"
|
|
#else
|
|
#include MBEDTLS_CONFIG_FILE
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#define MBEDTLS_HAVEGE_COLLECT_SIZE 1024
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* \brief HAVEGE state structure
|
|
*/
|
|
typedef struct mbedtls_havege_state
|
|
{
|
|
uint32_t PT1, PT2, offset[2];
|
|
uint32_t pool[MBEDTLS_HAVEGE_COLLECT_SIZE];
|
|
uint32_t WALK[8192];
|
|
}
|
|
mbedtls_havege_state;
|
|
|
|
/**
|
|
* \brief HAVEGE initialization
|
|
*
|
|
* \param hs HAVEGE state to be initialized
|
|
*/
|
|
void mbedtls_havege_init( mbedtls_havege_state *hs );
|
|
|
|
/**
|
|
* \brief Clear HAVEGE state
|
|
*
|
|
* \param hs HAVEGE state to be cleared
|
|
*/
|
|
void mbedtls_havege_free( mbedtls_havege_state *hs );
|
|
|
|
/**
|
|
* \brief HAVEGE rand function
|
|
*
|
|
* \param p_rng A HAVEGE state
|
|
* \param output Buffer to fill
|
|
* \param len Length of buffer
|
|
*
|
|
* \return 0
|
|
*/
|
|
int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len );
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* havege.h */
|