The WDCInterface is is a drop-in replacement for an EthernetInterface class that allows the user to connect to the Internet with a Wistron NeWeb Corporation (WNC) M14A2A Series data module using the standard network Socket API's. This interface class is used in the AT&T Cellular IoT Starter Kit which is sold by Avnet (http://cloudconnectkits.org/product/att-cellular-iot-starter-kit).
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.
mbedtls/source/xtea.c@12:0071cb144c7a, 2016-11-01 (annotated)
- Committer:
- JMF
- Date:
- Tue Nov 01 14:22:56 2016 +0000
- Revision:
- 12:0071cb144c7a
Adding mbedtls files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JMF | 12:0071cb144c7a | 1 | /* |
JMF | 12:0071cb144c7a | 2 | * An 32-bit implementation of the XTEA algorithm |
JMF | 12:0071cb144c7a | 3 | * |
JMF | 12:0071cb144c7a | 4 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
JMF | 12:0071cb144c7a | 5 | * SPDX-License-Identifier: Apache-2.0 |
JMF | 12:0071cb144c7a | 6 | * |
JMF | 12:0071cb144c7a | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
JMF | 12:0071cb144c7a | 8 | * not use this file except in compliance with the License. |
JMF | 12:0071cb144c7a | 9 | * You may obtain a copy of the License at |
JMF | 12:0071cb144c7a | 10 | * |
JMF | 12:0071cb144c7a | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
JMF | 12:0071cb144c7a | 12 | * |
JMF | 12:0071cb144c7a | 13 | * Unless required by applicable law or agreed to in writing, software |
JMF | 12:0071cb144c7a | 14 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
JMF | 12:0071cb144c7a | 15 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
JMF | 12:0071cb144c7a | 16 | * See the License for the specific language governing permissions and |
JMF | 12:0071cb144c7a | 17 | * limitations under the License. |
JMF | 12:0071cb144c7a | 18 | * |
JMF | 12:0071cb144c7a | 19 | * This file is part of mbed TLS (https://tls.mbed.org) |
JMF | 12:0071cb144c7a | 20 | */ |
JMF | 12:0071cb144c7a | 21 | |
JMF | 12:0071cb144c7a | 22 | #if !defined(MBEDTLS_CONFIG_FILE) |
JMF | 12:0071cb144c7a | 23 | #include "mbedtls/config.h" |
JMF | 12:0071cb144c7a | 24 | #else |
JMF | 12:0071cb144c7a | 25 | #include MBEDTLS_CONFIG_FILE |
JMF | 12:0071cb144c7a | 26 | #endif |
JMF | 12:0071cb144c7a | 27 | |
JMF | 12:0071cb144c7a | 28 | #if defined(MBEDTLS_XTEA_C) |
JMF | 12:0071cb144c7a | 29 | |
JMF | 12:0071cb144c7a | 30 | #include "mbedtls/xtea.h" |
JMF | 12:0071cb144c7a | 31 | |
JMF | 12:0071cb144c7a | 32 | #include <string.h> |
JMF | 12:0071cb144c7a | 33 | |
JMF | 12:0071cb144c7a | 34 | #if defined(MBEDTLS_SELF_TEST) |
JMF | 12:0071cb144c7a | 35 | #if defined(MBEDTLS_PLATFORM_C) |
JMF | 12:0071cb144c7a | 36 | #include "mbedtls/platform.h" |
JMF | 12:0071cb144c7a | 37 | #else |
JMF | 12:0071cb144c7a | 38 | #include <stdio.h> |
JMF | 12:0071cb144c7a | 39 | #define mbedtls_printf printf |
JMF | 12:0071cb144c7a | 40 | #endif /* MBEDTLS_PLATFORM_C */ |
JMF | 12:0071cb144c7a | 41 | #endif /* MBEDTLS_SELF_TEST */ |
JMF | 12:0071cb144c7a | 42 | |
JMF | 12:0071cb144c7a | 43 | #if !defined(MBEDTLS_XTEA_ALT) |
JMF | 12:0071cb144c7a | 44 | |
JMF | 12:0071cb144c7a | 45 | /* Implementation that should never be optimized out by the compiler */ |
JMF | 12:0071cb144c7a | 46 | static void mbedtls_zeroize( void *v, size_t n ) { |
JMF | 12:0071cb144c7a | 47 | volatile unsigned char *p = v; while( n-- ) *p++ = 0; |
JMF | 12:0071cb144c7a | 48 | } |
JMF | 12:0071cb144c7a | 49 | |
JMF | 12:0071cb144c7a | 50 | /* |
JMF | 12:0071cb144c7a | 51 | * 32-bit integer manipulation macros (big endian) |
JMF | 12:0071cb144c7a | 52 | */ |
JMF | 12:0071cb144c7a | 53 | #ifndef GET_UINT32_BE |
JMF | 12:0071cb144c7a | 54 | #define GET_UINT32_BE(n,b,i) \ |
JMF | 12:0071cb144c7a | 55 | { \ |
JMF | 12:0071cb144c7a | 56 | (n) = ( (uint32_t) (b)[(i) ] << 24 ) \ |
JMF | 12:0071cb144c7a | 57 | | ( (uint32_t) (b)[(i) + 1] << 16 ) \ |
JMF | 12:0071cb144c7a | 58 | | ( (uint32_t) (b)[(i) + 2] << 8 ) \ |
JMF | 12:0071cb144c7a | 59 | | ( (uint32_t) (b)[(i) + 3] ); \ |
JMF | 12:0071cb144c7a | 60 | } |
JMF | 12:0071cb144c7a | 61 | #endif |
JMF | 12:0071cb144c7a | 62 | |
JMF | 12:0071cb144c7a | 63 | #ifndef PUT_UINT32_BE |
JMF | 12:0071cb144c7a | 64 | #define PUT_UINT32_BE(n,b,i) \ |
JMF | 12:0071cb144c7a | 65 | { \ |
JMF | 12:0071cb144c7a | 66 | (b)[(i) ] = (unsigned char) ( (n) >> 24 ); \ |
JMF | 12:0071cb144c7a | 67 | (b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \ |
JMF | 12:0071cb144c7a | 68 | (b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \ |
JMF | 12:0071cb144c7a | 69 | (b)[(i) + 3] = (unsigned char) ( (n) ); \ |
JMF | 12:0071cb144c7a | 70 | } |
JMF | 12:0071cb144c7a | 71 | #endif |
JMF | 12:0071cb144c7a | 72 | |
JMF | 12:0071cb144c7a | 73 | void mbedtls_xtea_init( mbedtls_xtea_context *ctx ) |
JMF | 12:0071cb144c7a | 74 | { |
JMF | 12:0071cb144c7a | 75 | memset( ctx, 0, sizeof( mbedtls_xtea_context ) ); |
JMF | 12:0071cb144c7a | 76 | } |
JMF | 12:0071cb144c7a | 77 | |
JMF | 12:0071cb144c7a | 78 | void mbedtls_xtea_free( mbedtls_xtea_context *ctx ) |
JMF | 12:0071cb144c7a | 79 | { |
JMF | 12:0071cb144c7a | 80 | if( ctx == NULL ) |
JMF | 12:0071cb144c7a | 81 | return; |
JMF | 12:0071cb144c7a | 82 | |
JMF | 12:0071cb144c7a | 83 | mbedtls_zeroize( ctx, sizeof( mbedtls_xtea_context ) ); |
JMF | 12:0071cb144c7a | 84 | } |
JMF | 12:0071cb144c7a | 85 | |
JMF | 12:0071cb144c7a | 86 | /* |
JMF | 12:0071cb144c7a | 87 | * XTEA key schedule |
JMF | 12:0071cb144c7a | 88 | */ |
JMF | 12:0071cb144c7a | 89 | void mbedtls_xtea_setup( mbedtls_xtea_context *ctx, const unsigned char key[16] ) |
JMF | 12:0071cb144c7a | 90 | { |
JMF | 12:0071cb144c7a | 91 | int i; |
JMF | 12:0071cb144c7a | 92 | |
JMF | 12:0071cb144c7a | 93 | memset( ctx, 0, sizeof(mbedtls_xtea_context) ); |
JMF | 12:0071cb144c7a | 94 | |
JMF | 12:0071cb144c7a | 95 | for( i = 0; i < 4; i++ ) |
JMF | 12:0071cb144c7a | 96 | { |
JMF | 12:0071cb144c7a | 97 | GET_UINT32_BE( ctx->k[i], key, i << 2 ); |
JMF | 12:0071cb144c7a | 98 | } |
JMF | 12:0071cb144c7a | 99 | } |
JMF | 12:0071cb144c7a | 100 | |
JMF | 12:0071cb144c7a | 101 | /* |
JMF | 12:0071cb144c7a | 102 | * XTEA encrypt function |
JMF | 12:0071cb144c7a | 103 | */ |
JMF | 12:0071cb144c7a | 104 | int mbedtls_xtea_crypt_ecb( mbedtls_xtea_context *ctx, int mode, |
JMF | 12:0071cb144c7a | 105 | const unsigned char input[8], unsigned char output[8]) |
JMF | 12:0071cb144c7a | 106 | { |
JMF | 12:0071cb144c7a | 107 | uint32_t *k, v0, v1, i; |
JMF | 12:0071cb144c7a | 108 | |
JMF | 12:0071cb144c7a | 109 | k = ctx->k; |
JMF | 12:0071cb144c7a | 110 | |
JMF | 12:0071cb144c7a | 111 | GET_UINT32_BE( v0, input, 0 ); |
JMF | 12:0071cb144c7a | 112 | GET_UINT32_BE( v1, input, 4 ); |
JMF | 12:0071cb144c7a | 113 | |
JMF | 12:0071cb144c7a | 114 | if( mode == MBEDTLS_XTEA_ENCRYPT ) |
JMF | 12:0071cb144c7a | 115 | { |
JMF | 12:0071cb144c7a | 116 | uint32_t sum = 0, delta = 0x9E3779B9; |
JMF | 12:0071cb144c7a | 117 | |
JMF | 12:0071cb144c7a | 118 | for( i = 0; i < 32; i++ ) |
JMF | 12:0071cb144c7a | 119 | { |
JMF | 12:0071cb144c7a | 120 | v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + k[sum & 3]); |
JMF | 12:0071cb144c7a | 121 | sum += delta; |
JMF | 12:0071cb144c7a | 122 | v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + k[(sum>>11) & 3]); |
JMF | 12:0071cb144c7a | 123 | } |
JMF | 12:0071cb144c7a | 124 | } |
JMF | 12:0071cb144c7a | 125 | else /* MBEDTLS_XTEA_DECRYPT */ |
JMF | 12:0071cb144c7a | 126 | { |
JMF | 12:0071cb144c7a | 127 | uint32_t delta = 0x9E3779B9, sum = delta * 32; |
JMF | 12:0071cb144c7a | 128 | |
JMF | 12:0071cb144c7a | 129 | for( i = 0; i < 32; i++ ) |
JMF | 12:0071cb144c7a | 130 | { |
JMF | 12:0071cb144c7a | 131 | v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + k[(sum>>11) & 3]); |
JMF | 12:0071cb144c7a | 132 | sum -= delta; |
JMF | 12:0071cb144c7a | 133 | v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + k[sum & 3]); |
JMF | 12:0071cb144c7a | 134 | } |
JMF | 12:0071cb144c7a | 135 | } |
JMF | 12:0071cb144c7a | 136 | |
JMF | 12:0071cb144c7a | 137 | PUT_UINT32_BE( v0, output, 0 ); |
JMF | 12:0071cb144c7a | 138 | PUT_UINT32_BE( v1, output, 4 ); |
JMF | 12:0071cb144c7a | 139 | |
JMF | 12:0071cb144c7a | 140 | return( 0 ); |
JMF | 12:0071cb144c7a | 141 | } |
JMF | 12:0071cb144c7a | 142 | |
JMF | 12:0071cb144c7a | 143 | #if defined(MBEDTLS_CIPHER_MODE_CBC) |
JMF | 12:0071cb144c7a | 144 | /* |
JMF | 12:0071cb144c7a | 145 | * XTEA-CBC buffer encryption/decryption |
JMF | 12:0071cb144c7a | 146 | */ |
JMF | 12:0071cb144c7a | 147 | int mbedtls_xtea_crypt_cbc( mbedtls_xtea_context *ctx, int mode, size_t length, |
JMF | 12:0071cb144c7a | 148 | unsigned char iv[8], const unsigned char *input, |
JMF | 12:0071cb144c7a | 149 | unsigned char *output) |
JMF | 12:0071cb144c7a | 150 | { |
JMF | 12:0071cb144c7a | 151 | int i; |
JMF | 12:0071cb144c7a | 152 | unsigned char temp[8]; |
JMF | 12:0071cb144c7a | 153 | |
JMF | 12:0071cb144c7a | 154 | if( length % 8 ) |
JMF | 12:0071cb144c7a | 155 | return( MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH ); |
JMF | 12:0071cb144c7a | 156 | |
JMF | 12:0071cb144c7a | 157 | if( mode == MBEDTLS_XTEA_DECRYPT ) |
JMF | 12:0071cb144c7a | 158 | { |
JMF | 12:0071cb144c7a | 159 | while( length > 0 ) |
JMF | 12:0071cb144c7a | 160 | { |
JMF | 12:0071cb144c7a | 161 | memcpy( temp, input, 8 ); |
JMF | 12:0071cb144c7a | 162 | mbedtls_xtea_crypt_ecb( ctx, mode, input, output ); |
JMF | 12:0071cb144c7a | 163 | |
JMF | 12:0071cb144c7a | 164 | for( i = 0; i < 8; i++ ) |
JMF | 12:0071cb144c7a | 165 | output[i] = (unsigned char)( output[i] ^ iv[i] ); |
JMF | 12:0071cb144c7a | 166 | |
JMF | 12:0071cb144c7a | 167 | memcpy( iv, temp, 8 ); |
JMF | 12:0071cb144c7a | 168 | |
JMF | 12:0071cb144c7a | 169 | input += 8; |
JMF | 12:0071cb144c7a | 170 | output += 8; |
JMF | 12:0071cb144c7a | 171 | length -= 8; |
JMF | 12:0071cb144c7a | 172 | } |
JMF | 12:0071cb144c7a | 173 | } |
JMF | 12:0071cb144c7a | 174 | else |
JMF | 12:0071cb144c7a | 175 | { |
JMF | 12:0071cb144c7a | 176 | while( length > 0 ) |
JMF | 12:0071cb144c7a | 177 | { |
JMF | 12:0071cb144c7a | 178 | for( i = 0; i < 8; i++ ) |
JMF | 12:0071cb144c7a | 179 | output[i] = (unsigned char)( input[i] ^ iv[i] ); |
JMF | 12:0071cb144c7a | 180 | |
JMF | 12:0071cb144c7a | 181 | mbedtls_xtea_crypt_ecb( ctx, mode, output, output ); |
JMF | 12:0071cb144c7a | 182 | memcpy( iv, output, 8 ); |
JMF | 12:0071cb144c7a | 183 | |
JMF | 12:0071cb144c7a | 184 | input += 8; |
JMF | 12:0071cb144c7a | 185 | output += 8; |
JMF | 12:0071cb144c7a | 186 | length -= 8; |
JMF | 12:0071cb144c7a | 187 | } |
JMF | 12:0071cb144c7a | 188 | } |
JMF | 12:0071cb144c7a | 189 | |
JMF | 12:0071cb144c7a | 190 | return( 0 ); |
JMF | 12:0071cb144c7a | 191 | } |
JMF | 12:0071cb144c7a | 192 | #endif /* MBEDTLS_CIPHER_MODE_CBC */ |
JMF | 12:0071cb144c7a | 193 | #endif /* !MBEDTLS_XTEA_ALT */ |
JMF | 12:0071cb144c7a | 194 | |
JMF | 12:0071cb144c7a | 195 | #if defined(MBEDTLS_SELF_TEST) |
JMF | 12:0071cb144c7a | 196 | |
JMF | 12:0071cb144c7a | 197 | /* |
JMF | 12:0071cb144c7a | 198 | * XTEA tests vectors (non-official) |
JMF | 12:0071cb144c7a | 199 | */ |
JMF | 12:0071cb144c7a | 200 | |
JMF | 12:0071cb144c7a | 201 | static const unsigned char xtea_test_key[6][16] = |
JMF | 12:0071cb144c7a | 202 | { |
JMF | 12:0071cb144c7a | 203 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, |
JMF | 12:0071cb144c7a | 204 | 0x0c, 0x0d, 0x0e, 0x0f }, |
JMF | 12:0071cb144c7a | 205 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, |
JMF | 12:0071cb144c7a | 206 | 0x0c, 0x0d, 0x0e, 0x0f }, |
JMF | 12:0071cb144c7a | 207 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, |
JMF | 12:0071cb144c7a | 208 | 0x0c, 0x0d, 0x0e, 0x0f }, |
JMF | 12:0071cb144c7a | 209 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
JMF | 12:0071cb144c7a | 210 | 0x00, 0x00, 0x00, 0x00 }, |
JMF | 12:0071cb144c7a | 211 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
JMF | 12:0071cb144c7a | 212 | 0x00, 0x00, 0x00, 0x00 }, |
JMF | 12:0071cb144c7a | 213 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
JMF | 12:0071cb144c7a | 214 | 0x00, 0x00, 0x00, 0x00 } |
JMF | 12:0071cb144c7a | 215 | }; |
JMF | 12:0071cb144c7a | 216 | |
JMF | 12:0071cb144c7a | 217 | static const unsigned char xtea_test_pt[6][8] = |
JMF | 12:0071cb144c7a | 218 | { |
JMF | 12:0071cb144c7a | 219 | { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 }, |
JMF | 12:0071cb144c7a | 220 | { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }, |
JMF | 12:0071cb144c7a | 221 | { 0x5a, 0x5b, 0x6e, 0x27, 0x89, 0x48, 0xd7, 0x7f }, |
JMF | 12:0071cb144c7a | 222 | { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48 }, |
JMF | 12:0071cb144c7a | 223 | { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }, |
JMF | 12:0071cb144c7a | 224 | { 0x70, 0xe1, 0x22, 0x5d, 0x6e, 0x4e, 0x76, 0x55 } |
JMF | 12:0071cb144c7a | 225 | }; |
JMF | 12:0071cb144c7a | 226 | |
JMF | 12:0071cb144c7a | 227 | static const unsigned char xtea_test_ct[6][8] = |
JMF | 12:0071cb144c7a | 228 | { |
JMF | 12:0071cb144c7a | 229 | { 0x49, 0x7d, 0xf3, 0xd0, 0x72, 0x61, 0x2c, 0xb5 }, |
JMF | 12:0071cb144c7a | 230 | { 0xe7, 0x8f, 0x2d, 0x13, 0x74, 0x43, 0x41, 0xd8 }, |
JMF | 12:0071cb144c7a | 231 | { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 }, |
JMF | 12:0071cb144c7a | 232 | { 0xa0, 0x39, 0x05, 0x89, 0xf8, 0xb8, 0xef, 0xa5 }, |
JMF | 12:0071cb144c7a | 233 | { 0xed, 0x23, 0x37, 0x5a, 0x82, 0x1a, 0x8c, 0x2d }, |
JMF | 12:0071cb144c7a | 234 | { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 } |
JMF | 12:0071cb144c7a | 235 | }; |
JMF | 12:0071cb144c7a | 236 | |
JMF | 12:0071cb144c7a | 237 | /* |
JMF | 12:0071cb144c7a | 238 | * Checkup routine |
JMF | 12:0071cb144c7a | 239 | */ |
JMF | 12:0071cb144c7a | 240 | int mbedtls_xtea_self_test( int verbose ) |
JMF | 12:0071cb144c7a | 241 | { |
JMF | 12:0071cb144c7a | 242 | int i, ret = 0; |
JMF | 12:0071cb144c7a | 243 | unsigned char buf[8]; |
JMF | 12:0071cb144c7a | 244 | mbedtls_xtea_context ctx; |
JMF | 12:0071cb144c7a | 245 | |
JMF | 12:0071cb144c7a | 246 | mbedtls_xtea_init( &ctx ); |
JMF | 12:0071cb144c7a | 247 | for( i = 0; i < 6; i++ ) |
JMF | 12:0071cb144c7a | 248 | { |
JMF | 12:0071cb144c7a | 249 | if( verbose != 0 ) |
JMF | 12:0071cb144c7a | 250 | mbedtls_printf( " XTEA test #%d: ", i + 1 ); |
JMF | 12:0071cb144c7a | 251 | |
JMF | 12:0071cb144c7a | 252 | memcpy( buf, xtea_test_pt[i], 8 ); |
JMF | 12:0071cb144c7a | 253 | |
JMF | 12:0071cb144c7a | 254 | mbedtls_xtea_setup( &ctx, xtea_test_key[i] ); |
JMF | 12:0071cb144c7a | 255 | mbedtls_xtea_crypt_ecb( &ctx, MBEDTLS_XTEA_ENCRYPT, buf, buf ); |
JMF | 12:0071cb144c7a | 256 | |
JMF | 12:0071cb144c7a | 257 | if( memcmp( buf, xtea_test_ct[i], 8 ) != 0 ) |
JMF | 12:0071cb144c7a | 258 | { |
JMF | 12:0071cb144c7a | 259 | if( verbose != 0 ) |
JMF | 12:0071cb144c7a | 260 | mbedtls_printf( "failed\n" ); |
JMF | 12:0071cb144c7a | 261 | |
JMF | 12:0071cb144c7a | 262 | ret = 1; |
JMF | 12:0071cb144c7a | 263 | goto exit; |
JMF | 12:0071cb144c7a | 264 | } |
JMF | 12:0071cb144c7a | 265 | |
JMF | 12:0071cb144c7a | 266 | if( verbose != 0 ) |
JMF | 12:0071cb144c7a | 267 | mbedtls_printf( "passed\n" ); |
JMF | 12:0071cb144c7a | 268 | } |
JMF | 12:0071cb144c7a | 269 | |
JMF | 12:0071cb144c7a | 270 | if( verbose != 0 ) |
JMF | 12:0071cb144c7a | 271 | mbedtls_printf( "\n" ); |
JMF | 12:0071cb144c7a | 272 | |
JMF | 12:0071cb144c7a | 273 | exit: |
JMF | 12:0071cb144c7a | 274 | mbedtls_xtea_free( &ctx ); |
JMF | 12:0071cb144c7a | 275 | |
JMF | 12:0071cb144c7a | 276 | return( ret ); |
JMF | 12:0071cb144c7a | 277 | } |
JMF | 12:0071cb144c7a | 278 | |
JMF | 12:0071cb144c7a | 279 | #endif /* MBEDTLS_SELF_TEST */ |
JMF | 12:0071cb144c7a | 280 | |
JMF | 12:0071cb144c7a | 281 | #endif /* MBEDTLS_XTEA_C */ |