c4e_rsa.h File Reference

(Version 582)

Rivest-Shamir-Adleman (RSA) algorithm, according to PKCS #1. More...

#include "c4e_dlc.h"
#include "c4e_algo32.h"
#include "c4e_hash.h"
Include dependency graph for c4e_rsa.h:

Go to the source code of this file.

Data Structures

struct  C4eRsaKeyPrv
 RSA private key. More...

Defines

#define C4E_RSA_TMPID_KEY_CHECK
 Temp. space qualifier associated with c4e_rsa_keychk_prv() and c4e_rsa_keychk_pub().
#define C4E_RSA_TMPID_PKCS1V1_ENCRYPT
 Temp. space qualifier associated with c4e_rsa_encrypt_pkcs1v1().
#define C4E_RSA_TMPID_PKCS1V1_DECRYPT
 Temp. space qualifier associated with c4e_rsa_decrypt_pkcs1v1().
#define C4E_RSA_TMPID_PKCS1V1_SIGN
 Temp. space qualifier associated with c4e_rsa_sign_pkcs1v1().
#define C4E_RSA_TMPID_PKCS1V1_VERIFY
 Temp. space qualifier associated with c4e_rsa_verify_pkcs1v1().
#define C4E_RSA_TMPID_PKCS1V2_ENCRYPT
#define C4E_RSA_TMPID_PKCS1V2_DECRYPT
 Temp. space qualifier associated with c4e_rsa_decrypt_pkcs1v2().
#define C4E_RSA_TMPID_PKCS1V2_SIGN
 Temp. space qualifier associated with c4e_rsa_sign_pkcs1v2().
#define C4E_RSA_TMPID_PKCS1V2_VERIFY
 Temp. space qualifier associated with c4e_rsa_verify_pkcs1v2().
#define C4E_RSA_TMPID_PKCS1_MAX
 Temp. space qualifier for the best-case.
#define C4E_RSA_TMPID_PKCS1_WORSTCASE
 Temp. space qualifier for the worst-case.
#define C4E_RSA_TMP_NUM(tmpid, keylen)
 Calculate the number of temp. space elements of type C4eAlgo32Digit for RSA algorithms.
#define C4E_RSA_PKCS1V1_EBOH
 Minimum encoding overhead in a PKCS #1 v1.5 respective PEM (RFC 1423) encryption block, in bytes.
#define C4E_RSA_OAEP_EMOH(hlen)
 Minimum encryption overhead in a PKCS #1 v2.1 EME-OAEP encoded message, in bytes.
#define C4E_RSA_PSS_EMLEN(hlen, slen)
 Length of a PKCS #1 v2.1 EMSA-PSS (signature) encoded message, in bytes.

Functions

C4eSysStatus c4e_rsa_encrypt_pkcs1v1 (C4eDlcDomain *C4E_RESTRICT dom, C4E_CONST C4eElement *C4E_RESTRICT e, C4E_CONST C4eArchUint8 *C4E_RESTRICT plain, C4eArchSize len, C4eAlgo32Digit tmp[C4E_RESTRICT], C4eArchUint8 *C4E_RESTRICT cipher)
 RSA encryption of a plaintext octet string into a ciphertext octet string, compatible with PKCS #1 v1.5 (block type 2) and Privacy Enhancement for Internet Electronic Mail (PEM).
C4eSysStatus c4e_rsa_decrypt_pkcs1v1 (C4E_CONST C4eDlcDomain *C4E_RESTRICT dom, C4eRsaKeyPrv *key, C4E_CONST C4eArchUint8 *C4E_RESTRICT cipher, C4eAlgo32Digit tmp[C4E_RESTRICT], C4eArchUint8 *C4E_RESTRICT plain, C4eArchSize *C4E_RESTRICT plen)
 RSA decryption of a ciphertext octet string into a plain- text octet string, compatible with PKCS #1 v1.5 (block type 2) and Privacy Enhancement for Internet Electronic Mail (PEM).
C4eSysStatus c4e_rsa_sign_pkcs1v1 (C4E_CONST C4eDlcDomain *C4E_RESTRICT dom, C4eRsaKeyPrv *key, C4eHashId hid, C4E_CONST C4eArchUint8 *C4E_RESTRICT digest, C4eAlgo32Digit tmp[C4E_RESTRICT], C4eArchUint8 *C4E_RESTRICT signature)
 RSA signature of a digest, compatible with PKCS #1 v1.5 (block type 1).
