2021-07-01 09:18:42 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: IRSAPublic.hpp
|
|
|
|
Date: 2021-7-1
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::Crypto::RSA
|
|
|
|
{
|
2024-02-19 11:15:10 +00:00
|
|
|
// Remember: there is no such thing as public decryption
|
2022-02-18 10:46:51 +00:00
|
|
|
struct IRSAPublic
|
2021-07-01 09:18:42 +00:00
|
|
|
{
|
2021-09-21 01:54:47 +00:00
|
|
|
virtual bool Verify(const Memory::MemoryViewRead &plainText,
|
|
|
|
const Memory::MemoryViewRead &signature,
|
2022-09-25 09:56:03 +00:00
|
|
|
Aurora::Hashing::EHashType method,
|
2021-07-01 09:18:42 +00:00
|
|
|
EPaddingType type) = 0;
|
|
|
|
|
2021-09-21 01:54:47 +00:00
|
|
|
virtual bool Encrypt(const Memory::MemoryViewRead &plainText,
|
2024-02-19 11:15:10 +00:00
|
|
|
EPaddingType type,
|
2022-01-20 16:04:53 +00:00
|
|
|
Memory::ByteBuffer &out) = 0;
|
2021-07-01 09:18:42 +00:00
|
|
|
|
2024-02-19 11:15:10 +00:00
|
|
|
// PKCS1 OAEP
|
|
|
|
virtual bool EncryptEx(const Memory::MemoryViewRead &plainText,
|
|
|
|
EPaddingType type,
|
|
|
|
Aurora::Hashing::EHashType method,
|
|
|
|
Memory::ByteBuffer &out) = 0;
|
|
|
|
|
2022-01-20 16:04:53 +00:00
|
|
|
virtual bool ToKey(ERSAKeyType type, Memory::ByteBuffer &out) = 0;
|
2021-07-01 09:18:42 +00:00
|
|
|
};
|
|
|
|
}
|