Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
source/aes_eax.h@0:1c7da5f83647, 2016-11-29 (annotated)
- Committer:
- sarahmarshy
- Date:
- Tue Nov 29 06:29:10 2016 +0000
- Revision:
- 0:1c7da5f83647
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sarahmarshy | 0:1c7da5f83647 | 1 | #if !defined(AES_EAX_H__INCLUDED__) |
| sarahmarshy | 0:1c7da5f83647 | 2 | #define AES_EAX_H__INCLUDED__ |
| sarahmarshy | 0:1c7da5f83647 | 3 | |
| sarahmarshy | 0:1c7da5f83647 | 4 | #define MBEDTLS_CIPHER_MODE_CBC |
| sarahmarshy | 0:1c7da5f83647 | 5 | /* |
| sarahmarshy | 0:1c7da5f83647 | 6 | * Copyright (c) 2016, Google Inc, All Rights Reserved |
| sarahmarshy | 0:1c7da5f83647 | 7 | * SPDX-License-Identifier: Apache-2.0 |
| sarahmarshy | 0:1c7da5f83647 | 8 | * |
| sarahmarshy | 0:1c7da5f83647 | 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| sarahmarshy | 0:1c7da5f83647 | 10 | * not use this file except in compliance with the License. |
| sarahmarshy | 0:1c7da5f83647 | 11 | * You may obtain a copy of the License at |
| sarahmarshy | 0:1c7da5f83647 | 12 | * |
| sarahmarshy | 0:1c7da5f83647 | 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
| sarahmarshy | 0:1c7da5f83647 | 14 | * |
| sarahmarshy | 0:1c7da5f83647 | 15 | * Unless required by applicable law or agreed to in writing, software |
| sarahmarshy | 0:1c7da5f83647 | 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| sarahmarshy | 0:1c7da5f83647 | 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| sarahmarshy | 0:1c7da5f83647 | 18 | * See the License for the specific language governing permissions and |
| sarahmarshy | 0:1c7da5f83647 | 19 | * limitations under the License. |
| sarahmarshy | 0:1c7da5f83647 | 20 | */ |
| sarahmarshy | 0:1c7da5f83647 | 21 | |
| sarahmarshy | 0:1c7da5f83647 | 22 | #define MBEDTLS_CIPHER_MODE_CTR |
| sarahmarshy | 0:1c7da5f83647 | 23 | #include "mbedtls/aes.h" |
| sarahmarshy | 0:1c7da5f83647 | 24 | |
| sarahmarshy | 0:1c7da5f83647 | 25 | int compute_cmac_( mbedtls_aes_context *ctx, |
| sarahmarshy | 0:1c7da5f83647 | 26 | const unsigned char *input, |
| sarahmarshy | 0:1c7da5f83647 | 27 | size_t length, |
| sarahmarshy | 0:1c7da5f83647 | 28 | unsigned char param, |
| sarahmarshy | 0:1c7da5f83647 | 29 | unsigned char mac[16] ); |
| sarahmarshy | 0:1c7da5f83647 | 30 | |
| sarahmarshy | 0:1c7da5f83647 | 31 | void gf128_double_( unsigned char val[16] ); |
| sarahmarshy | 0:1c7da5f83647 | 32 | |
| sarahmarshy | 0:1c7da5f83647 | 33 | int eddy_aes_authcrypt_eax( mbedtls_aes_context *ctx, |
| sarahmarshy | 0:1c7da5f83647 | 34 | int mode, /* ENCRYPT/DECRYPT */ |
| sarahmarshy | 0:1c7da5f83647 | 35 | const unsigned char *nonce, /* 48-bit nonce */ |
| sarahmarshy | 0:1c7da5f83647 | 36 | size_t nonce_length, /* = 6 */ |
| sarahmarshy | 0:1c7da5f83647 | 37 | const unsigned char *header, /* Empty buffer */ |
| sarahmarshy | 0:1c7da5f83647 | 38 | size_t header_length, /* = 0 */ |
| sarahmarshy | 0:1c7da5f83647 | 39 | size_t message_length, /* Length of input & output buffers 12 */ |
| sarahmarshy | 0:1c7da5f83647 | 40 | const unsigned char *input, |
| sarahmarshy | 0:1c7da5f83647 | 41 | unsigned char *output, |
| sarahmarshy | 0:1c7da5f83647 | 42 | unsigned char *tag, |
| sarahmarshy | 0:1c7da5f83647 | 43 | size_t tag_length ); /* = 2 */ |
| sarahmarshy | 0:1c7da5f83647 | 44 | |
| sarahmarshy | 0:1c7da5f83647 | 45 | |
| sarahmarshy | 0:1c7da5f83647 | 46 | |
| sarahmarshy | 0:1c7da5f83647 | 47 | #endif /* defined(AES_EAX_H__INCLUDED__) */ |