md_wrap.c 11.6 KB
Newer Older
1 2 3
/**
 * \file md_wrap.c

4
 * \brief Generic message digest wrapper for mbed TLS
5 6 7
 *
 * \author Adriaan de Jong <dejong@fox-it.com>
 *
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
8
 *  Copyright (C) 2006-2014, ARM Limited, All Rights Reserved
9
 *
10
 *  This file is part of mbed TLS (https://tls.mbed.org)
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
27
#if !defined(MBEDTLS_CONFIG_FILE)
28
#include "mbedtls/config.h"
29
#else
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
30
#include MBEDTLS_CONFIG_FILE
31
#endif
32

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
33
#if defined(MBEDTLS_MD_C)
34

35
#include "mbedtls/md_internal.h"
36

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
37
#if defined(MBEDTLS_MD2_C)
38
#include "mbedtls/md2.h"
39 40
#endif

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
41
#if defined(MBEDTLS_MD4_C)
42
#include "mbedtls/md4.h"
43 44
#endif

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
45
#if defined(MBEDTLS_MD5_C)
46
#include "mbedtls/md5.h"
47 48
#endif

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
49
#if defined(MBEDTLS_RIPEMD160_C)
50
#include "mbedtls/ripemd160.h"
51 52
#endif

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
53
#if defined(MBEDTLS_SHA1_C)
54
#include "mbedtls/sha1.h"
55 56
#endif

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
57
#if defined(MBEDTLS_SHA256_C)
58
#include "mbedtls/sha256.h"
59 60
#endif

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
61
#if defined(MBEDTLS_SHA512_C)
62
#include "mbedtls/sha512.h"
63
#endif
64

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
65
#if defined(MBEDTLS_PLATFORM_C)
66
#include "mbedtls/platform.h"
67
#else
68
#include <stdlib.h>
69
#define mbedtls_calloc    calloc
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
70
#define mbedtls_free       free
71 72
#endif

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
73
#if defined(MBEDTLS_MD2_C)
74 75 76

static void md2_starts_wrap( void *ctx )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
77
    mbedtls_md2_starts( (mbedtls_md2_context *) ctx );
78 79
}

80 81
static void md2_update_wrap( void *ctx, const unsigned char *input,
                             size_t ilen )
82
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
83
    mbedtls_md2_update( (mbedtls_md2_context *) ctx, input, ilen );
84 85 86 87
}

static void md2_finish_wrap( void *ctx, unsigned char *output )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
88
    mbedtls_md2_finish( (mbedtls_md2_context *) ctx, output );
89 90
}

91
static void *md2_ctx_alloc( void )
92
{
93 94 95 96 97 98
    void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_md2_context ) );

    if( ctx != NULL )
        mbedtls_md2_init( (mbedtls_md2_context *) ctx );

    return( ctx );
99 100 101 102
}

static void md2_ctx_free( void *ctx )
{
103
    mbedtls_md2_free( (mbedtls_md2_context *) ctx );
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
104
    mbedtls_free( ctx );
105 106
}

107 108 109 110
static void md2_process_wrap( void *ctx, const unsigned char *data )
{
    ((void) data);

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
111
    mbedtls_md2_process( (mbedtls_md2_context *) ctx );
112 113
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
114 115
const mbedtls_md_info_t mbedtls_md2_info = {
    MBEDTLS_MD_MD2,
116 117
    "MD2",
    16,
118
    16,
119 120 121
    md2_starts_wrap,
    md2_update_wrap,
    md2_finish_wrap,
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
122
    mbedtls_md2,
123 124
    md2_ctx_alloc,
    md2_ctx_free,
125
    md2_process_wrap,
126 127
};

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
128
#endif /* MBEDTLS_MD2_C */
129

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
130
#if defined(MBEDTLS_MD4_C)
131

132
static void md4_starts_wrap( void *ctx )
133
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
134
    mbedtls_md4_starts( (mbedtls_md4_context *) ctx );
135 136
}

137 138
static void md4_update_wrap( void *ctx, const unsigned char *input,
                             size_t ilen )
139
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
140
    mbedtls_md4_update( (mbedtls_md4_context *) ctx, input, ilen );
141 142
}

143
static void md4_finish_wrap( void *ctx, unsigned char *output )
144
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
145
    mbedtls_md4_finish( (mbedtls_md4_context *) ctx, output );
146 147
}

