Markku-Juhani O. Saarinen | dfb6015 | 2017-11-20 14:58:41 +0000 | [diff] [blame^] | 1 | /** |
| 2 | * \file armv8ce_aes.h |
| 3 | * |
| 4 | * \brief ARMv8 Cryptography Extensions -- Optimized code for AES and GCM |
| 5 | * |
| 6 | * Copyright (C) 2006-2017, ARM Limited, All Rights Reserved |
| 7 | * SPDX-License-Identifier: Apache-2.0 |
| 8 | * |
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 10 | * not use this file except in compliance with the License. |
| 11 | * You may obtain a copy of the License at |
| 12 | * |
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | * |
| 15 | * Unless required by applicable law or agreed to in writing, software |
| 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | * See the License for the specific language governing permissions and |
| 19 | * limitations under the License. |
| 20 | * |
| 21 | * This file is part of mbed TLS (https://tls.mbed.org) |
| 22 | */ |
| 23 | |
| 24 | #ifndef MBEDTLS_ARMV8CE_AES_H |
| 25 | #define MBEDTLS_ARMV8CE_AES_H |
| 26 | |
| 27 | #include "aes.h" |
| 28 | |
| 29 | /** |
| 30 | * \brief [ARMv8 Crypto Extensions] AES-ECB block en(de)cryption |
| 31 | * |
| 32 | * \param ctx AES context |
| 33 | * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT |
| 34 | * \param input 16-byte input block |
| 35 | * \param output 16-byte output block |
| 36 | * |
| 37 | * \return 0 on success (cannot fail) |
| 38 | */ |
| 39 | |
| 40 | int mbedtls_armv8ce_aes_crypt_ecb( mbedtls_aes_context *ctx, |
| 41 | int mode, |
| 42 | const unsigned char input[16], |
| 43 | unsigned char output[16] ); |
| 44 | |
| 45 | /** |
| 46 | * \brief [ARMv8 Crypto Extensions] Multiply in GF(2^128) for GCM |
| 47 | * |
| 48 | * \param c Result |
| 49 | * \param a First operand |
| 50 | * \param b Second operand |
| 51 | * |
| 52 | * \note Both operands and result are bit strings interpreted as |
| 53 | * elements of GF(2^128) as per the GCM spec. |
| 54 | */ |
| 55 | |
| 56 | void mbedtls_armv8ce_gcm_mult( unsigned char c[16], |
| 57 | const unsigned char a[16], |
| 58 | const unsigned char b[16] ); |
| 59 | |
| 60 | #endif /* MBEDTLS_ARMV8CE_AES_H */ |