Class providing some mathematical functions needed for AES.
More...
#include <aesMath.h>
Class providing some mathematical functions needed for AES.
- Authors
- Philipp Karg (phili.nosp@m.pp.k.nosp@m.arg@t.nosp@m.um.d.nosp@m.e)
- Date
- 02.07.2022
- Copyright
- Philipp Karg 2022
◆ ffMul()
static uint8_t AESMath::ffMul |
( |
uint8_t |
x, |
|
|
uint8_t |
y |
|
) |
| |
|
static |
Multiply x
and y
in GF(2^8) Implemented after https://en.wikipedia.org/wiki/Finite_field_arithmetic.
- Parameters
-
[in] | x | (uint8_t): Left parameter to multiply. |
[in] | y | (uint8_t): Right parameter to multiply. |
- Returns
- (uint8_t): The result of the Finite-Field multiplication.
◆ reverseArray()
static void AESMath::reverseArray |
( |
uint8_t |
arr[], |
|
|
uint8_t |
low, |
|
|
uint8_t |
high |
|
) |
| |
|
static |
Reverse an array by swapping the lowest and highest element.
- Parameters
-
[in,out] | arr | (uint8_t[]): Array to reverse. |
[in] | low | (uint8_t): Index of the lowest element. |
[in] | high | (uint8_t): Index of the highest element. |
◆ rightRotateArray()
static void AESMath::rightRotateArray |
( |
uint8_t |
arr[], |
|
|
uint8_t |
n, |
|
|
uint8_t |
k |
|
) |
| |
|
static |
Rotate an array arr
of length n
by k
to the right.
- Parameters
-
[in] | arr | (uint8_t*): Array to rotate. |
[in] | n | (uint8_t): Length of the array. |
[in] | k | (uint8_t): Amount to rotate. |
◆ swap()
static void AESMath::swap |
( |
uint8_t & |
a, |
|
|
uint8_t & |
b |
|
) |
| |
|
static |
Swap the values of 2 integers.
- Parameters
-
[in,out] | a | (uint8_t): First element to swap. |
[in,out] | b | (uint8_t): Second element to swap. |
The documentation for this class was generated from the following file: