Fundamental declarations and definitions for algorithms based on discrete logarithm problem. More...
Data Structures | |
struct | C4eDlcDomain |
Discrete logarithm (DL) domain parameters (public). More... | |
Modules | |
DLC Temp. Space Qualifiers | |
Temp. space qualifiers for DL based cryptography (exclusive RSA). | |
Diffie-Hellman (DH) | |
Diffie-Hellman shared secret computation in discrete logarithm (DL) domain. | |
Digital Signature Algorithm (DSA) | |
Digital Signature Algorithm (DSA) in discrete logarithm (DL) domain. | |
Defines | |
#define | C4E_DLC_GF_BYTES_MAX |
Maximum allowed size (in bytes) of a discrete logarithm (DL) domain modulus in C4eDlcDomain::m. | |
Functions | |
C4eSysStatus | c4e_dlc_domchk (C4eArchUint algos, C4E_CONST C4eDlcDomain *dom) |
A simple (and fast) discrete logarithm domain parameters validity test. | |
C4eSysStatus | c4e_dlc_keychk_prv (C4eArchUint algos, C4E_CONST C4eDlcDomain *C4E_RESTRICT dom, C4E_CONST C4eElement *C4E_RESTRICT key, C4eArchDigit tmp[C4E_RESTRICT]) |
Discrete logarithm (DL) domain private key validity test. | |
C4eSysStatus | c4e_dlc_keychk_pub (C4eArchUint algos, C4E_CONST C4eDlcDomain *C4E_RESTRICT dom, C4E_CONST C4eElement *C4E_RESTRICT key, C4eArchDigit tmp[C4E_RESTRICT]) |
Discrete logarithm (DL) domain public key validity test. | |
DLC Algorithm Identifiers | |
Algorithm identifiers for Discrete Logarithm Cryptography (DLC), to be used as parameter to c4e_dlc_domchk(). | |
#define | C4E_DLC_ALGO_NONE |
"unspecific" algorithm identifier. | |
#define | C4E_DLC_ALGO_DH |
DH algorithm identifier. | |
#define | C4E_DLC_ALGO_DSA |
DSA algorithm identifier. | |
#define | C4E_DLC_ALGO_RSA |
RSA algorithm identifier. | |
#define | C4E_DLC_ALGO_ALL |
"all" algorithm identifier. |
Fundamental declarations and definitions for algorithms based on discrete logarithm problem.
#define C4E_DLC_GF_BYTES_MAX |
Maximum allowed size (in bytes) of a discrete logarithm (DL) domain modulus in C4eDlcDomain::m.
C4eSysStatus c4e_dlc_domchk | ( | C4eArchUint | algos, | |
C4E_CONST C4eDlcDomain * | dom | |||
) |
A simple (and fast) discrete logarithm domain parameters validity test.
Function c4e_dlc_domchk() checks the following conditions:
dom->m.val
must be odd and greater than zero.dom->m.val
must be less than C4E_ELEM_DIGITS_NUM
(dom->m.len).dom->m.len
must be less/equal C4E_DLC_GF_BYTES_MAX (if defined).If algos
does contain C4E_DLC_ALGO_DSA then the following additional conditions are checked:
dom->q.val.size
fits C4E_ELEM_DIGITS_NUM(dom->q.len
);dom->m.val
is at least: 2U * C4E_MODN_POW_SPACE(dom->q.val.size)
dom
must be normalized, for example by using functions c4e_elem_norm() or c4e_elem_os2e().Standard Specifications For Public-Key Cryptography. Std 1363-2000, IEEE, 2000.
Digitale Signature Standard (DSS). FIPS Publication 186-4, National Institute of Standards and Technology, 2013.
NIST Special Publication 800-56A Revision 2: Recommendation for Pair-Wise Key Establishment Schemes Using Discrete Logarithm Cryptography. 2013.
NIST Special Publication 800-89: Recommendation for Obtaining Assurances for Digital Signature Applications. 2006.
[in] | algos | Algorithm identifiers to check domain parameters for (or'ed together). |
[in] | dom | Pointer to domain parameters. |
dom
. C4E_STATUS_OK | If the domain parameters are usable for all calculations (valid in the sense of this implementation). | |
other | If one of the domain parameters is invalid. |
C4eSysStatus c4e_dlc_keychk_prv | ( | C4eArchUint | algos, | |
C4E_CONST C4eDlcDomain *C4E_RESTRICT | dom, | |||
C4E_CONST C4eElement *C4E_RESTRICT | key, | |||
C4eArchDigit | tmp[C4E_RESTRICT] | |||
) |
Discrete logarithm (DL) domain private key validity test.
The function validates a private key d with respect to:
algos
does contain C4E_DLC_ALGO_DSA then additionally: .dom
must be assured by the caller, either implicit or by using function c4e_dlc_domchk(). key
and dom
must be normalized, e.g. by using functions c4e_elem_norm() or c4e_elem_os2e().[in] | algos | Algorithm identifiers to check the private key for (or'ed together). |
[in] | dom | Pointer to DL domain parameters. |
[in] | key | Private DL key to be tested. |
tmp | Array of dom->m.val.size temporary space elements. |
key
. C4E_STATUS_OK | If the key seems to be valid. | |
other | If the key is invalid. |
C4eSysStatus c4e_dlc_keychk_pub | ( | C4eArchUint | algos, | |
C4E_CONST C4eDlcDomain *C4E_RESTRICT | dom, | |||
C4E_CONST C4eElement *C4E_RESTRICT | key, | |||
C4eArchDigit | tmp[C4E_RESTRICT] | |||
) |
Discrete logarithm (DL) domain public key validity test.
The function validates parameter key
with respect to:
dom
must be assured by the caller, either implicit or by using function c4e_dlc_domchk(). key
and dom
must be normalized, e.g. by using functions c4e_elem_norm() or c4e_elem_os2e().[in] | algos | Algorithm identifiers to check the public key for (or'ed together). |
[in] | dom | Pointer to DL domain parameters. |
[in] | key | Public DL key to be tested. |
tmp | Array of temporary space elements (unused at the moment). |
key
. C4E_STATUS_OK | If the key seems to be valid. | |
other | If the key is invalid. |