Timothy Beight / Mbed 2 deprecated 6_songs-from-the-cloud

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of 6_songs-from-the-cloud by MakingMusicWorkshop

Committer:
maclobdell
Date:
Wed May 18 19:06:32 2016 +0000
Revision:
0:f7c60d3e7b8a
clean version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maclobdell 0:f7c60d3e7b8a 1 /**
maclobdell 0:f7c60d3e7b8a 2 * \file mbedtls_md2.h
maclobdell 0:f7c60d3e7b8a 3 *
maclobdell 0:f7c60d3e7b8a 4 * \brief MD2 message digest algorithm (hash function)
maclobdell 0:f7c60d3e7b8a 5 *
maclobdell 0:f7c60d3e7b8a 6 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
maclobdell 0:f7c60d3e7b8a 7 * SPDX-License-Identifier: Apache-2.0
maclobdell 0:f7c60d3e7b8a 8 *
maclobdell 0:f7c60d3e7b8a 9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
maclobdell 0:f7c60d3e7b8a 10 * not use this file except in compliance with the License.
maclobdell 0:f7c60d3e7b8a 11 * You may obtain a copy of the License at
maclobdell 0:f7c60d3e7b8a 12 *
maclobdell 0:f7c60d3e7b8a 13 * http://www.apache.org/licenses/LICENSE-2.0
maclobdell 0:f7c60d3e7b8a 14 *
maclobdell 0:f7c60d3e7b8a 15 * Unless required by applicable law or agreed to in writing, software
maclobdell 0:f7c60d3e7b8a 16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
maclobdell 0:f7c60d3e7b8a 17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
maclobdell 0:f7c60d3e7b8a 18 * See the License for the specific language governing permissions and
maclobdell 0:f7c60d3e7b8a 19 * limitations under the License.
maclobdell 0:f7c60d3e7b8a 20 *
maclobdell 0:f7c60d3e7b8a 21 * This file is part of mbed TLS (https://tls.mbed.org)
maclobdell 0:f7c60d3e7b8a 22 */
maclobdell 0:f7c60d3e7b8a 23 #ifndef MBEDTLS_MD2_H
maclobdell 0:f7c60d3e7b8a 24 #define MBEDTLS_MD2_H
maclobdell 0:f7c60d3e7b8a 25
maclobdell 0:f7c60d3e7b8a 26 #if !defined(MBEDTLS_CONFIG_FILE)
maclobdell 0:f7c60d3e7b8a 27 #include "config.h"
maclobdell 0:f7c60d3e7b8a 28 #else
maclobdell 0:f7c60d3e7b8a 29 #include MBEDTLS_CONFIG_FILE
maclobdell 0:f7c60d3e7b8a 30 #endif
maclobdell 0:f7c60d3e7b8a 31
maclobdell 0:f7c60d3e7b8a 32 #include <stddef.h>
maclobdell 0:f7c60d3e7b8a 33
maclobdell 0:f7c60d3e7b8a 34 #if !defined(MBEDTLS_MD2_ALT)
maclobdell 0:f7c60d3e7b8a 35 // Regular implementation
maclobdell 0:f7c60d3e7b8a 36 //
maclobdell 0:f7c60d3e7b8a 37
maclobdell 0:f7c60d3e7b8a 38 #ifdef __cplusplus
maclobdell 0:f7c60d3e7b8a 39 extern "C" {
maclobdell 0:f7c60d3e7b8a 40 #endif
maclobdell 0:f7c60d3e7b8a 41
maclobdell 0:f7c60d3e7b8a 42 /**
maclobdell 0:f7c60d3e7b8a 43 * \brief MD2 context structure
maclobdell 0:f7c60d3e7b8a 44 */
maclobdell 0:f7c60d3e7b8a 45 typedef struct
maclobdell 0:f7c60d3e7b8a 46 {
maclobdell 0:f7c60d3e7b8a 47 unsigned char cksum[16]; /*!< checksum of the data block */
maclobdell 0:f7c60d3e7b8a 48 unsigned char state[48]; /*!< intermediate digest state */
maclobdell 0:f7c60d3e7b8a 49 unsigned char buffer[16]; /*!< data block being processed */
maclobdell 0:f7c60d3e7b8a 50 size_t left; /*!< amount of data in buffer */
maclobdell 0:f7c60d3e7b8a 51 }
maclobdell 0:f7c60d3e7b8a 52 mbedtls_md2_context;
maclobdell 0:f7c60d3e7b8a 53
maclobdell 0:f7c60d3e7b8a 54 /**
maclobdell 0:f7c60d3e7b8a 55 * \brief Initialize MD2 context
maclobdell 0:f7c60d3e7b8a 56 *
maclobdell 0:f7c60d3e7b8a 57 * \param ctx MD2 context to be initialized
maclobdell 0:f7c60d3e7b8a 58 */
maclobdell 0:f7c60d3e7b8a 59 void mbedtls_md2_init( mbedtls_md2_context *ctx );
maclobdell 0:f7c60d3e7b8a 60
maclobdell 0:f7c60d3e7b8a 61 /**
maclobdell 0:f7c60d3e7b8a 62 * \brief Clear MD2 context
maclobdell 0:f7c60d3e7b8a 63 *
maclobdell 0:f7c60d3e7b8a 64 * \param ctx MD2 context to be cleared
maclobdell 0:f7c60d3e7b8a 65 */
maclobdell 0:f7c60d3e7b8a 66 void mbedtls_md2_free( mbedtls_md2_context *ctx );
maclobdell 0:f7c60d3e7b8a 67
maclobdell 0:f7c60d3e7b8a 68 /**
maclobdell 0:f7c60d3e7b8a 69 * \brief Clone (the state of) an MD2 context
maclobdell 0:f7c60d3e7b8a 70 *
maclobdell 0:f7c60d3e7b8a 71 * \param dst The destination context
maclobdell 0:f7c60d3e7b8a 72 * \param src The context to be cloned
maclobdell 0:f7c60d3e7b8a 73 */
maclobdell 0:f7c60d3e7b8a 74 void mbedtls_md2_clone( mbedtls_md2_context *dst,
maclobdell 0:f7c60d3e7b8a 75 const mbedtls_md2_context *src );
maclobdell 0:f7c60d3e7b8a 76
maclobdell 0:f7c60d3e7b8a 77 /**
maclobdell 0:f7c60d3e7b8a 78 * \brief MD2 context setup
maclobdell 0:f7c60d3e7b8a 79 *
maclobdell 0:f7c60d3e7b8a 80 * \param ctx context to be initialized
maclobdell 0:f7c60d3e7b8a 81 */
maclobdell 0:f7c60d3e7b8a 82 void mbedtls_md2_starts( mbedtls_md2_context *ctx );
maclobdell 0:f7c60d3e7b8a 83
maclobdell 0:f7c60d3e7b8a 84 /**
maclobdell 0:f7c60d3e7b8a 85 * \brief MD2 process buffer
maclobdell 0:f7c60d3e7b8a 86 *
maclobdell 0:f7c60d3e7b8a 87 * \param ctx MD2 context
maclobdell 0:f7c60d3e7b8a 88 * \param input buffer holding the data
maclobdell 0:f7c60d3e7b8a 89 * \param ilen length of the input data
maclobdell 0:f7c60d3e7b8a 90 */
maclobdell 0:f7c60d3e7b8a 91 void mbedtls_md2_update( mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen );
maclobdell 0:f7c60d3e7b8a 92
maclobdell 0:f7c60d3e7b8a 93 /**
maclobdell 0:f7c60d3e7b8a 94 * \brief MD2 final digest
maclobdell 0:f7c60d3e7b8a 95 *
maclobdell 0:f7c60d3e7b8a 96 * \param ctx MD2 context
maclobdell 0:f7c60d3e7b8a 97 * \param output MD2 checksum result
maclobdell 0:f7c60d3e7b8a 98 */
maclobdell 0:f7c60d3e7b8a 99 void mbedtls_md2_finish( mbedtls_md2_context *ctx, unsigned char output[16] );
maclobdell 0:f7c60d3e7b8a 100
maclobdell 0:f7c60d3e7b8a 101 #ifdef __cplusplus
maclobdell 0:f7c60d3e7b8a 102 }
maclobdell 0:f7c60d3e7b8a 103 #endif
maclobdell 0:f7c60d3e7b8a 104
maclobdell 0:f7c60d3e7b8a 105 #else /* MBEDTLS_MD2_ALT */
maclobdell 0:f7c60d3e7b8a 106 #include "md2_alt.h"
maclobdell 0:f7c60d3e7b8a 107 #endif /* MBEDTLS_MD2_ALT */
maclobdell 0:f7c60d3e7b8a 108
maclobdell 0:f7c60d3e7b8a 109 #ifdef __cplusplus
maclobdell 0:f7c60d3e7b8a 110 extern "C" {
maclobdell 0:f7c60d3e7b8a 111 #endif
maclobdell 0:f7c60d3e7b8a 112
maclobdell 0:f7c60d3e7b8a 113 /**
maclobdell 0:f7c60d3e7b8a 114 * \brief Output = MD2( input buffer )
maclobdell 0:f7c60d3e7b8a 115 *
maclobdell 0:f7c60d3e7b8a 116 * \param input buffer holding the data
maclobdell 0:f7c60d3e7b8a 117 * \param ilen length of the input data
maclobdell 0:f7c60d3e7b8a 118 * \param output MD2 checksum result
maclobdell 0:f7c60d3e7b8a 119 */
maclobdell 0:f7c60d3e7b8a 120 void mbedtls_md2( const unsigned char *input, size_t ilen, unsigned char output[16] );
maclobdell 0:f7c60d3e7b8a 121
maclobdell 0:f7c60d3e7b8a 122 /**
maclobdell 0:f7c60d3e7b8a 123 * \brief Checkup routine
maclobdell 0:f7c60d3e7b8a 124 *
maclobdell 0:f7c60d3e7b8a 125 * \return 0 if successful, or 1 if the test failed
maclobdell 0:f7c60d3e7b8a 126 */
maclobdell 0:f7c60d3e7b8a 127 int mbedtls_md2_self_test( int verbose );
maclobdell 0:f7c60d3e7b8a 128
maclobdell 0:f7c60d3e7b8a 129 /* Internal use */
maclobdell 0:f7c60d3e7b8a 130 void mbedtls_md2_process( mbedtls_md2_context *ctx );
maclobdell 0:f7c60d3e7b8a 131
maclobdell 0:f7c60d3e7b8a 132 #ifdef __cplusplus
maclobdell 0:f7c60d3e7b8a 133 }
maclobdell 0:f7c60d3e7b8a 134 #endif
maclobdell 0:f7c60d3e7b8a 135
maclobdell 0:f7c60d3e7b8a 136 #endif /* mbedtls_md2.h */