1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2024 Ulvetanna Inc.

use super::packed::{impl_broadcast, PackedPrimitiveType};
use crate::{
	arch::{PairwiseStrategy, PairwiseTableStrategy},
	arithmetic_traits::{
		impl_invert_with, impl_mul_alpha_with, impl_mul_with, impl_square_with,
		impl_transformation_with_strategy,
	},
	AESTowerField8b,
};

// Define 16 bit packed field types
pub type PackedAESBinaryField1x8b = PackedPrimitiveType<u8, AESTowerField8b>;

// Define broadcast
impl_broadcast!(u8, AESTowerField8b);

// Define multiplication
impl_mul_with!(PackedAESBinaryField1x8b @ PairwiseTableStrategy);

// Define square
impl_square_with!(PackedAESBinaryField1x8b @ PairwiseTableStrategy);

// Define invert
impl_invert_with!(PackedAESBinaryField1x8b @ PairwiseTableStrategy);

// Define multiply by alpha
impl_mul_alpha_with!(PackedAESBinaryField1x8b @ PairwiseTableStrategy);

// Define linear transformations
impl_transformation_with_strategy!(PackedAESBinaryField1x8b, PairwiseStrategy);