exo2: fix bugs in Cmac and DeviceId calculation

This commit is contained in:
Michael Scire authored and SciresM committed 2020-06-14 22:07:45 -07:00
1 parent bb3a8a888f
commit a0b08d0540
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -181,7 +181,7 @@ namespace ams::se {
u8 prev = 0;
for (int i = AesBlockSize - 1; i >= 0; --i) {
const u8 top = (subkey[i] >> 7);
subkey[i] = ((subkey[i] << 1) | top);
subkey[i] = ((subkey[i] << 1) | prev);
prev = top;
}
@@ -220,7 +220,7 @@ namespace ams::se {
ExpandSubkey(subkey);
/* Account for last block. */
if (last_block_size) {
if (last_block_size != AesBlockSize) {
ExpandSubkey(subkey);
}
}