diff options
Diffstat (limited to 'src/core/hw/aes/ccm.h')
| -rw-r--r-- | src/core/hw/aes/ccm.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/core/hw/aes/ccm.h b/src/core/hw/aes/ccm.h deleted file mode 100644 index bf4146e80..000000000 --- a/src/core/hw/aes/ccm.h +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | // Copyright 2017 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <array> | ||
| 8 | #include <cstddef> | ||
| 9 | #include <vector> | ||
| 10 | #include "common/common_types.h" | ||
| 11 | |||
| 12 | namespace HW { | ||
| 13 | namespace AES { | ||
| 14 | |||
| 15 | constexpr size_t CCM_NONCE_SIZE = 12; | ||
| 16 | constexpr size_t CCM_MAC_SIZE = 16; | ||
| 17 | |||
| 18 | using CCMNonce = std::array<u8, CCM_NONCE_SIZE>; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * Encrypts and adds a MAC to the given data using AES-CCM algorithm. | ||
| 22 | * @param pdata The plain text data to encrypt | ||
| 23 | * @param nonce The nonce data to use for encryption | ||
| 24 | * @param slot_id The slot ID of the key to use for encryption | ||
| 25 | * @returns a vector of u8 containing the encrypted data with MAC at the end | ||
| 26 | */ | ||
| 27 | std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& nonce, size_t slot_id); | ||
| 28 | |||
| 29 | /** | ||
| 30 | * Decrypts and verify the MAC of the given data using AES-CCM algorithm. | ||
| 31 | * @param cipher The cipher text data to decrypt, with MAC at the end to verify | ||
| 32 | * @param nonce The nonce data to use for decryption | ||
| 33 | * @param slot_id The slot ID of the key to use for decryption | ||
| 34 | * @returns a vector of u8 containing the decrypted data; an empty vector if the verification fails | ||
| 35 | */ | ||
| 36 | std::vector<u8> DecryptVerifyCCM(const std::vector<u8>& cipher, const CCMNonce& nonce, | ||
| 37 | size_t slot_id); | ||
| 38 | |||
| 39 | } // namespace AES | ||
| 40 | } // namespace HW | ||