Roy Want / Mbed OS beaconCompileReadyFork
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers aes_eax.h Source File

aes_eax.h

00001 #if !defined(AES_EAX_H__INCLUDED__)
00002 #define AES_EAX_H__INCLUDED__
00003 
00004 #define MBEDTLS_CIPHER_MODE_CBC
00005 /*
00006  * Copyright (c) 2016, Google Inc, All Rights Reserved
00007  * SPDX-License-Identifier: Apache-2.0
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00010  * not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  * http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00017  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021  
00022 #define MBEDTLS_CIPHER_MODE_CTR
00023 #include "mbedtls/aes.h"
00024 
00025 int compute_cmac_( mbedtls_aes_context *ctx,
00026                   const unsigned char *input,
00027                   size_t length,
00028                   unsigned char param,
00029                   unsigned char mac[16] );
00030                   
00031 void gf128_double_( unsigned char val[16] );   
00032 
00033 int eddy_aes_authcrypt_eax( mbedtls_aes_context *ctx,
00034                             int mode,                       /* ENCRYPT/DECRYPT */
00035                             const unsigned char *nonce,     /* 48-bit nonce */ 
00036                             size_t nonce_length,            /* = 6 */
00037                             const unsigned char *header,    /* Empty buffer */
00038                             size_t header_length,           /* = 0 */
00039                             size_t message_length,          /* Length of input & output buffers 12 */
00040                             const unsigned char *input,
00041                             unsigned char *output,
00042                             unsigned char *tag,
00043                             size_t tag_length );            /* = 2 */
00044                             
00045                         
00046 
00047 #endif /* defined(AES_EAX_H__INCLUDED__) */