mirror of
https://github.com/DarkStore-3DS/Project_CTR.git
synced 2026-07-04 08:49:03 +00:00
30 lines
1.5 KiB
C++
30 lines
1.5 KiB
C++
#include <tc/crypto/RsaOaepSha512Encryptor.h>
|
|
|
|
bool tc::crypto::EncryptRsa2048OaepSha512(byte_t* block, const byte_t* message, size_t message_size, const RsaKey& key, const byte_t* label, size_t label_size, bool isLabelDigested)
|
|
{
|
|
tc::crypto::Rsa2048OaepSha512Encryptor impl;
|
|
impl.initialize(key, label, label_size, isLabelDigested);
|
|
return impl.encrypt(block, message, message_size);
|
|
}
|
|
|
|
bool tc::crypto::DecryptRsa2048OaepSha512(byte_t* message, size_t& message_size, size_t message_capacity, const byte_t* block, const RsaKey& key, const byte_t* label, size_t label_size, bool isLabelDigested)
|
|
{
|
|
tc::crypto::Rsa2048OaepSha512Encryptor impl;
|
|
impl.initialize(key, label, label_size, isLabelDigested);
|
|
return impl.decrypt(message, message_size, message_capacity, block);
|
|
}
|
|
|
|
bool tc::crypto::EncryptRsa4096OaepSha512(byte_t* block, const byte_t* message, size_t message_size, const RsaKey& key, const byte_t* label, size_t label_size, bool isLabelDigested)
|
|
{
|
|
tc::crypto::Rsa4096OaepSha512Encryptor impl;
|
|
impl.initialize(key, label, label_size, isLabelDigested);
|
|
return impl.encrypt(block, message, message_size);
|
|
}
|
|
|
|
bool tc::crypto::DecryptRsa4096OaepSha512(byte_t* message, size_t& message_size, size_t message_capacity, const byte_t* block, const RsaKey& key, const byte_t* label, size_t label_size, bool isLabelDigested)
|
|
{
|
|
tc::crypto::Rsa4096OaepSha512Encryptor impl;
|
|
impl.initialize(key, label, label_size, isLabelDigested);
|
|
return impl.decrypt(message, message_size, message_capacity, block);
|
|
}
|