scclib
Stable Cloud Computing C++ Library
Public Member Functions | List of all members
scc::crypto::RsaOaepDecrypt Class Reference

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...
 

Detailed Description

RSA OAEP decryption.

Decrypts using OAEP scheme. Requires a private key, and choice of hash algorithm.

Hash algoritm comes from scc::crypto::Hash.

Definition at line 372 of file rsa.h.

Constructor & Destructor Documentation

◆ RsaOaepDecrypt()

scc::crypto::RsaOaepDecrypt::RsaOaepDecrypt ( RsaPrivateKey ,
Hash::Algorithm  = Hash::sha1_type 
)

Construct an RSA decryptor.

Parameters
keyValid private key.
hash_typeHash algorithm from scc::crypto::Hash.

Member Function Documentation

◆ cipher_size()

int scc::crypto::RsaOaepDecrypt::cipher_size ( ) const

Cipher text length in bytes.

len(public key width)

◆ decrypt()

int scc::crypto::RsaOaepDecrypt::decrypt ( void *  ,
int  ,
const void *  ,
int  ,
const void *  = nullptr,
int  = 0 
)

Decrypt a message.

Parameters
msg_locPlaintext message buffer, will be zeroed before decryption.
msg_lenPlaintext size, must be exactly max_msg_size()
cipher_locEncrypted ciphertext buffer
cipher_lenCiphertext size, must be exactly cipher_size()
label_locOptional label, which will be verified but not encrypted
label_lenLabel length
Returns
The size of the decrypted message, or -1 if the decryption failed.

◆ max_msg_size()

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


The documentation for this class was generated from the following file: