dolphin/Source/Core/Common/Crypto/AES.h
Léo Lam f8fb9e2d03 IOS: Implement IOSC-like API
This prevents the IOS crypto code and keys from being spread over
the codebase. Things only have to be implemented once, and can be
used everywhere from the IOS code.

Additionally, since ES exposes some IOSC calls directly (DeleteObject
and Encrypt/Decrypt), we need this for proper emulation.

Currently, this only supports AES key objects.
2017-05-02 23:49:22 +02:00

27 lines
590 B
C++

// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <cstddef>
#include <vector>
#include "Common/CommonTypes.h"
namespace Common
{
namespace AES
{
enum class Mode
{
Decrypt,
Encrypt,
};
std::vector<u8> DecryptEncrypt(const u8* key, u8* iv, const u8* src, size_t size, Mode mode);
// Convenience functions
std::vector<u8> Decrypt(const u8* key, u8* iv, const u8* src, size_t size);
std::vector<u8> Encrypt(const u8* key, u8* iv, const u8* src, size_t size);
} // namespace AES
} // namespace Common