mbed TLS library

Dependents:   HTTPClient-SSL WS_SERVER

Committer:
ansond
Date:
Thu Jun 11 03:27:03 2015 +0000
Revision:
0:137634ff4186
initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 0:137634ff4186 1 /**
ansond 0:137634ff4186 2 * \file dhm.h
ansond 0:137634ff4186 3 *
ansond 0:137634ff4186 4 * \brief Diffie-Hellman-Merkle key exchange
ansond 0:137634ff4186 5 *
ansond 0:137634ff4186 6 * Copyright (C) 2006-2013, ARM Limited, All Rights Reserved
ansond 0:137634ff4186 7 *
ansond 0:137634ff4186 8 * This file is part of mbed TLS (https://tls.mbed.org)
ansond 0:137634ff4186 9 *
ansond 0:137634ff4186 10 * This program is free software; you can redistribute it and/or modify
ansond 0:137634ff4186 11 * it under the terms of the GNU General Public License as published by
ansond 0:137634ff4186 12 * the Free Software Foundation; either version 2 of the License, or
ansond 0:137634ff4186 13 * (at your option) any later version.
ansond 0:137634ff4186 14 *
ansond 0:137634ff4186 15 * This program is distributed in the hope that it will be useful,
ansond 0:137634ff4186 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ansond 0:137634ff4186 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ansond 0:137634ff4186 18 * GNU General Public License for more details.
ansond 0:137634ff4186 19 *
ansond 0:137634ff4186 20 * You should have received a copy of the GNU General Public License along
ansond 0:137634ff4186 21 * with this program; if not, write to the Free Software Foundation, Inc.,
ansond 0:137634ff4186 22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
ansond 0:137634ff4186 23 */
ansond 0:137634ff4186 24 #ifndef POLARSSL_DHM_H
ansond 0:137634ff4186 25 #define POLARSSL_DHM_H
ansond 0:137634ff4186 26
ansond 0:137634ff4186 27 #include "bignum.h"
ansond 0:137634ff4186 28
ansond 0:137634ff4186 29 /*
ansond 0:137634ff4186 30 * DHM Error codes
ansond 0:137634ff4186 31 */
ansond 0:137634ff4186 32 #define POLARSSL_ERR_DHM_BAD_INPUT_DATA -0x3080 /**< Bad input parameters to function. */
ansond 0:137634ff4186 33 #define POLARSSL_ERR_DHM_READ_PARAMS_FAILED -0x3100 /**< Reading of the DHM parameters failed. */
ansond 0:137634ff4186 34 #define POLARSSL_ERR_DHM_MAKE_PARAMS_FAILED -0x3180 /**< Making of the DHM parameters failed. */
ansond 0:137634ff4186 35 #define POLARSSL_ERR_DHM_READ_PUBLIC_FAILED -0x3200 /**< Reading of the public values failed. */
ansond 0:137634ff4186 36 #define POLARSSL_ERR_DHM_MAKE_PUBLIC_FAILED -0x3280 /**< Making of the public value failed. */
ansond 0:137634ff4186 37 #define POLARSSL_ERR_DHM_CALC_SECRET_FAILED -0x3300 /**< Calculation of the DHM secret failed. */
ansond 0:137634ff4186 38 #define POLARSSL_ERR_DHM_INVALID_FORMAT -0x3380 /**< The ASN.1 data is not formatted correctly. */
ansond 0:137634ff4186 39 #define POLARSSL_ERR_DHM_MALLOC_FAILED -0x3400 /**< Allocation of memory failed. */
ansond 0:137634ff4186 40 #define POLARSSL_ERR_DHM_FILE_IO_ERROR -0x3480 /**< Read/write of file failed. */
ansond 0:137634ff4186 41
ansond 0:137634ff4186 42 /**
ansond 0:137634ff4186 43 * RFC 2409 defines a number of standardized Diffie-Hellman groups
ansond 0:137634ff4186 44 * that can be used.
ansond 0:137634ff4186 45 * RFC 3526 defines a number of standardized Diffie-Hellman groups
ansond 0:137634ff4186 46 * for IKE.
ansond 0:137634ff4186 47 * RFC 5114 defines a number of standardized Diffie-Hellman groups
ansond 0:137634ff4186 48 * that can be used.
ansond 0:137634ff4186 49 *
ansond 0:137634ff4186 50 * Some are included here for convenience.
ansond 0:137634ff4186 51 *
ansond 0:137634ff4186 52 * Included are:
ansond 0:137634ff4186 53 * RFC 2409 6.2. 1024-bit MODP Group (Second Oakley Group)
ansond 0:137634ff4186 54 * RFC 3526 3. 2048-bit MODP Group
ansond 0:137634ff4186 55 * RFC 3526 4. 3072-bit MODP Group
ansond 0:137634ff4186 56 * RFC 5114 2.1. 1024-bit MODP Group with 160-bit Prime Order Subgroup
ansond 0:137634ff4186 57 * RFC 5114 2.2. 2048-bit MODP Group with 224-bit Prime Order Subgroup
ansond 0:137634ff4186 58 */
ansond 0:137634ff4186 59 #define POLARSSL_DHM_RFC2409_MODP_1024_P \
ansond 0:137634ff4186 60 "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
ansond 0:137634ff4186 61 "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \
ansond 0:137634ff4186 62 "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \
ansond 0:137634ff4186 63 "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \
ansond 0:137634ff4186 64 "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" \
ansond 0:137634ff4186 65 "FFFFFFFFFFFFFFFF"
ansond 0:137634ff4186 66
ansond 0:137634ff4186 67 #define POLARSSL_DHM_RFC2409_MODP_1024_G "02"
ansond 0:137634ff4186 68
ansond 0:137634ff4186 69 #define POLARSSL_DHM_RFC3526_MODP_2048_P \
ansond 0:137634ff4186 70 "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
ansond 0:137634ff4186 71 "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \
ansond 0:137634ff4186 72 "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \
ansond 0:137634ff4186 73 "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \
ansond 0:137634ff4186 74 "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" \
ansond 0:137634ff4186 75 "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" \
ansond 0:137634ff4186 76 "83655D23DCA3AD961C62F356208552BB9ED529077096966D" \
ansond 0:137634ff4186 77 "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" \
ansond 0:137634ff4186 78 "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" \
ansond 0:137634ff4186 79 "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" \
ansond 0:137634ff4186 80 "15728E5A8AACAA68FFFFFFFFFFFFFFFF"
ansond 0:137634ff4186 81
ansond 0:137634ff4186 82 #define POLARSSL_DHM_RFC3526_MODP_2048_G "02"
ansond 0:137634ff4186 83
ansond 0:137634ff4186 84 #define POLARSSL_DHM_RFC3526_MODP_3072_P \
ansond 0:137634ff4186 85 "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
ansond 0:137634ff4186 86 "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \
ansond 0:137634ff4186 87 "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \
ansond 0:137634ff4186 88 "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \
ansond 0:137634ff4186 89 "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" \
ansond 0:137634ff4186 90 "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" \
ansond 0:137634ff4186 91 "83655D23DCA3AD961C62F356208552BB9ED529077096966D" \
ansond 0:137634ff4186 92 "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" \
ansond 0:137634ff4186 93 "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" \
ansond 0:137634ff4186 94 "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" \
ansond 0:137634ff4186 95 "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" \
ansond 0:137634ff4186 96 "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" \
ansond 0:137634ff4186 97 "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" \
ansond 0:137634ff4186 98 "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" \
ansond 0:137634ff4186 99 "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" \
ansond 0:137634ff4186 100 "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF"
ansond 0:137634ff4186 101
ansond 0:137634ff4186 102 #define POLARSSL_DHM_RFC3526_MODP_3072_G "02"
ansond 0:137634ff4186 103
ansond 0:137634ff4186 104 #define POLARSSL_DHM_RFC5114_MODP_1024_P \
ansond 0:137634ff4186 105 "B10B8F96A080E01DDE92DE5EAE5D54EC52C99FBCFB06A3C6" \
ansond 0:137634ff4186 106 "9A6A9DCA52D23B616073E28675A23D189838EF1E2EE652C0" \
ansond 0:137634ff4186 107 "13ECB4AEA906112324975C3CD49B83BFACCBDD7D90C4BD70" \
ansond 0:137634ff4186 108 "98488E9C219A73724EFFD6FAE5644738FAA31A4FF55BCCC0" \
ansond 0:137634ff4186 109 "A151AF5F0DC8B4BD45BF37DF365C1A65E68CFDA76D4DA708" \
ansond 0:137634ff4186 110 "DF1FB2BC2E4A4371"
ansond 0:137634ff4186 111
ansond 0:137634ff4186 112 #define POLARSSL_DHM_RFC5114_MODP_1024_G \
ansond 0:137634ff4186 113 "A4D1CBD5C3FD34126765A442EFB99905F8104DD258AC507F" \
ansond 0:137634ff4186 114 "D6406CFF14266D31266FEA1E5C41564B777E690F5504F213" \
ansond 0:137634ff4186 115 "160217B4B01B886A5E91547F9E2749F4D7FBD7D3B9A92EE1" \
ansond 0:137634ff4186 116 "909D0D2263F80A76A6A24C087A091F531DBF0A0169B6A28A" \
ansond 0:137634ff4186 117 "D662A4D18E73AFA32D779D5918D08BC8858F4DCEF97C2A24" \
ansond 0:137634ff4186 118 "855E6EEB22B3B2E5"
ansond 0:137634ff4186 119
ansond 0:137634ff4186 120 #define POLARSSL_DHM_RFC5114_MODP_2048_P \
ansond 0:137634ff4186 121 "AD107E1E9123A9D0D660FAA79559C51FA20D64E5683B9FD1" \
ansond 0:137634ff4186 122 "B54B1597B61D0A75E6FA141DF95A56DBAF9A3C407BA1DF15" \
ansond 0:137634ff4186 123 "EB3D688A309C180E1DE6B85A1274A0A66D3F8152AD6AC212" \
ansond 0:137634ff4186 124 "9037C9EDEFDA4DF8D91E8FEF55B7394B7AD5B7D0B6C12207" \
ansond 0:137634ff4186 125 "C9F98D11ED34DBF6C6BA0B2C8BBC27BE6A00E0A0B9C49708" \
ansond 0:137634ff4186 126 "B3BF8A317091883681286130BC8985DB1602E714415D9330" \
ansond 0:137634ff4186 127 "278273C7DE31EFDC7310F7121FD5A07415987D9ADC0A486D" \
ansond 0:137634ff4186 128 "CDF93ACC44328387315D75E198C641A480CD86A1B9E587E8" \
ansond 0:137634ff4186 129 "BE60E69CC928B2B9C52172E413042E9B23F10B0E16E79763" \
ansond 0:137634ff4186 130 "C9B53DCF4BA80A29E3FB73C16B8E75B97EF363E2FFA31F71" \
ansond 0:137634ff4186 131 "CF9DE5384E71B81C0AC4DFFE0C10E64F"
ansond 0:137634ff4186 132
ansond 0:137634ff4186 133 #define POLARSSL_DHM_RFC5114_MODP_2048_G \
ansond 0:137634ff4186 134 "AC4032EF4F2D9AE39DF30B5C8FFDAC506CDEBE7B89998CAF"\
ansond 0:137634ff4186 135 "74866A08CFE4FFE3A6824A4E10B9A6F0DD921F01A70C4AFA"\
ansond 0:137634ff4186 136 "AB739D7700C29F52C57DB17C620A8652BE5E9001A8D66AD7"\
ansond 0:137634ff4186 137 "C17669101999024AF4D027275AC1348BB8A762D0521BC98A"\
ansond 0:137634ff4186 138 "E247150422EA1ED409939D54DA7460CDB5F6C6B250717CBE"\
ansond 0:137634ff4186 139 "F180EB34118E98D119529A45D6F834566E3025E316A330EF"\
ansond 0:137634ff4186 140 "BB77A86F0C1AB15B051AE3D428C8F8ACB70A8137150B8EEB"\
ansond 0:137634ff4186 141 "10E183EDD19963DDD9E263E4770589EF6AA21E7F5F2FF381"\
ansond 0:137634ff4186 142 "B539CCE3409D13CD566AFBB48D6C019181E1BCFE94B30269"\
ansond 0:137634ff4186 143 "EDFE72FE9B6AA4BD7B5A0F1C71CFFF4C19C418E1F6EC0179"\
ansond 0:137634ff4186 144 "81BC087F2A7065B384B890D3191F2BFA"
ansond 0:137634ff4186 145
ansond 0:137634ff4186 146 #ifdef __cplusplus
ansond 0:137634ff4186 147 extern "C" {
ansond 0:137634ff4186 148 #endif
ansond 0:137634ff4186 149
ansond 0:137634ff4186 150 /**
ansond 0:137634ff4186 151 * \brief DHM context structure
ansond 0:137634ff4186 152 */
ansond 0:137634ff4186 153 typedef struct
ansond 0:137634ff4186 154 {
ansond 0:137634ff4186 155 size_t len; /*!< size(P) in chars */
ansond 0:137634ff4186 156 mpi P; /*!< prime modulus */
ansond 0:137634ff4186 157 mpi G; /*!< generator */
ansond 0:137634ff4186 158 mpi X; /*!< secret value */
ansond 0:137634ff4186 159 mpi GX; /*!< self = G^X mod P */
ansond 0:137634ff4186 160 mpi GY; /*!< peer = G^Y mod P */
ansond 0:137634ff4186 161 mpi K; /*!< key = GY^X mod P */
ansond 0:137634ff4186 162 mpi RP; /*!< cached R^2 mod P */
ansond 0:137634ff4186 163 mpi Vi; /*!< blinding value */
ansond 0:137634ff4186 164 mpi Vf; /*!< un-blinding value */
ansond 0:137634ff4186 165 mpi pX; /*!< previous X */
ansond 0:137634ff4186 166 }
ansond 0:137634ff4186 167 dhm_context;
ansond 0:137634ff4186 168
ansond 0:137634ff4186 169 /**
ansond 0:137634ff4186 170 * \brief Initialize DHM context
ansond 0:137634ff4186 171 *
ansond 0:137634ff4186 172 * \param ctx DHM context to be initialized
ansond 0:137634ff4186 173 */
ansond 0:137634ff4186 174 void dhm_init( dhm_context *ctx );
ansond 0:137634ff4186 175
ansond 0:137634ff4186 176 /**
ansond 0:137634ff4186 177 * \brief Parse the ServerKeyExchange parameters
ansond 0:137634ff4186 178 *
ansond 0:137634ff4186 179 * \param ctx DHM context
ansond 0:137634ff4186 180 * \param p &(start of input buffer)
ansond 0:137634ff4186 181 * \param end end of buffer
ansond 0:137634ff4186 182 *
ansond 0:137634ff4186 183 * \return 0 if successful, or an POLARSSL_ERR_DHM_XXX error code
ansond 0:137634ff4186 184 */
ansond 0:137634ff4186 185 int dhm_read_params( dhm_context *ctx,
ansond 0:137634ff4186 186 unsigned char **p,
ansond 0:137634ff4186 187 const unsigned char *end );
ansond 0:137634ff4186 188
ansond 0:137634ff4186 189 /**
ansond 0:137634ff4186 190 * \brief Setup and write the ServerKeyExchange parameters
ansond 0:137634ff4186 191 *
ansond 0:137634ff4186 192 * \param ctx DHM context
ansond 0:137634ff4186 193 * \param x_size private value size in bytes
ansond 0:137634ff4186 194 * \param output destination buffer
ansond 0:137634ff4186 195 * \param olen number of chars written
ansond 0:137634ff4186 196 * \param f_rng RNG function
ansond 0:137634ff4186 197 * \param p_rng RNG parameter
ansond 0:137634ff4186 198 *
ansond 0:137634ff4186 199 * \note This function assumes that ctx->P and ctx->G
ansond 0:137634ff4186 200 * have already been properly set (for example
ansond 0:137634ff4186 201 * using mpi_read_string or mpi_read_binary).
ansond 0:137634ff4186 202 *
ansond 0:137634ff4186 203 * \return 0 if successful, or an POLARSSL_ERR_DHM_XXX error code
ansond 0:137634ff4186 204 */
ansond 0:137634ff4186 205 int dhm_make_params( dhm_context *ctx, int x_size,
ansond 0:137634ff4186 206 unsigned char *output, size_t *olen,
ansond 0:137634ff4186 207 int (*f_rng)(void *, unsigned char *, size_t),
ansond 0:137634ff4186 208 void *p_rng );
ansond 0:137634ff4186 209
ansond 0:137634ff4186 210 /**
ansond 0:137634ff4186 211 * \brief Import the peer's public value G^Y
ansond 0:137634ff4186 212 *
ansond 0:137634ff4186 213 * \param ctx DHM context
ansond 0:137634ff4186 214 * \param input input buffer
ansond 0:137634ff4186 215 * \param ilen size of buffer
ansond 0:137634ff4186 216 *
ansond 0:137634ff4186 217 * \return 0 if successful, or an POLARSSL_ERR_DHM_XXX error code
ansond 0:137634ff4186 218 */
ansond 0:137634ff4186 219 int dhm_read_public( dhm_context *ctx,
ansond 0:137634ff4186 220 const unsigned char *input, size_t ilen );
ansond 0:137634ff4186 221
ansond 0:137634ff4186 222 /**
ansond 0:137634ff4186 223 * \brief Create own private value X and export G^X
ansond 0:137634ff4186 224 *
ansond 0:137634ff4186 225 * \param ctx DHM context
ansond 0:137634ff4186 226 * \param x_size private value size in bytes
ansond 0:137634ff4186 227 * \param output destination buffer
ansond 0:137634ff4186 228 * \param olen must be equal to ctx->P.len
ansond 0:137634ff4186 229 * \param f_rng RNG function
ansond 0:137634ff4186 230 * \param p_rng RNG parameter
ansond 0:137634ff4186 231 *
ansond 0:137634ff4186 232 * \return 0 if successful, or an POLARSSL_ERR_DHM_XXX error code
ansond 0:137634ff4186 233 */
ansond 0:137634ff4186 234 int dhm_make_public( dhm_context *ctx, int x_size,
ansond 0:137634ff4186 235 unsigned char *output, size_t olen,
ansond 0:137634ff4186 236 int (*f_rng)(void *, unsigned char *, size_t),
ansond 0:137634ff4186 237 void *p_rng );
ansond 0:137634ff4186 238
ansond 0:137634ff4186 239 /**
ansond 0:137634ff4186 240 * \brief Derive and export the shared secret (G^Y)^X mod P
ansond 0:137634ff4186 241 *
ansond 0:137634ff4186 242 * \param ctx DHM context
ansond 0:137634ff4186 243 * \param output destination buffer
ansond 0:137634ff4186 244 * \param olen on entry, must hold the size of the destination buffer
ansond 0:137634ff4186 245 * on exit, holds the actual number of bytes written
ansond 0:137634ff4186 246 * \param f_rng RNG function, for blinding purposes
ansond 0:137634ff4186 247 * \param p_rng RNG parameter
ansond 0:137634ff4186 248 *
ansond 0:137634ff4186 249 * \return 0 if successful, or an POLARSSL_ERR_DHM_XXX error code
ansond 0:137634ff4186 250 *
ansond 0:137634ff4186 251 * \note If non-NULL, f_rng is used to blind the input as
ansond 0:137634ff4186 252 * countermeasure against timing attacks. Blinding is
ansond 0:137634ff4186 253 * automatically used if and only if our secret value X is
ansond 0:137634ff4186 254 * re-used and costs nothing otherwise, so it is recommended
ansond 0:137634ff4186 255 * to always pass a non-NULL f_rng argument.
ansond 0:137634ff4186 256 */
ansond 0:137634ff4186 257 int dhm_calc_secret( dhm_context *ctx,
ansond 0:137634ff4186 258 unsigned char *output, size_t *olen,
ansond 0:137634ff4186 259 int (*f_rng)(void *, unsigned char *, size_t),
ansond 0:137634ff4186 260 void *p_rng );
ansond 0:137634ff4186 261
ansond 0:137634ff4186 262 /**
ansond 0:137634ff4186 263 * \brief Free and clear the components of a DHM key
ansond 0:137634ff4186 264 *
ansond 0:137634ff4186 265 * \param ctx DHM context to free and clear
ansond 0:137634ff4186 266 */
ansond 0:137634ff4186 267 void dhm_free( dhm_context *ctx );
ansond 0:137634ff4186 268
ansond 0:137634ff4186 269 #if defined(POLARSSL_ASN1_PARSE_C)
ansond 0:137634ff4186 270 /** \ingroup x509_module */
ansond 0:137634ff4186 271 /**
ansond 0:137634ff4186 272 * \brief Parse DHM parameters
ansond 0:137634ff4186 273 *
ansond 0:137634ff4186 274 * \param dhm DHM context to be initialized
ansond 0:137634ff4186 275 * \param dhmin input buffer
ansond 0:137634ff4186 276 * \param dhminlen size of the buffer
ansond 0:137634ff4186 277 *
ansond 0:137634ff4186 278 * \return 0 if successful, or a specific DHM or PEM error code
ansond 0:137634ff4186 279 */
ansond 0:137634ff4186 280 int dhm_parse_dhm( dhm_context *dhm, const unsigned char *dhmin,
ansond 0:137634ff4186 281 size_t dhminlen );
ansond 0:137634ff4186 282
ansond 0:137634ff4186 283 #if defined(POLARSSL_FS_IO)
ansond 0:137634ff4186 284 /** \ingroup x509_module */
ansond 0:137634ff4186 285 /**
ansond 0:137634ff4186 286 * \brief Load and parse DHM parameters
ansond 0:137634ff4186 287 *
ansond 0:137634ff4186 288 * \param dhm DHM context to be initialized
ansond 0:137634ff4186 289 * \param path filename to read the DHM Parameters from
ansond 0:137634ff4186 290 *
ansond 0:137634ff4186 291 * \return 0 if successful, or a specific DHM or PEM error code
ansond 0:137634ff4186 292 */
ansond 0:137634ff4186 293 int dhm_parse_dhmfile( dhm_context *dhm, const char *path );
ansond 0:137634ff4186 294 #endif /* POLARSSL_FS_IO */
ansond 0:137634ff4186 295 #endif /* POLARSSL_ASN1_PARSE_C */
ansond 0:137634ff4186 296
ansond 0:137634ff4186 297 /**
ansond 0:137634ff4186 298 * \brief Checkup routine
ansond 0:137634ff4186 299 *
ansond 0:137634ff4186 300 * \return 0 if successful, or 1 if the test failed
ansond 0:137634ff4186 301 */
ansond 0:137634ff4186 302 int dhm_self_test( int verbose );
ansond 0:137634ff4186 303
ansond 0:137634ff4186 304 #ifdef __cplusplus
ansond 0:137634ff4186 305 }
ansond 0:137634ff4186 306 #endif
ansond 0:137634ff4186 307
ansond 0:137634ff4186 308 #endif /* dhm.h */
ansond 0:137634ff4186 309