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 hmac_drbg.h
mbedAustin 11:cada08fc8a70 3 *
mbedAustin 11:cada08fc8a70 4 * \brief HMAC_DRBG (NIST SP 800-90A)
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_HMAC_DRBG_H
mbedAustin 11:cada08fc8a70 24 #define MBEDTLS_HMAC_DRBG_H
mbedAustin 11:cada08fc8a70 25
mbedAustin 11:cada08fc8a70 26 #include "md.h"
mbedAustin 11:cada08fc8a70 27
mbedAustin 11:cada08fc8a70 28 #if defined(MBEDTLS_THREADING_C)
mbedAustin 11:cada08fc8a70 29 #include "mbedtls/threading.h"
mbedAustin 11:cada08fc8a70 30 #endif
mbedAustin 11:cada08fc8a70 31
mbedAustin 11:cada08fc8a70 32 /*
mbedAustin 11:cada08fc8a70 33 * Error codes
mbedAustin 11:cada08fc8a70 34 */
mbedAustin 11:cada08fc8a70 35 #define MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG -0x0003 /**< Too many random requested in single call. */
mbedAustin 11:cada08fc8a70 36 #define MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG -0x0005 /**< Input too large (Entropy + additional). */
mbedAustin 11:cada08fc8a70 37 #define MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR -0x0007 /**< Read/write error in file. */
mbedAustin 11:cada08fc8a70 38 #define MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED -0x0009 /**< The entropy source failed. */
mbedAustin 11:cada08fc8a70 39
mbedAustin 11:cada08fc8a70 40 /**
mbedAustin 11:cada08fc8a70 41 * \name SECTION: Module settings
mbedAustin 11:cada08fc8a70 42 *
mbedAustin 11:cada08fc8a70 43 * The configuration options you can set for this module are in this section.
mbedAustin 11:cada08fc8a70 44 * Either change them in config.h or define them on the compiler command line.
mbedAustin 11:cada08fc8a70 45 * \{
mbedAustin 11:cada08fc8a70 46 */
mbedAustin 11:cada08fc8a70 47
mbedAustin 11:cada08fc8a70 48 #if !defined(MBEDTLS_HMAC_DRBG_RESEED_INTERVAL)
mbedAustin 11:cada08fc8a70 49 #define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */
mbedAustin 11:cada08fc8a70 50 #endif
mbedAustin 11:cada08fc8a70 51
mbedAustin 11:cada08fc8a70 52 #if !defined(MBEDTLS_HMAC_DRBG_MAX_INPUT)
mbedAustin 11:cada08fc8a70 53 #define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */
mbedAustin 11:cada08fc8a70 54 #endif
mbedAustin 11:cada08fc8a70 55
mbedAustin 11:cada08fc8a70 56 #if !defined(MBEDTLS_HMAC_DRBG_MAX_REQUEST)
mbedAustin 11:cada08fc8a70 57 #define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */
mbedAustin 11:cada08fc8a70 58 #endif
mbedAustin 11:cada08fc8a70 59
mbedAustin 11:cada08fc8a70 60 #if !defined(MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT)
mbedAustin 11:cada08fc8a70 61 #define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
mbedAustin 11:cada08fc8a70 62 #endif
mbedAustin 11:cada08fc8a70 63
mbedAustin 11:cada08fc8a70 64 /* \} name SECTION: Module settings */
mbedAustin 11:cada08fc8a70 65
mbedAustin 11:cada08fc8a70 66 #define MBEDTLS_HMAC_DRBG_PR_OFF 0 /**< No prediction resistance */
mbedAustin 11:cada08fc8a70 67 #define MBEDTLS_HMAC_DRBG_PR_ON 1 /**< Prediction resistance enabled */
mbedAustin 11:cada08fc8a70 68
mbedAustin 11:cada08fc8a70 69 #ifdef __cplusplus
mbedAustin 11:cada08fc8a70 70 extern "C" {
mbedAustin 11:cada08fc8a70 71 #endif
mbedAustin 11:cada08fc8a70 72
mbedAustin 11:cada08fc8a70 73 /**
mbedAustin 11:cada08fc8a70 74 * HMAC_DRBG context.
mbedAustin 11:cada08fc8a70 75 */
mbedAustin 11:cada08fc8a70 76 typedef struct
mbedAustin 11:cada08fc8a70 77 {
mbedAustin 11:cada08fc8a70 78 /* Working state: the key K is not stored explicitely,
mbedAustin 11:cada08fc8a70 79 * but is implied by the HMAC context */
mbedAustin 11:cada08fc8a70 80 mbedtls_md_context_t md_ctx; /*!< HMAC context (inc. K) */
mbedAustin 11:cada08fc8a70 81 unsigned char V[MBEDTLS_MD_MAX_SIZE]; /*!< V in the spec */
mbedAustin 11:cada08fc8a70 82 int reseed_counter; /*!< reseed counter */
mbedAustin 11:cada08fc8a70 83
mbedAustin 11:cada08fc8a70 84 /* Administrative state */
mbedAustin 11:cada08fc8a70 85 size_t entropy_len; /*!< entropy bytes grabbed on each (re)seed */
mbedAustin 11:cada08fc8a70 86 int prediction_resistance; /*!< enable prediction resistance (Automatic
mbedAustin 11:cada08fc8a70 87 reseed before every random generation) */
mbedAustin 11:cada08fc8a70 88 int reseed_interval; /*!< reseed interval */
mbedAustin 11:cada08fc8a70 89
mbedAustin 11:cada08fc8a70 90 /* Callbacks */
mbedAustin 11:cada08fc8a70 91 int (*f_entropy)(void *, unsigned char *, size_t); /*!< entropy function */
mbedAustin 11:cada08fc8a70 92 void *p_entropy; /*!< context for the entropy function */
mbedAustin 11:cada08fc8a70 93
mbedAustin 11:cada08fc8a70 94 #if defined(MBEDTLS_THREADING_C)
mbedAustin 11:cada08fc8a70 95 mbedtls_threading_mutex_t mutex;
mbedAustin 11:cada08fc8a70 96 #endif
mbedAustin 11:cada08fc8a70 97 } mbedtls_hmac_drbg_context;
mbedAustin 11:cada08fc8a70 98
mbedAustin 11:cada08fc8a70 99 /**
mbedAustin 11:cada08fc8a70 100 * \brief HMAC_DRBG context initialization
mbedAustin 11:cada08fc8a70 101 * Makes the context ready for mbedtls_hmac_drbg_seed(),
mbedAustin 11:cada08fc8a70 102 * mbedtls_hmac_drbg_seed_buf() or
mbedAustin 11:cada08fc8a70 103 * mbedtls_hmac_drbg_free().
mbedAustin 11:cada08fc8a70 104 *
mbedAustin 11:cada08fc8a70 105 * \param ctx HMAC_DRBG context to be initialized
mbedAustin 11:cada08fc8a70 106 */
mbedAustin 11:cada08fc8a70 107 void mbedtls_hmac_drbg_init( mbedtls_hmac_drbg_context *ctx );
mbedAustin 11:cada08fc8a70 108
mbedAustin 11:cada08fc8a70 109 /**
mbedAustin 11:cada08fc8a70 110 * \brief HMAC_DRBG initial seeding
mbedAustin 11:cada08fc8a70 111 * Seed and setup entropy source for future reseeds.
mbedAustin 11:cada08fc8a70 112 *
mbedAustin 11:cada08fc8a70 113 * \param ctx HMAC_DRBG context to be seeded
mbedAustin 11:cada08fc8a70 114 * \param md_info MD algorithm to use for HMAC_DRBG
mbedAustin 11:cada08fc8a70 115 * \param f_entropy Entropy callback (p_entropy, buffer to fill, buffer
mbedAustin 11:cada08fc8a70 116 * length)
mbedAustin 11:cada08fc8a70 117 * \param p_entropy Entropy context
mbedAustin 11:cada08fc8a70 118 * \param custom Personalization data (Device specific identifiers)
mbedAustin 11:cada08fc8a70 119 * (Can be NULL)
mbedAustin 11:cada08fc8a70 120 * \param len Length of personalization data
mbedAustin 11:cada08fc8a70 121 *
mbedAustin 11:cada08fc8a70 122 * \note The "security strength" as defined by NIST is set to:
mbedAustin 11:cada08fc8a70 123 * 128 bits if md_alg is SHA-1,
mbedAustin 11:cada08fc8a70 124 * 192 bits if md_alg is SHA-224,
mbedAustin 11:cada08fc8a70 125 * 256 bits if md_alg is SHA-256 or higher.
mbedAustin 11:cada08fc8a70 126 * Note that SHA-256 is just as efficient as SHA-224.
mbedAustin 11:cada08fc8a70 127 *
mbedAustin 11:cada08fc8a70 128 * \return 0 if successful, or
mbedAustin 11:cada08fc8a70 129 * MBEDTLS_ERR_MD_BAD_INPUT_DATA, or
mbedAustin 11:cada08fc8a70 130 * MBEDTLS_ERR_MD_ALLOC_FAILED, or
mbedAustin 11:cada08fc8a70 131 * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED.
mbedAustin 11:cada08fc8a70 132 */
mbedAustin 11:cada08fc8a70 133 int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx,
mbedAustin 11:cada08fc8a70 134 const mbedtls_md_info_t * md_info,
mbedAustin 11:cada08fc8a70 135 int (*f_entropy)(void *, unsigned char *, size_t),
mbedAustin 11:cada08fc8a70 136 void *p_entropy,
mbedAustin 11:cada08fc8a70 137 const unsigned char *custom,
mbedAustin 11:cada08fc8a70 138 size_t len );
mbedAustin 11:cada08fc8a70 139
mbedAustin 11:cada08fc8a70 140 /**
mbedAustin 11:cada08fc8a70 141 * \brief Initilisation of simpified HMAC_DRBG (never reseeds).
mbedAustin 11:cada08fc8a70 142 * (For use with deterministic ECDSA.)
mbedAustin 11:cada08fc8a70 143 *
mbedAustin 11:cada08fc8a70 144 * \param ctx HMAC_DRBG context to be initialised
mbedAustin 11:cada08fc8a70 145 * \param md_info MD algorithm to use for HMAC_DRBG
mbedAustin 11:cada08fc8a70 146 * \param data Concatenation of entropy string and additional data
mbedAustin 11:cada08fc8a70 147 * \param data_len Length of data in bytes
mbedAustin 11:cada08fc8a70 148 *
mbedAustin 11:cada08fc8a70 149 * \return 0 if successful, or
mbedAustin 11:cada08fc8a70 150 * MBEDTLS_ERR_MD_BAD_INPUT_DATA, or
mbedAustin 11:cada08fc8a70 151 * MBEDTLS_ERR_MD_ALLOC_FAILED.
mbedAustin 11:cada08fc8a70 152 */
mbedAustin 11:cada08fc8a70 153 int mbedtls_hmac_drbg_seed_buf( mbedtls_hmac_drbg_context *ctx,
mbedAustin 11:cada08fc8a70 154 const mbedtls_md_info_t * md_info,
mbedAustin 11:cada08fc8a70 155 const unsigned char *data, size_t data_len );
mbedAustin 11:cada08fc8a70 156
mbedAustin 11:cada08fc8a70 157 /**
mbedAustin 11:cada08fc8a70 158 * \brief Enable / disable prediction resistance (Default: Off)
mbedAustin 11:cada08fc8a70 159 *
mbedAustin 11:cada08fc8a70 160 * Note: If enabled, entropy is used for ctx->entropy_len before each call!
mbedAustin 11:cada08fc8a70 161 * Only use this if you have ample supply of good entropy!
mbedAustin 11:cada08fc8a70 162 *
mbedAustin 11:cada08fc8a70 163 * \param ctx HMAC_DRBG context
mbedAustin 11:cada08fc8a70 164 * \param resistance MBEDTLS_HMAC_DRBG_PR_ON or MBEDTLS_HMAC_DRBG_PR_OFF
mbedAustin 11:cada08fc8a70 165 */
mbedAustin 11:cada08fc8a70 166 void mbedtls_hmac_drbg_set_prediction_resistance( mbedtls_hmac_drbg_context *ctx,
mbedAustin 11:cada08fc8a70 167 int resistance );
mbedAustin 11:cada08fc8a70 168
mbedAustin 11:cada08fc8a70 169 /**
mbedAustin 11:cada08fc8a70 170 * \brief Set the amount of entropy grabbed on each reseed
mbedAustin 11:cada08fc8a70 171 * (Default: given by the security strength, which
mbedAustin 11:cada08fc8a70 172 * depends on the hash used, see \c mbedtls_hmac_drbg_init() )
mbedAustin 11:cada08fc8a70 173 *
mbedAustin 11:cada08fc8a70 174 * \param ctx HMAC_DRBG context
mbedAustin 11:cada08fc8a70 175 * \param len Amount of entropy to grab, in bytes
mbedAustin 11:cada08fc8a70 176 */
mbedAustin 11:cada08fc8a70 177 void mbedtls_hmac_drbg_set_entropy_len( mbedtls_hmac_drbg_context *ctx,
mbedAustin 11:cada08fc8a70 178 size_t len );
mbedAustin 11:cada08fc8a70 179
mbedAustin 11:cada08fc8a70 180 /**
mbedAustin 11:cada08fc8a70 181 * \brief Set the reseed interval
mbedAustin 11:cada08fc8a70 182 * (Default: MBEDTLS_HMAC_DRBG_RESEED_INTERVAL)
mbedAustin 11:cada08fc8a70 183 *
mbedAustin 11:cada08fc8a70 184 * \param ctx HMAC_DRBG context
mbedAustin 11:cada08fc8a70 185 * \param interval Reseed interval
mbedAustin 11:cada08fc8a70 186 */
mbedAustin 11:cada08fc8a70 187 void mbedtls_hmac_drbg_set_reseed_interval( mbedtls_hmac_drbg_context *ctx,
mbedAustin 11:cada08fc8a70 188 int interval );
mbedAustin 11:cada08fc8a70 189
mbedAustin 11:cada08fc8a70 190 /**
mbedAustin 11:cada08fc8a70 191 * \brief HMAC_DRBG update state
mbedAustin 11:cada08fc8a70 192 *
mbedAustin 11:cada08fc8a70 193 * \param ctx HMAC_DRBG context
mbedAustin 11:cada08fc8a70 194 * \param additional Additional data to update state with, or NULL
mbedAustin 11:cada08fc8a70 195 * \param add_len Length of additional data, or 0
mbedAustin 11:cada08fc8a70 196 *
mbedAustin 11:cada08fc8a70 197 * \note Additional data is optional, pass NULL and 0 as second
mbedAustin 11:cada08fc8a70 198 * third argument if no additional data is being used.
mbedAustin 11:cada08fc8a70 199 */
mbedAustin 11:cada08fc8a70 200 void mbedtls_hmac_drbg_update( mbedtls_hmac_drbg_context *ctx,
mbedAustin 11:cada08fc8a70 201 const unsigned char *additional, size_t add_len );
mbedAustin 11:cada08fc8a70 202
mbedAustin 11:cada08fc8a70 203 /**
mbedAustin 11:cada08fc8a70 204 * \brief HMAC_DRBG reseeding (extracts data from entropy source)
mbedAustin 11:cada08fc8a70 205 *
mbedAustin 11:cada08fc8a70 206 * \param ctx HMAC_DRBG context
mbedAustin 11:cada08fc8a70 207 * \param additional Additional data to add to state (Can be NULL)
mbedAustin 11:cada08fc8a70 208 * \param len Length of additional data
mbedAustin 11:cada08fc8a70 209 *
mbedAustin 11:cada08fc8a70 210 * \return 0 if successful, or
mbedAustin 11:cada08fc8a70 211 * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED
mbedAustin 11:cada08fc8a70 212 */
mbedAustin 11:cada08fc8a70 213 int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx,
mbedAustin 11:cada08fc8a70 214 const unsigned char *additional, size_t len );
mbedAustin 11:cada08fc8a70 215
mbedAustin 11:cada08fc8a70 216 /**
mbedAustin 11:cada08fc8a70 217 * \brief HMAC_DRBG generate random with additional update input
mbedAustin 11:cada08fc8a70 218 *
mbedAustin 11:cada08fc8a70 219 * Note: Automatically reseeds if reseed_counter is reached or PR is enabled.
mbedAustin 11:cada08fc8a70 220 *
mbedAustin 11:cada08fc8a70 221 * \param p_rng HMAC_DRBG context
mbedAustin 11:cada08fc8a70 222 * \param output Buffer to fill
mbedAustin 11:cada08fc8a70 223 * \param output_len Length of the buffer
mbedAustin 11:cada08fc8a70 224 * \param additional Additional data to update with (can be NULL)
mbedAustin 11:cada08fc8a70 225 * \param add_len Length of additional data (can be 0)
mbedAustin 11:cada08fc8a70 226 *
mbedAustin 11:cada08fc8a70 227 * \return 0 if successful, or
mbedAustin 11:cada08fc8a70 228 * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED, or
mbedAustin 11:cada08fc8a70 229 * MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG, or
mbedAustin 11:cada08fc8a70 230 * MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG.
mbedAustin 11:cada08fc8a70 231 */
mbedAustin 11:cada08fc8a70 232 int mbedtls_hmac_drbg_random_with_add( void *p_rng,
mbedAustin 11:cada08fc8a70 233 unsigned char *output, size_t output_len,
mbedAustin 11:cada08fc8a70 234 const unsigned char *additional,
mbedAustin 11:cada08fc8a70 235 size_t add_len );
mbedAustin 11:cada08fc8a70 236
mbedAustin 11:cada08fc8a70 237 /**
mbedAustin 11:cada08fc8a70 238 * \brief HMAC_DRBG generate random
mbedAustin 11:cada08fc8a70 239 *
mbedAustin 11:cada08fc8a70 240 * Note: Automatically reseeds if reseed_counter is reached or PR is enabled.
mbedAustin 11:cada08fc8a70 241 *
mbedAustin 11:cada08fc8a70 242 * \param p_rng HMAC_DRBG context
mbedAustin 11:cada08fc8a70 243 * \param output Buffer to fill
mbedAustin 11:cada08fc8a70 244 * \param out_len Length of the buffer
mbedAustin 11:cada08fc8a70 245 *
mbedAustin 11:cada08fc8a70 246 * \return 0 if successful, or
mbedAustin 11:cada08fc8a70 247 * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED, or
mbedAustin 11:cada08fc8a70 248 * MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG
mbedAustin 11:cada08fc8a70 249 */
mbedAustin 11:cada08fc8a70 250 int mbedtls_hmac_drbg_random( void *p_rng, unsigned char *output, size_t out_len );
mbedAustin 11:cada08fc8a70 251
mbedAustin 11:cada08fc8a70 252 /**
mbedAustin 11:cada08fc8a70 253 * \brief Free an HMAC_DRBG context
mbedAustin 11:cada08fc8a70 254 *
mbedAustin 11:cada08fc8a70 255 * \param ctx HMAC_DRBG context to free.
mbedAustin 11:cada08fc8a70 256 */
mbedAustin 11:cada08fc8a70 257 void mbedtls_hmac_drbg_free( mbedtls_hmac_drbg_context *ctx );
mbedAustin 11:cada08fc8a70 258
mbedAustin 11:cada08fc8a70 259 #if defined(MBEDTLS_FS_IO)
mbedAustin 11:cada08fc8a70 260 /**
mbedAustin 11:cada08fc8a70 261 * \brief Write a seed file
mbedAustin 11:cada08fc8a70 262 *
mbedAustin 11:cada08fc8a70 263 * \param ctx HMAC_DRBG context
mbedAustin 11:cada08fc8a70 264 * \param path Name of the file
mbedAustin 11:cada08fc8a70 265 *
mbedAustin 11:cada08fc8a70 266 * \return 0 if successful, 1 on file error, or
mbedAustin 11:cada08fc8a70 267 * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED
mbedAustin 11:cada08fc8a70 268 */
mbedAustin 11:cada08fc8a70 269 int mbedtls_hmac_drbg_write_seed_file( mbedtls_hmac_drbg_context *ctx, const char *path );
mbedAustin 11:cada08fc8a70 270
mbedAustin 11:cada08fc8a70 271 /**
mbedAustin 11:cada08fc8a70 272 * \brief Read and update a seed file. Seed is added to this
mbedAustin 11:cada08fc8a70 273 * instance
mbedAustin 11:cada08fc8a70 274 *
mbedAustin 11:cada08fc8a70 275 * \param ctx HMAC_DRBG context
mbedAustin 11:cada08fc8a70 276 * \param path Name of the file
mbedAustin 11:cada08fc8a70 277 *
mbedAustin 11:cada08fc8a70 278 * \return 0 if successful, 1 on file error,
mbedAustin 11:cada08fc8a70 279 * MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED or
mbedAustin 11:cada08fc8a70 280 * MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG
mbedAustin 11:cada08fc8a70 281 */
mbedAustin 11:cada08fc8a70 282 int mbedtls_hmac_drbg_update_seed_file( mbedtls_hmac_drbg_context *ctx, const char *path );
mbedAustin 11:cada08fc8a70 283 #endif /* MBEDTLS_FS_IO */
mbedAustin 11:cada08fc8a70 284
mbedAustin 11:cada08fc8a70 285
mbedAustin 11:cada08fc8a70 286 #if defined(MBEDTLS_SELF_TEST)
mbedAustin 11:cada08fc8a70 287 /**
mbedAustin 11:cada08fc8a70 288 * \brief Checkup routine
mbedAustin 11:cada08fc8a70 289 *
mbedAustin 11:cada08fc8a70 290 * \return 0 if successful, or 1 if the test failed
mbedAustin 11:cada08fc8a70 291 */
mbedAustin 11:cada08fc8a70 292 int mbedtls_hmac_drbg_self_test( int verbose );
mbedAustin 11:cada08fc8a70 293 #endif
mbedAustin 11:cada08fc8a70 294
mbedAustin 11:cada08fc8a70 295 #ifdef __cplusplus
mbedAustin 11:cada08fc8a70 296 }
mbedAustin 11:cada08fc8a70 297 #endif
mbedAustin 11:cada08fc8a70 298
mbedAustin 11:cada08fc8a70 299 #endif /* hmac_drbg.h */