Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 327ea52b authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Make AES control block into a thread local variable

When computing ACES-CMAC, we use static control block that's shared
between multiple threads. That means that having computation done in
different threads can interfere and cause bad value to be returned.
This patch fixes that by making the control block into thread local
variable.

Bug: 132863815
Change-Id: Ibe2aaac54b93f77d644564d23694846c0c078bd6
parent 07a3d450
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ typedef struct {
  uint16_t round;
} tCMAC_CB;

tCMAC_CB cmac_cb;
thread_local tCMAC_CB cmac_cb;

/* Rb for AES-128 as block cipher, LSB as [0] */
Octet16 const_Rb{0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,