C4eRsaKeyPrv Struct Reference
[RSA]

RSA private key. More...

#include <c4e_rsa.h>

Data Fields

C4eElement dp
C4eElement dq
C4eElemTriple p
C4eElemTriple q

Detailed Description

RSA private key.

Note:
For import of big numbers the function c4e_elem_os2e() may be useful.
Precondition:
For proper working of RSA functions C4eRsaKeyPrv must meet the following constraints (you may use c4e_rsa_keychk_prv() to check the first four):
  1. All big numbers must be unequal to zero.
  2. The modulus dom->m.val and the two primes d.p.z, d.q.z must be odd.
  3. The modulus dom->m.val must be greater than 1 and comply with $ m=pq $.
  4. The CRT coefficients must fit the following relations:
    1. $ d_p < p - 1 $;
    2. $ d_q < q - 1 $;
    3. $ q_{\textup{inv}} < p $.
  5. All big numbers must be normalized, e.g. by using functions c4e_elem_norm() or c4e_elem_os2e().
  6. The RSA key must be generated exactly with the size indicated in member m.len of C4eDlcDomain.
See also:
C4eElement, C4E_ELEM_ASGN_MEM()

Definition at line 70 of file c4e_rsa.h.


Field Documentation

CRT exponent $ d_p = d \bmod (p-1) $

Definition at line 72 of file c4e_rsa.h.

CRT exponent $ d_q = d \bmod (q-1) $

Definition at line 73 of file c4e_rsa.h.

p holds a pointer to the first (secret) prime of $ m=pq $ in C4eElemTriple::z. There must be at least space for dom->m.val.size digits in p.z. The other two members of p are for internal use only and must not be defined when using any RSA function from external API.

Definition at line 88 of file c4e_rsa.h.

q holds numbers associated with the second (secret) prime of $ m=pq $:

  • C4eElemTriple::z is the prime number q, with maximum dom->m.val.size digits space required.
  • C4eElemTriple::y holds the inverse (Bezout cofactor) $ q_{\textup{inv}} = q^{-1} \pmod{p} $, used in CRT. The maximum number of digits is C4E_MODN_POW_SPACE(dom->m.val.size).
  • C4eElemTriple::x is for internal use only and must not be defined when using any RSA function from external API.

Definition at line 105 of file c4e_rsa.h.


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