mbed client lightswitch demo

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of mbed-client-classic-example-lwip by Austin Blackstone

Committer:
mbedAustin
Date:
Thu Jun 09 17:08:36 2016 +0000
Revision:
11:cada08fc8a70
Commit for public Consumption

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbedAustin 11:cada08fc8a70 1 /**
mbedAustin 11:cada08fc8a70 2 * \file havege.h
mbedAustin 11:cada08fc8a70 3 *
mbedAustin 11:cada08fc8a70 4 * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion
mbedAustin 11:cada08fc8a70 5 *
mbedAustin 11:cada08fc8a70 6 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
mbedAustin 11:cada08fc8a70 7 * SPDX-License-Identifier: Apache-2.0
mbedAustin 11:cada08fc8a70 8 *
mbedAustin 11:cada08fc8a70 9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
mbedAustin 11:cada08fc8a70 10 * not use this file except in compliance with the License.
mbedAustin 11:cada08fc8a70 11 * You may obtain a copy of the License at
mbedAustin 11:cada08fc8a70 12 *
mbedAustin 11:cada08fc8a70 13 * http://www.apache.org/licenses/LICENSE-2.0
mbedAustin 11:cada08fc8a70 14 *
mbedAustin 11:cada08fc8a70 15 * Unless required by applicable law or agreed to in writing, software
mbedAustin 11:cada08fc8a70 16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
mbedAustin 11:cada08fc8a70 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbedAustin 11:cada08fc8a70 18 * See the License for the specific language governing permissions and
mbedAustin 11:cada08fc8a70 19 * limitations under the License.
mbedAustin 11:cada08fc8a70 20 *
mbedAustin 11:cada08fc8a70 21 * This file is part of mbed TLS (https://tls.mbed.org)
mbedAustin 11:cada08fc8a70 22 */
mbedAustin 11:cada08fc8a70 23 #ifndef MBEDTLS_HAVEGE_H
mbedAustin 11:cada08fc8a70 24 #define MBEDTLS_HAVEGE_H
mbedAustin 11:cada08fc8a70 25
mbedAustin 11:cada08fc8a70 26 #include <stddef.h>
mbedAustin 11:cada08fc8a70 27
mbedAustin 11:cada08fc8a70 28 #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024
mbedAustin 11:cada08fc8a70 29
mbedAustin 11:cada08fc8a70 30 #ifdef __cplusplus
mbedAustin 11:cada08fc8a70 31 extern "C" {
mbedAustin 11:cada08fc8a70 32 #endif
mbedAustin 11:cada08fc8a70 33
mbedAustin 11:cada08fc8a70 34 /**
mbedAustin 11:cada08fc8a70 35 * \brief HAVEGE state structure
mbedAustin 11:cada08fc8a70 36 */
mbedAustin 11:cada08fc8a70 37 typedef struct
mbedAustin 11:cada08fc8a70 38 {
mbedAustin 11:cada08fc8a70 39 int PT1, PT2, offset[2];
mbedAustin 11:cada08fc8a70 40 int pool[MBEDTLS_HAVEGE_COLLECT_SIZE];
mbedAustin 11:cada08fc8a70 41 int WALK[8192];
mbedAustin 11:cada08fc8a70 42 }
mbedAustin 11:cada08fc8a70 43 mbedtls_havege_state;
mbedAustin 11:cada08fc8a70 44
mbedAustin 11:cada08fc8a70 45 /**
mbedAustin 11:cada08fc8a70 46 * \brief HAVEGE initialization
mbedAustin 11:cada08fc8a70 47 *
mbedAustin 11:cada08fc8a70 48 * \param hs HAVEGE state to be initialized
mbedAustin 11:cada08fc8a70 49 */
mbedAustin 11:cada08fc8a70 50 void mbedtls_havege_init( mbedtls_havege_state *hs );
mbedAustin 11:cada08fc8a70 51
mbedAustin 11:cada08fc8a70 52 /**
mbedAustin 11:cada08fc8a70 53 * \brief Clear HAVEGE state
mbedAustin 11:cada08fc8a70 54 *
mbedAustin 11:cada08fc8a70 55 * \param hs HAVEGE state to be cleared
mbedAustin 11:cada08fc8a70 56 */
mbedAustin 11:cada08fc8a70 57 void mbedtls_havege_free( mbedtls_havege_state *hs );
mbedAustin 11:cada08fc8a70 58
mbedAustin 11:cada08fc8a70 59 /**
mbedAustin 11:cada08fc8a70 60 * \brief HAVEGE rand function
mbedAustin 11:cada08fc8a70 61 *
mbedAustin 11:cada08fc8a70 62 * \param p_rng A HAVEGE state
mbedAustin 11:cada08fc8a70 63 * \param output Buffer to fill
mbedAustin 11:cada08fc8a70 64 * \param len Length of buffer
mbedAustin 11:cada08fc8a70 65 *
mbedAustin 11:cada08fc8a70 66 * \return 0
mbedAustin 11:cada08fc8a70 67 */
mbedAustin 11:cada08fc8a70 68 int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len );
mbedAustin 11:cada08fc8a70 69
mbedAustin 11:cada08fc8a70 70 #ifdef __cplusplus
mbedAustin 11:cada08fc8a70 71 }
mbedAustin 11:cada08fc8a70 72 #endif
mbedAustin 11:cada08fc8a70 73
mbedAustin 11:cada08fc8a70 74 #endif /* havege.h */