Gleb Klochkov / Mbed OS Climatcontroll_Main

Dependencies:   esp8266-driver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers md_internal.h Source File

md_internal.h

Go to the documentation of this file.
00001 /**
00002  * \file md_internal.h
00003  *
00004  * \brief Message digest wrappers.
00005  *
00006  * \warning This in an internal header. Do not include directly.
00007  *
00008  * \author Adriaan de Jong <dejong@fox-it.com>
00009  */
00010 /*
00011  *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
00012  *  SPDX-License-Identifier: Apache-2.0
00013  *
00014  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
00015  *  not use this file except in compliance with the License.
00016  *  You may obtain a copy of the License at
00017  *
00018  *  http://www.apache.org/licenses/LICENSE-2.0
00019  *
00020  *  Unless required by applicable law or agreed to in writing, software
00021  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00022  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00023  *  See the License for the specific language governing permissions and
00024  *  limitations under the License.
00025  *
00026  *  This file is part of mbed TLS (https://tls.mbed.org)
00027  */
00028 #ifndef MBEDTLS_MD_WRAP_H
00029 #define MBEDTLS_MD_WRAP_H
00030 
00031 #if !defined(MBEDTLS_CONFIG_FILE)
00032 #include "config.h"
00033 #else
00034 #include MBEDTLS_CONFIG_FILE
00035 #endif
00036 
00037 #include "md.h"
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00043 /**
00044  * Message digest information.
00045  * Allows message digest functions to be called in a generic way.
00046  */
00047 struct mbedtls_md_info_t
00048 {
00049     /** Digest identifier */
00050     mbedtls_md_type_t type;
00051 
00052     /** Name of the message digest */
00053     const char * name;
00054 
00055     /** Output length of the digest function in bytes */
00056     int size;
00057 
00058     /** Block length of the digest function in bytes */
00059     int block_size;
00060 
00061     /** Digest initialisation function */
00062     int (*starts_func)( void *ctx );
00063 
00064     /** Digest update function */
00065     int (*update_func)( void *ctx, const unsigned char *input, size_t ilen );
00066 
00067     /** Digest finalisation function */
00068     int (*finish_func)( void *ctx, unsigned char *output );
00069 
00070     /** Generic digest function */
00071     int (*digest_func)( const unsigned char *input, size_t ilen,
00072                         unsigned char *output );
00073 
00074     /** Allocate a new context */
00075     void * (*ctx_alloc_func)( void );
00076 
00077     /** Free the given context */
00078     void (*ctx_free_func)( void *ctx );
00079 
00080     /** Clone state from a context */
00081     void (*clone_func)( void *dst, const void *src );
00082 
00083     /** Internal use only */
00084     int (*process_func)( void *ctx, const unsigned char *input );
00085 };
00086 
00087 #if defined(MBEDTLS_MD2_C)
00088 extern const mbedtls_md_info_t mbedtls_md2_info;
00089 #endif
00090 #if defined(MBEDTLS_MD4_C)
00091 extern const mbedtls_md_info_t mbedtls_md4_info;
00092 #endif
00093 #if defined(MBEDTLS_MD5_C)
00094 extern const mbedtls_md_info_t mbedtls_md5_info;
00095 #endif
00096 #if defined(MBEDTLS_RIPEMD160_C)
00097 extern const mbedtls_md_info_t mbedtls_ripemd160_info;
00098 #endif
00099 #if defined(MBEDTLS_SHA1_C)
00100 extern const mbedtls_md_info_t mbedtls_sha1_info;
00101 #endif
00102 #if defined(MBEDTLS_SHA256_C)
00103 extern const mbedtls_md_info_t mbedtls_sha224_info;
00104 extern const mbedtls_md_info_t mbedtls_sha256_info;
00105 #endif
00106 #if defined(MBEDTLS_SHA512_C)
00107 extern const mbedtls_md_info_t mbedtls_sha384_info;
00108 extern const mbedtls_md_info_t mbedtls_sha512_info;
00109 #endif
00110 
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114 
00115 #endif /* MBEDTLS_MD_WRAP_H */