148
static void *md4_ctx_alloc( void )
149
{
150 151 152 153 154 155
    void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_md4_context ) );

    if( ctx != NULL )
        mbedtls_md4_init( (mbedtls_md4_context *) ctx );

    return( ctx );
156 157
}

158
static void md4_ctx_free( void *ctx )
159
{
160
    mbedtls_md4_free( (mbedtls_md4_context *) ctx );
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
161
    mbedtls_free( ctx );
162 163
}

164
static void md4_process_wrap( void *ctx, const unsigned char *data )
165
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
166
    mbedtls_md4_process( (mbedtls_md4_context *) ctx, data );
167 168
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
169 170
const mbedtls_md_info_t mbedtls_md4_info = {
    MBEDTLS_MD_MD4,
171 172
    "MD4",
    16,
173
    64,
174 175 176
    md4_starts_wrap,
    md4_update_wrap,
    md4_finish_wrap,
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
177
    mbedtls_md4,
178 179
    md4_ctx_alloc,
    md4_ctx_free,
180
    md4_process_wrap,
181 182
};

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
183
#endif /* MBEDTLS_MD4_C */
184

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
185
#if defined(MBEDTLS_MD5_C)
186 187 188

static void md5_starts_wrap( void *ctx )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
189
    mbedtls_md5_starts( (mbedtls_md5_context *) ctx );
190 191
}

192 193
static void md5_update_wrap( void *ctx, const unsigned char *input,
                             size_t ilen )
194
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
195
    mbedtls_md5_update( (mbedtls_md5_context *) ctx, input, ilen );
196 197 198 199
}

static void md5_finish_wrap( void *ctx, unsigned char *output )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
200
    mbedtls_md5_finish( (mbedtls_md5_context *) ctx, output );
201 202
}

203
static void *md5_ctx_alloc( void )
204
{
205 206 207 208 209 210
    void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_md5_context ) );

    if( ctx != NULL )
        mbedtls_md5_init( (mbedtls_md5_context *) ctx );

    return( ctx );
211 212 213 214
}

static void md5_ctx_free( void *ctx )
{
215
    mbedtls_md5_free( (mbedtls_md5_context *) ctx );
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
216
    mbedtls_free( ctx );
217 218
}

219 220
static void md5_process_wrap( void *ctx, const unsigned char *data )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
221
    mbedtls_md5_process( (mbedtls_md5_context *) ctx, data );
222 223
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
224 225
const mbedtls_md_info_t mbedtls_md5_info = {
    MBEDTLS_MD_MD5,
226 227
    "MD5",
    16,
228
    64,
229 230 231
    md5_starts_wrap,
    md5_update_wrap,
    md5_finish_wrap,
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
232
    mbedtls_md5,
233 234
    md5_ctx_alloc,
    md5_ctx_free,
235
    md5_process_wrap,
236 237
};

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
238
#endif /* MBEDTLS_MD5_C */
239

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
240
#if defined(MBEDTLS_RIPEMD160_C)
241

Paul Bakker's avatar
Paul Bakker committed
242
static void ripemd160_starts_wrap( void *ctx )
243
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
244
    mbedtls_ripemd160_starts( (mbedtls_ripemd160_context *) ctx );
245 246
}

247 248
static void ripemd160_update_wrap( void *ctx, const unsigned char *input,
                                   size_t ilen )
249
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
250
    mbedtls_ripemd160_update( (mbedtls_ripemd160_context *) ctx, input, ilen );
251 252
}

Paul Bakker's avatar
Paul Bakker committed
253
static void ripemd160_finish_wrap( void *ctx, unsigned char *output )
254
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
255
    mbedtls_ripemd160_finish( (mbedtls_ripemd160_context *) ctx, output );
256 257
}

258
static void *ripemd160_ctx_alloc( void )
259
{
260
    void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_ripemd160_context ) );
261

262 263
    if( ctx != NULL )
        mbedtls_ripemd160_init( (mbedtls_ripemd160_context *) ctx );
264 265

    return( ctx );
266 267
}

Paul Bakker's avatar
Paul Bakker committed
268
static void ripemd160_ctx_free( void *ctx )
269
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
270 271
    mbedtls_ripemd160_free( (mbedtls_ripemd160_context *) ctx );
    mbedtls_free( ctx );
272 273
}

