mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-23 02:42:09 +00:00
exo: fix SE aes-ctr usage in GetSecureData
This commit is contained in:
parent
bd6155bcb4
commit
0c41489f01
1 changed files with 13 additions and 1 deletions
|
@ -272,7 +272,19 @@ namespace ams::secmon::smc {
|
|||
|
||||
void GetSecureDataImpl(u8 *dst, SecureData which, bool tweak) {
|
||||
/* Compute the appropriate AES-CTR. */
|
||||
se::ComputeAes128Ctr(dst, AesKeySize, pkg1::AesKeySlot_Device, SecureDataSource, AesKeySize, GetSecureDataCounter(which), AesKeySize);
|
||||
{
|
||||
/* Ensure that the SE sees consistent data. */
|
||||
hw::FlushDataCache(dst, AesKeySize);
|
||||
hw::DataSynchronizationBarrierInnerShareable();
|
||||
|
||||
/* Perform the appropriate AES operation. */
|
||||
se::ComputeAes128Ctr(dst, AesKeySize, pkg1::AesKeySlot_Device, SecureDataSource, AesKeySize, GetSecureDataCounter(which), AesKeySize);
|
||||
hw::DataSynchronizationBarrierInnerShareable();
|
||||
|
||||
/* Ensure the CPU sees consistent data. */
|
||||
hw::FlushDataCache(dst, AesKeySize);
|
||||
hw::DataSynchronizationBarrierInnerShareable();
|
||||
}
|
||||
|
||||
/* Tweak, if we should. */
|
||||
if (tweak) {
|
||||
|
|
Loading…
Reference in a new issue