Add an xtime implementation

This commit is contained in:
Manuel Thalmann 2023-11-08 22:27:12 +01:00
parent 87f3102a45
commit b3c10424a4

View file

@ -100,7 +100,16 @@ void shiftRows(t_state s) {
} }
uint8_t xtime(uint8_t a) { uint8_t xtime(uint8_t a) {
return 0; /* ??? */ uint8_t mask;
if (a & 0b10000000) {
mask = 0x1B;
}
else {
mask = 0x00;
}
return ((a << 1) ^ mask) & 0xFF;
} }
// not mandatory - mix a single column // not mandatory - mix a single column