Paul Bakker's avatar
Paul Bakker committed
274
static void ripemd160_process_wrap( void *ctx, const unsigned char *data )
275
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
276
    mbedtls_ripemd160_process( (mbedtls_ripemd160_context *) ctx, data );
277 278
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
279 280
const mbedtls_md_info_t mbedtls_ripemd160_info = {
    MBEDTLS_MD_RIPEMD160,
Paul Bakker's avatar
Paul Bakker committed
281
    "RIPEMD160",
282
    20,
283
    64,
Paul Bakker's avatar
Paul Bakker committed
284 285 286
    ripemd160_starts_wrap,
    ripemd160_update_wrap,
    ripemd160_finish_wrap,
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
287
    mbedtls_ripemd160,
Paul Bakker's avatar
Paul Bakker committed
288 289 290
    ripemd160_ctx_alloc,
    ripemd160_ctx_free,
    ripemd160_process_wrap,
291 292
};

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
293
#endif /* MBEDTLS_RIPEMD160_C */
294

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
295
#if defined(MBEDTLS_SHA1_C)
296

297
static void sha1_starts_wrap( void *ctx )
298
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
299
    mbedtls_sha1_starts( (mbedtls_sha1_context *) ctx );
300 301
}

302 303
static void sha1_update_wrap( void *ctx, const unsigned char *input,
                              size_t ilen )
304
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
305
    mbedtls_sha1_update( (mbedtls_sha1_context *) ctx, input, ilen );
306 307
}

308
static void sha1_finish_wrap( void *ctx, unsigned char *output )
309
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
310
    mbedtls_sha1_finish( (mbedtls_sha1_context *) ctx, output );
311 312
}

313
static void *sha1_ctx_alloc( void )
314
{
315
    void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_sha1_context ) );
316

317 318
    if( ctx != NULL )
        mbedtls_sha1_init( (mbedtls_sha1_context *) ctx );
319 320

    return( ctx );
321 322
}

323
static void sha1_ctx_free( void *ctx )
324
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
325 326
    mbedtls_sha1_free( (mbedtls_sha1_context *) ctx );
    mbedtls_free( ctx );
327 328
}

329
static void sha1_process_wrap( void *ctx, const unsigned char *data )
330
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
331
    mbedtls_sha1_process( (mbedtls_sha1_context *) ctx, data );
332 333
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
334 335
const mbedtls_md_info_t mbedtls_sha1_info = {
    MBEDTLS_MD_SHA1,
336 337
    "SHA1",
    20,
338
    64,
339 340 341
    sha1_starts_wrap,
    sha1_update_wrap,
    sha1_finish_wrap,
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
342
    mbedtls_sha1,
343 344
    sha1_ctx_alloc,
    sha1_ctx_free,
345
    sha1_process_wrap,
346 347
};

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
348
#endif /* MBEDTLS_SHA1_C */
349 350 351 352

/*
 * Wrappers for generic message digests
 */
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
353
#if defined(MBEDTLS_SHA256_C)
354

355
static void sha224_starts_wrap( void *ctx )
356
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
357
    mbedtls_sha256_starts( (mbedtls_sha256_context *) ctx, 1 );
358 359
}

360 361
static void sha224_update_wrap( void *ctx, const unsigned char *input,
                                size_t ilen )
362
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
363
    mbedtls_sha256_update( (mbedtls_sha256_context *) ctx, input, ilen );
364 365
}

366
static void sha224_finish_wrap( void *ctx, unsigned char *output )
367
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
368
    mbedtls_sha256_finish( (mbedtls_sha256_context *) ctx, output );
369 370
}

371
static void sha224_wrap( const unsigned char *input, size_t ilen,
372 373
                    unsigned char *output )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
374
    mbedtls_sha256( input, ilen, output, 1 );
375 376
}

377
static void *sha224_ctx_alloc( void )
378
{
379 380 381 382 383 384
    void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_sha256_context ) );

    if( ctx != NULL )
        mbedtls_sha256_init( (mbedtls_sha256_context *) ctx );

    return( ctx );
385 386
}

387
static void sha224_ctx_free( void *ctx )
388
{
389
    mbedtls_sha256_free( (mbedtls_sha256_context *) ctx );
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
390
    mbedtls_free( ctx );
391 392
}

393
static void sha224_process_wrap( void *ctx, const unsigned char *data )
394
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
395
    mbedtls_sha256_process( (mbedtls_sha256_context *) ctx, data );