C4eSysStatus c4e_rsa_verify_pkcs1v1 (C4eDlcDomain *C4E_RESTRICT dom, C4E_CONST C4eElement *C4E_RESTRICT e, C4eHashId hid, C4E_CONST C4eArchUint8 *C4E_RESTRICT digest, C4eAlgo32Digit tmp[C4E_RESTRICT], C4eArchUint8 *C4E_RESTRICT signature, C4eArchSize len)
 PKCS #1 v1.5 (block type 1) RSA signature verification.
C4eSysStatus c4e_rsa_encrypt_pkcs1v2 (C4eDlcDomain *C4E_RESTRICT dom, C4E_CONST C4eElement *C4E_RESTRICT e, C4eHashId hid, C4E_CONST C4eArchUint8 *C4E_RESTRICT plain, C4eArchSize len, C4eAlgo32Digit tmp[C4E_RESTRICT], C4eArchUint8 *C4E_RESTRICT cipher)
 RSA encryption of a plaintext octet string into a ciphertext octet string, compatible with PKCS #1 v2.1 (RSAES-OAEP), IEEE Std 1363 (IFES/EME1) and ISO 18033-2 (RSAES/REM1).
C4eSysStatus c4e_rsa_decrypt_pkcs1v2 (C4E_CONST C4eDlcDomain *C4E_RESTRICT dom, C4eRsaKeyPrv *key, C4eHashId hid, C4E_CONST C4eArchUint8 *C4E_RESTRICT cipher, C4eAlgo32Digit tmp[C4E_RESTRICT], C4eArchUint8 *C4E_RESTRICT plain, C4eArchSize *C4E_RESTRICT plen)
 RSA decryption of a ciphertext octet string into a plain- text octet string, compatible with PKCS #1 v2.1 (RSAES- OAEP), IEEE Std 1363 (IFES/EME1) and ISO 18033-2 (RSAES/REM1).
C4eSysStatus c4e_rsa_sign_pkcs1v2 (C4E_CONST C4eDlcDomain *C4E_RESTRICT dom, C4eRsaKeyPrv *key, C4eArchSize slen, C4eHashId hid, C4E_CONST C4eArchUint8 *C4E_RESTRICT digest, C4eAlgo32Digit tmp[C4E_RESTRICT], C4eArchUint8 *C4E_RESTRICT signature)
 RSA signature of a digest, compatible with PKCS #1 v2.1 signature scheme RSASSA-PSS.
C4eSysStatus c4e_rsa_verify_pkcs1v2 (C4eDlcDomain *C4E_RESTRICT dom, C4E_CONST C4eElement *C4E_RESTRICT e, C4eHashId hid, C4eArchUint8 *C4E_RESTRICT digest, C4eArchUint8 *C4E_RESTRICT signature, C4eArchSize len, C4eAlgo32Digit tmp[C4E_RESTRICT])
 PKCS #1 v2.1 RSA signature verification, according to scheme RSASSA-PSS.
C4eSysStatus c4e_rsa_keychk_prv (C4E_CONST C4eDlcDomain *C4E_RESTRICT dom, C4E_CONST C4eRsaKeyPrv *C4E_RESTRICT key, C4eAlgo32Digit tmp[C4E_RESTRICT])
 Private RSA key validity test.
C4eSysStatus c4e_rsa_keychk_pub (C4E_CONST C4eDlcDomain *C4E_RESTRICT dom, C4E_CONST C4eElement *C4E_RESTRICT e, C4eAlgo32Digit tmp[C4E_RESTRICT])
 Public RSA key validity test.

Detailed Description

Rivest-Shamir-Adleman (RSA) algorithm, according to PKCS #1.

Note:
All encryption/decryption or signature/verification schemes implemented can be identified as child nodes of OID pkcs-1 ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) }
Author:
Copyright (C) 2009-2015 Ralf Hoppe <ralf.hoppe@ieee.org>
Version:
Id
c4e_rsa.h 582 2015-06-06 16:20:10Z ralf

Definition in file c4e_rsa.h.