mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
Fix AES ECB encryption not encrypting
This commit is contained in:
parent
b35c418558
commit
ec8f27f1be
1 changed files with 5 additions and 1 deletions
|
@ -540,8 +540,10 @@ void se_aes_ecb_encrypt_block(unsigned int keyslot, void *dst, size_t dst_size,
|
||||||
|
|
||||||
/* Set configuration high (256-bit vs 128-bit) based on parameter. */
|
/* Set configuration high (256-bit vs 128-bit) based on parameter. */
|
||||||
SECURITY_ENGINE->CONFIG_REG = (ALG_AES_ENC | DST_MEMORY) | (config_high << 16);
|
SECURITY_ENGINE->CONFIG_REG = (ALG_AES_ENC | DST_MEMORY) | (config_high << 16);
|
||||||
SECURITY_ENGINE->CRYPTO_REG = keyslot << 24;
|
SECURITY_ENGINE->CRYPTO_REG = keyslot << 24 | 0x100;
|
||||||
|
flush_dcache_range((uint8_t *)src, (uint8_t *)src + 0x10);
|
||||||
se_perform_aes_block_operation(dst, 0x10, src, 0x10);
|
se_perform_aes_block_operation(dst, 0x10, src, 0x10);
|
||||||
|
flush_dcache_range((uint8_t *)dst, (uint8_t *)dst + 0x10);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -561,7 +563,9 @@ void se_aes_ecb_decrypt_block(unsigned int keyslot, void *dst, size_t dst_size,
|
||||||
|
|
||||||
SECURITY_ENGINE->CONFIG_REG = (ALG_AES_DEC | DST_MEMORY);
|
SECURITY_ENGINE->CONFIG_REG = (ALG_AES_DEC | DST_MEMORY);
|
||||||
SECURITY_ENGINE->CRYPTO_REG = keyslot << 24;
|
SECURITY_ENGINE->CRYPTO_REG = keyslot << 24;
|
||||||
|
flush_dcache_range((uint8_t *)src, (uint8_t *)src + 0x10);
|
||||||
se_perform_aes_block_operation(dst, 0x10, src, 0x10);
|
se_perform_aes_block_operation(dst, 0x10, src, 0x10);
|
||||||
|
flush_dcache_range((uint8_t *)dst, (uint8_t *)dst + 0x10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void shift_left_xor_rb(uint8_t *key) {
|
void shift_left_xor_rb(uint8_t *key) {
|
||||||
|
|
Loading…
Reference in a new issue