396 397
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
398 399
const mbedtls_md_info_t mbedtls_sha224_info = {
    MBEDTLS_MD_SHA224,
400 401
    "SHA224",
    28,
402
    64,
403 404 405 406 407 408
    sha224_starts_wrap,
    sha224_update_wrap,
    sha224_finish_wrap,
    sha224_wrap,
    sha224_ctx_alloc,
    sha224_ctx_free,
409
    sha224_process_wrap,
410 411
};

412
static void sha256_starts_wrap( void *ctx )
413
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
414
    mbedtls_sha256_starts( (mbedtls_sha256_context *) ctx, 0 );
415 416
}

417
static void sha256_wrap( const unsigned char *input, size_t ilen,
418 419
                    unsigned char *output )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
420
    mbedtls_sha256( input, ilen, output, 0 );
421 422
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
423 424
const mbedtls_md_info_t mbedtls_sha256_info = {
    MBEDTLS_MD_SHA256,
425 426
    "SHA256",
    32,
427
    64,
428
    sha256_starts_wrap,
429 430
    sha224_update_wrap,
    sha224_finish_wrap,
431
    sha256_wrap,
432 433 434
    sha224_ctx_alloc,
    sha224_ctx_free,
    sha224_process_wrap,
435 436
};

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
437
#endif /* MBEDTLS_SHA256_C */
438

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
439
#if defined(MBEDTLS_SHA512_C)
440

441
static void sha384_starts_wrap( void *ctx )
442
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
443
    mbedtls_sha512_starts( (mbedtls_sha512_context *) ctx, 1 );
444 445
}

446 447
static void sha384_update_wrap( void *ctx, const unsigned char *input,
                                size_t ilen )
448
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
449
    mbedtls_sha512_update( (mbedtls_sha512_context *) ctx, input, ilen );
450 451
}

452
static void sha384_finish_wrap( void *ctx, unsigned char *output )
453
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
454
    mbedtls_sha512_finish( (mbedtls_sha512_context *) ctx, output );
455 456
}

457
static void sha384_wrap( const unsigned char *input, size_t ilen,
458 459
                    unsigned char *output )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
460
    mbedtls_sha512( input, ilen, output, 1 );
461 462
}

463
static void *sha384_ctx_alloc( void )
464
{
465 466 467 468 469 470
    void *ctx = mbedtls_calloc( 1, sizeof( mbedtls_sha512_context ) );

    if( ctx != NULL )
        mbedtls_sha512_init( (mbedtls_sha512_context *) ctx );

    return( ctx );
471 472
}

473
static void sha384_ctx_free( void *ctx )
474
{
475
    mbedtls_sha512_free( (mbedtls_sha512_context *) ctx );
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
476
    mbedtls_free( ctx );
477 478
}

479
static void sha384_process_wrap( void *ctx, const unsigned char *data )
480
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
481
    mbedtls_sha512_process( (mbedtls_sha512_context *) ctx, data );
482 483
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
484 485
const mbedtls_md_info_t mbedtls_sha384_info = {
    MBEDTLS_MD_SHA384,
486 487
    "SHA384",
    48,
488
    128,
489 490 491 492 493 494
    sha384_starts_wrap,
    sha384_update_wrap,
    sha384_finish_wrap,
    sha384_wrap,
    sha384_ctx_alloc,
    sha384_ctx_free,
495
    sha384_process_wrap,
496 497
};

498
static void sha512_starts_wrap( void *ctx )
499
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
500
    mbedtls_sha512_starts( (mbedtls_sha512_context *) ctx, 0 );
501 502
}

503
static void sha512_wrap( const unsigned char *input, size_t ilen,
504 505
                    unsigned char *output )
{
Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
506
    mbedtls_sha512( input, ilen, output, 0 );
507 508
}

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
509 510
const mbedtls_md_info_t mbedtls_sha512_info = {
    MBEDTLS_MD_SHA512,
511 512
    "SHA512",
    64,
513
    128,
514
    sha512_starts_wrap,
515 516
    sha384_update_wrap,
    sha384_finish_wrap,
517
    sha512_wrap,
518 519 520
    sha384_ctx_alloc,
    sha384_ctx_free,
    sha384_process_wrap,
521 522
};

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
523
#endif /* MBEDTLS_SHA512_C */
524

Manuel Pégourié-Gonnard's avatar
Manuel Pégourié-Gonnard committed
525
#endif /* MBEDTLS_MD_C */