Avnet / WNCInterface

Dependencies:   WncControllerK64F

Dependents:   WNCProximityMqtt Pubnub_ATT_IoT_SK_WNC_sync BluemixDemo BluemixQS ... more

See the WNCInterface README in the Wiki tab for detailed information on this library.

Committer:
JMF
Date:
Tue Nov 01 14:22:56 2016 +0000
Revision:
12:0071cb144c7a
Adding mbedtls files

Who changed what in which revision?

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