Aorimn | b053658 | 2016-01-31 12:08:23 +0100 | [diff] [blame] | 1 | /** |
| 2 | * \file gf128mul.h |
| 3 | * |
| 4 | * \brief Fast multiplication in GF(128) |
| 5 | * |
| 6 | * Copyright (C) 2006-2015, 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 | #ifndef MBEDTLS_GF128MUL_H |
| 24 | #define MBEDTLS_GF128MUL_H |
| 25 | |
| 26 | #ifdef __cplusplus |
| 27 | extern "C" { |
| 28 | #endif |
| 29 | |
| 30 | /** |
| 31 | * \brief Big-Endian definition for 128 bits elements |
| 32 | */ |
Aorimn | 9bbe363 | 2016-01-31 13:16:30 +0100 | [diff] [blame] | 33 | typedef unsigned char mbedtls_be128[16]; |
Aorimn | b053658 | 2016-01-31 12:08:23 +0100 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * \brief Multiplication in GF(128): |
| 37 | * r = x times x^4 times x^8 in GF(2^128) |
| 38 | * |
| 39 | * \param x the 128-bits number you want to multiply |
| 40 | * \param r result |
| 41 | */ |
Aorimn | 9bbe363 | 2016-01-31 13:16:30 +0100 | [diff] [blame] | 42 | void mbedtls_gf128mul_x_ble(mbedtls_be128 r, const mbedtls_be128 x); |
Aorimn | b053658 | 2016-01-31 12:08:23 +0100 | [diff] [blame] | 43 | |
| 44 | |
| 45 | |
| 46 | #endif /* gf128mul.h */ |