Diffie-Hellman shared secret computation in elliptic curve (EC) domain over binary field . More...
Functions | |
C4eArchSize | c4e_ecc2n_dh (C4E_CONST C4eEcDomain *C4E_RESTRICT dom, C4E_CONST C4eElement *C4E_RESTRICT d, C4E_CONST C4eEcPoint *C4E_RESTRICT q, C4eArchDigit tmp[C4E_RESTRICT], C4eArchUint8 *C4E_RESTRICT secret) |
Elliptic Curve Diffie-Hellman (ECDH) over binary field shared secret computation (according to IEEE Std 1363, ECSVDP-DH or ECSVDP-DHC primitive and ANSI X9.63). |
Diffie-Hellman shared secret computation in elliptic curve (EC) domain over binary field .
C4eArchSize c4e_ecc2n_dh | ( | C4E_CONST C4eEcDomain *C4E_RESTRICT | dom, | |
C4E_CONST C4eElement *C4E_RESTRICT | d, | |||
C4E_CONST C4eEcPoint *C4E_RESTRICT | q, | |||
C4eArchDigit | tmp[C4E_RESTRICT], | |||
C4eArchUint8 *C4E_RESTRICT | secret | |||
) |
Elliptic Curve Diffie-Hellman (ECDH) over binary field shared secret computation (according to IEEE Std 1363, ECSVDP-DH or ECSVDP-DHC primitive and ANSI X9.63).
This function performs an EC point (the others party public key q
) multiplication with the own private key (which is big number d
). If cofactor dom->h
is unequal to zero (see C4E_ELEM_IS_ZERO()) and unequal to one (see C4E_ELEM_IS_ONE()) then d
is pre-multiplied with the cofactor dom->h
, realizing the ECDHC algorithm. The x-coordinate of the resulting point is the shared secret. This is conforming to ANSI X9.63, section 5.4 and IEEE Std 1363, section 7.2.2.
dom
must be assured by the caller, either implicit or by using function c4e_ecc2n_domchk(). d
must be assured by the caller, either implicit or by using function c4e_ecc2n_keychk_prv(). tmp
[], using macro C4E_ECC2N_TMP_NUM() in conjunction with temp. space qualifier C4E_ECC2N_DH_TMPID_ORD or C4E_ECC2N_DH_TMPID_COF (depending on the value dom->h
).[in] | dom | Pointer to ECC2N domain parameters. |
[in] | d | Pointer to ECDH private key, which is a big number. |
[in] | q | Other party ECDH public key (curve point). |
tmp | Array of temporary space elements (see preconditions for details on size). | |
[out] | secret | Shared secret of both parties, in network byte order. |
secret
(typically dom->m.len
), 0 on error.