![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Header for Edward's curve Diffie-Hellman related methods. More...
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | edDH_GenerateSharedSecret (MOC_ECC(hwAccelDescr hwAccelCtx) edECCKey *pPrivateKey, ubyte *pOtherPartysPublicKey, ubyte4 publicKeyLen, ubyte **ppSharedSecret, ubyte4 *pSharedSecretLen, void *pExtCtx) |
Generates a Edward's form Diffie-Hellman shared secret. More... | |
Documentation file for Edward's curve Diffie-Hellman related methods.
To enable the methods in this file one must define
__ENABLE_MOCANA_ECC__
and at least one or more of the following flags__ENABLE_MOCANA_ECC_EDDH_25519__
__ENABLE_MOCANA_ECC_EDDH_448__
MOC_EXTERN MSTATUS edDH_GenerateSharedSecret | ( | MOC_ECC(hwAccelDescr hwAccelCtx) edECCKey * | pPrivateKey, |
ubyte * | pOtherPartysPublicKey, | ||
ubyte4 | publicKeyLen, | ||
ubyte ** | ppSharedSecret, | ||
ubyte4 * | pSharedSecretLen, | ||
void * | pExtCtx | ||
) |
Generates a Edward's form Diffie-Hellman shared secret from an edECCKey
form private key and the other party's public key. A buffer will be allocated and to hold the generated shared secret and be sure to FREE this buffer when done with it.
pPrivateKey | Pointer to our private key. |
pOtherPartysPublicKey | Buffer holding the other party's public key. |
publicKeyLen | The length of the other party's public key in bytes. This must be 32 for curve25519 and 56 for curve448. |
ppSharedSecret | Pointer to a buffer that will be allocated and filled with the resulting shared secret. |
pSharedSecretLen | Contents will be set to the number of bytes in the allocated buffer. |
pExtCtx | An extended context reserved for future use. |
OK
(0) if successful, otherwise a negative number error code from merrors.h