blob: dad123540a1d9497f47198383b9a6116ed1f95e5 [file] [log] [blame]
Paul Bakker17373852011-01-06 14:20:01 +00001/**
Chris Jonesdaacb592021-03-09 17:03:29 +00002 * \file md_wrap.h
Paul Bakker9af723c2014-05-01 13:03:14 +02003 *
Paul Bakker17373852011-01-06 14:20:01 +00004 * \brief Message digest wrappers.
5 *
Manuel Pégourié-Gonnardca878db2015-03-24 12:13:30 +01006 * \warning This in an internal header. Do not include directly.
7 *
Paul Bakker17373852011-01-06 14:20:01 +00008 * \author Adriaan de Jong <dejong@fox-it.com>
Darryl Greena40a1012018-01-05 15:33:17 +00009 */
10/*
Bence Szépkúti1e148272020-08-07 13:07:28 +020011 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000012 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Paul Bakker17373852011-01-06 14:20:01 +000013 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020014#ifndef MBEDTLS_MD_WRAP_H
15#define MBEDTLS_MD_WRAP_H
Paul Bakker17373852011-01-06 14:20:01 +000016
Bence Szépkútic662b362021-05-27 11:25:03 +020017#include "mbedtls/build_info.h"
Manuel Pégourié-Gonnard6c5abfa2015-02-13 14:12:07 +000018
Jaeden Ameroc49fbbf2019-07-04 20:01:14 +010019#include "mbedtls/md.h"
Paul Bakker17373852011-01-06 14:20:01 +000020
Paul Bakker17373852011-01-06 14:20:01 +000021#ifdef __cplusplus
22extern "C" {
23#endif
24
Manuel Pégourié-Gonnardca878db2015-03-24 12:13:30 +010025/**
26 * Message digest information.
27 * Allows message digest functions to be called in a generic way.
28 */
Gilles Peskine449bd832023-01-11 14:50:10 +010029struct mbedtls_md_info_t {
Gilles Peskine2838b7b2019-07-19 16:03:39 +020030 /** Digest identifier */
31 mbedtls_md_type_t type;
32
Manuel Pégourié-Gonnardb8186a52015-06-18 14:58:58 +020033 /** Output length of the digest function in bytes */
Gilles Peskine2838b7b2019-07-19 16:03:39 +020034 unsigned char size;
Manuel Pégourié-Gonnardca878db2015-03-24 12:13:30 +010035
Manuel Pégourié-Gonnarda36ef6b2023-06-21 12:02:07 +020036#if defined(MBEDTLS_MD_C)
Manuel Pégourié-Gonnardb8186a52015-06-18 14:58:58 +020037 /** Block length of the digest function in bytes */
Gilles Peskine2838b7b2019-07-19 16:03:39 +020038 unsigned char block_size;
Manuel Pégourié-Gonnarda36ef6b2023-06-21 12:02:07 +020039#endif
Manuel Pégourié-Gonnardca878db2015-03-24 12:13:30 +010040};
41
Paul Bakker17373852011-01-06 14:20:01 +000042#ifdef __cplusplus
43}
44#endif
45
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020046#endif /* MBEDTLS_MD_WRAP_H */