Modified mbed TLS headers for AES functionality only to reduce build size
Dependents: BLE_Gateway_Linker_fix BLE_Gateway
Fork of mbedtls by
mbedtls/md_internal.h@1:24750b9ad5ef, 2016-01-22 (annotated)
- Committer:
- Christopher Haster
- Date:
- Fri Jan 22 16:44:49 2016 -0600
- Revision:
- 1:24750b9ad5ef
Initial move of mbedtls to mercurial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Christopher Haster |
1:24750b9ad5ef | 1 | /** |
Christopher Haster |
1:24750b9ad5ef | 2 | * \file md_internal.h |
Christopher Haster |
1:24750b9ad5ef | 3 | * |
Christopher Haster |
1:24750b9ad5ef | 4 | * \brief Message digest wrappers. |
Christopher Haster |
1:24750b9ad5ef | 5 | * |
Christopher Haster |
1:24750b9ad5ef | 6 | * \warning This in an internal header. Do not include directly. |
Christopher Haster |
1:24750b9ad5ef | 7 | * |
Christopher Haster |
1:24750b9ad5ef | 8 | * \author Adriaan de Jong <dejong@fox-it.com> |
Christopher Haster |
1:24750b9ad5ef | 9 | * |
Christopher Haster |
1:24750b9ad5ef | 10 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
Christopher Haster |
1:24750b9ad5ef | 11 | * SPDX-License-Identifier: Apache-2.0 |
Christopher Haster |
1:24750b9ad5ef | 12 | * |
Christopher Haster |
1:24750b9ad5ef | 13 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
Christopher Haster |
1:24750b9ad5ef | 14 | * not use this file except in compliance with the License. |
Christopher Haster |
1:24750b9ad5ef | 15 | * You may obtain a copy of the License at |
Christopher Haster |
1:24750b9ad5ef | 16 | * |
Christopher Haster |
1:24750b9ad5ef | 17 | * http://www.apache.org/licenses/LICENSE-2.0 |
Christopher Haster |
1:24750b9ad5ef | 18 | * |
Christopher Haster |
1:24750b9ad5ef | 19 | * Unless required by applicable law or agreed to in writing, software |
Christopher Haster |
1:24750b9ad5ef | 20 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
Christopher Haster |
1:24750b9ad5ef | 21 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Christopher Haster |
1:24750b9ad5ef | 22 | * See the License for the specific language governing permissions and |
Christopher Haster |
1:24750b9ad5ef | 23 | * limitations under the License. |
Christopher Haster |
1:24750b9ad5ef | 24 | * |
Christopher Haster |
1:24750b9ad5ef | 25 | * This file is part of mbed TLS (https://tls.mbed.org) |
Christopher Haster |
1:24750b9ad5ef | 26 | */ |
Christopher Haster |
1:24750b9ad5ef | 27 | #ifndef MBEDTLS_MD_WRAP_H |
Christopher Haster |
1:24750b9ad5ef | 28 | #define MBEDTLS_MD_WRAP_H |
Christopher Haster |
1:24750b9ad5ef | 29 | |
Christopher Haster |
1:24750b9ad5ef | 30 | #if !defined(MBEDTLS_CONFIG_FILE) |
Christopher Haster |
1:24750b9ad5ef | 31 | #include "config.h" |
Christopher Haster |
1:24750b9ad5ef | 32 | #else |
Christopher Haster |
1:24750b9ad5ef | 33 | #include MBEDTLS_CONFIG_FILE |
Christopher Haster |
1:24750b9ad5ef | 34 | #endif |
Christopher Haster |
1:24750b9ad5ef | 35 | |
Christopher Haster |
1:24750b9ad5ef | 36 | #include "md.h" |
Christopher Haster |
1:24750b9ad5ef | 37 | |
Christopher Haster |
1:24750b9ad5ef | 38 | #ifdef __cplusplus |
Christopher Haster |
1:24750b9ad5ef | 39 | extern "C" { |
Christopher Haster |
1:24750b9ad5ef | 40 | #endif |
Christopher Haster |
1:24750b9ad5ef | 41 | |
Christopher Haster |
1:24750b9ad5ef | 42 | /** |
Christopher Haster |
1:24750b9ad5ef | 43 | * Message digest information. |
Christopher Haster |
1:24750b9ad5ef | 44 | * Allows message digest functions to be called in a generic way. |
Christopher Haster |
1:24750b9ad5ef | 45 | */ |
Christopher Haster |
1:24750b9ad5ef | 46 | struct mbedtls_md_info_t |
Christopher Haster |
1:24750b9ad5ef | 47 | { |
Christopher Haster |
1:24750b9ad5ef | 48 | /** Digest identifier */ |
Christopher Haster |
1:24750b9ad5ef | 49 | mbedtls_md_type_t type; |
Christopher Haster |
1:24750b9ad5ef | 50 | |
Christopher Haster |
1:24750b9ad5ef | 51 | /** Name of the message digest */ |
Christopher Haster |
1:24750b9ad5ef | 52 | const char * name; |
Christopher Haster |
1:24750b9ad5ef | 53 | |
Christopher Haster |
1:24750b9ad5ef | 54 | /** Output length of the digest function in bytes */ |
Christopher Haster |
1:24750b9ad5ef | 55 | int size; |
Christopher Haster |
1:24750b9ad5ef | 56 | |
Christopher Haster |
1:24750b9ad5ef | 57 | /** Block length of the digest function in bytes */ |
Christopher Haster |
1:24750b9ad5ef | 58 | int block_size; |
Christopher Haster |
1:24750b9ad5ef | 59 | |
Christopher Haster |
1:24750b9ad5ef | 60 | /** Digest initialisation function */ |
Christopher Haster |
1:24750b9ad5ef | 61 | void (*starts_func)( void *ctx ); |
Christopher Haster |
1:24750b9ad5ef | 62 | |
Christopher Haster |
1:24750b9ad5ef | 63 | /** Digest update function */ |
Christopher Haster |
1:24750b9ad5ef | 64 | void (*update_func)( void *ctx, const unsigned char *input, size_t ilen ); |
Christopher Haster |
1:24750b9ad5ef | 65 | |
Christopher Haster |
1:24750b9ad5ef | 66 | /** Digest finalisation function */ |
Christopher Haster |
1:24750b9ad5ef | 67 | void (*finish_func)( void *ctx, unsigned char *output ); |
Christopher Haster |
1:24750b9ad5ef | 68 | |
Christopher Haster |
1:24750b9ad5ef | 69 | /** Generic digest function */ |
Christopher Haster |
1:24750b9ad5ef | 70 | void (*digest_func)( const unsigned char *input, size_t ilen, |
Christopher Haster |
1:24750b9ad5ef | 71 | unsigned char *output ); |
Christopher Haster |
1:24750b9ad5ef | 72 | |
Christopher Haster |
1:24750b9ad5ef | 73 | /** Allocate a new context */ |
Christopher Haster |
1:24750b9ad5ef | 74 | void * (*ctx_alloc_func)( void ); |
Christopher Haster |
1:24750b9ad5ef | 75 | |
Christopher Haster |
1:24750b9ad5ef | 76 | /** Free the given context */ |
Christopher Haster |
1:24750b9ad5ef | 77 | void (*ctx_free_func)( void *ctx ); |
Christopher Haster |
1:24750b9ad5ef | 78 | |
Christopher Haster |
1:24750b9ad5ef | 79 | /** Clone state from a context */ |
Christopher Haster |
1:24750b9ad5ef | 80 | void (*clone_func)( void *dst, const void *src ); |
Christopher Haster |
1:24750b9ad5ef | 81 | |
Christopher Haster |
1:24750b9ad5ef | 82 | /** Internal use only */ |
Christopher Haster |
1:24750b9ad5ef | 83 | void (*process_func)( void *ctx, const unsigned char *input ); |
Christopher Haster |
1:24750b9ad5ef | 84 | }; |
Christopher Haster |
1:24750b9ad5ef | 85 | |
Christopher Haster |
1:24750b9ad5ef | 86 | #if defined(MBEDTLS_MD2_C) |
Christopher Haster |
1:24750b9ad5ef | 87 | extern const mbedtls_md_info_t mbedtls_md2_info; |
Christopher Haster |
1:24750b9ad5ef | 88 | #endif |
Christopher Haster |
1:24750b9ad5ef | 89 | #if defined(MBEDTLS_MD4_C) |
Christopher Haster |
1:24750b9ad5ef | 90 | extern const mbedtls_md_info_t mbedtls_md4_info; |
Christopher Haster |
1:24750b9ad5ef | 91 | #endif |
Christopher Haster |
1:24750b9ad5ef | 92 | #if defined(MBEDTLS_MD5_C) |
Christopher Haster |
1:24750b9ad5ef | 93 | extern const mbedtls_md_info_t mbedtls_md5_info; |
Christopher Haster |
1:24750b9ad5ef | 94 | #endif |
Christopher Haster |
1:24750b9ad5ef | 95 | #if defined(MBEDTLS_RIPEMD160_C) |
Christopher Haster |
1:24750b9ad5ef | 96 | extern const mbedtls_md_info_t mbedtls_ripemd160_info; |
Christopher Haster |
1:24750b9ad5ef | 97 | #endif |
Christopher Haster |
1:24750b9ad5ef | 98 | #if defined(MBEDTLS_SHA1_C) |
Christopher Haster |
1:24750b9ad5ef | 99 | extern const mbedtls_md_info_t mbedtls_sha1_info; |
Christopher Haster |
1:24750b9ad5ef | 100 | #endif |
Christopher Haster |
1:24750b9ad5ef | 101 | #if defined(MBEDTLS_SHA256_C) |
Christopher Haster |
1:24750b9ad5ef | 102 | extern const mbedtls_md_info_t mbedtls_sha224_info; |
Christopher Haster |
1:24750b9ad5ef | 103 | extern const mbedtls_md_info_t mbedtls_sha256_info; |
Christopher Haster |
1:24750b9ad5ef | 104 | #endif |
Christopher Haster |
1:24750b9ad5ef | 105 | #if defined(MBEDTLS_SHA512_C) |
Christopher Haster |
1:24750b9ad5ef | 106 | extern const mbedtls_md_info_t mbedtls_sha384_info; |
Christopher Haster |
1:24750b9ad5ef | 107 | extern const mbedtls_md_info_t mbedtls_sha512_info; |
Christopher Haster |
1:24750b9ad5ef | 108 | #endif |
Christopher Haster |
1:24750b9ad5ef | 109 | |
Christopher Haster |
1:24750b9ad5ef | 110 | #ifdef __cplusplus |
Christopher Haster |
1:24750b9ad5ef | 111 | } |
Christopher Haster |
1:24750b9ad5ef | 112 | #endif |
Christopher Haster |
1:24750b9ad5ef | 113 | |
Christopher Haster |
1:24750b9ad5ef | 114 | #endif /* MBEDTLS_MD_WRAP_H */ |