scclib
Stable Cloud Computing C++ Library
|
RSA OAEP decryption. More...
#include <rsa.h>
Public Member Functions | |
RsaOaepDecrypt (RsaPrivateKey &, Hash::Algorithm=Hash::sha1_type) | |
Construct an RSA decryptor. More... | |
int | max_msg_size () const |
The maximum allowable plain text message length in bytes. More... | |
int | cipher_size () const |
Cipher text length in bytes. More... | |
int | decrypt (void *, int, const void *, int, const void *=nullptr, int=0) |
Decrypt a message. More... | |
RSA OAEP decryption.
Decrypts using OAEP scheme. Requires a private key, and choice of hash algorithm.
Hash algoritm comes from scc::crypto::Hash.
scc::crypto::RsaOaepDecrypt::RsaOaepDecrypt | ( | RsaPrivateKey & | , |
Hash::Algorithm | = Hash::sha1_type |
||
) |
Construct an RSA decryptor.
key | Valid private key. |
hash_type | Hash algorithm from scc::crypto::Hash. |
int scc::crypto::RsaOaepDecrypt::cipher_size | ( | ) | const |
Cipher text length in bytes.
len(public key width)
int scc::crypto::RsaOaepDecrypt::decrypt | ( | void * | , |
int | , | ||
const void * | , | ||
int | , | ||
const void * | = nullptr , |
||
int | = 0 |
||
) |
Decrypt a message.
msg_loc | Plaintext message buffer, will be zeroed before decryption. |
msg_len | Plaintext size, must be exactly max_msg_size() |
cipher_loc | Encrypted ciphertext buffer |
cipher_len | Ciphertext size, must be exactly cipher_size() |
label_loc | Optional label, which will be verified but not encrypted |
label_len | Label length |
int scc::crypto::RsaOaepDecrypt::max_msg_size | ( | ) | const |
The maximum allowable plain text message length in bytes.
len(public key width) - 2*size(hash output) - 2