Elliptic-Curve#
Elliptic-curve Diffie-Hellman key agreement on Curve25519.
Available Implementations#
#include "EverCrypt_Curve25519.h"
API Reference#
-
void EverCrypt_Curve25519_scalarmult(uint8_t *shared, uint8_t *my_priv, uint8_t *their_pub)#
Compute the scalar multiple of a point.
- Parameters:
shared – Pointer to 32 bytes of memory where the resulting point is written to.
my_priv – Pointer to 32 bytes of memory where the secret/private key is read from.
their_pub – Pointer to 32 bytes of memory where the public point is read from.
Compute the scalar multiple of a point.
shared
Pointer to 32 bytes of memory, allocated by the caller, where the resulting point is written to.
my_priv
Pointer to 32 bytes of memory, allocated by the caller, where the secret/private key is read from.
their_pub
Pointer to 32 bytes of memory, allocated by the caller, where the public point is read from.
-
void EverCrypt_Curve25519_secret_to_public(uint8_t *pub, uint8_t *priv)#
Calculate a public point from a secret/private key.
This computes a scalar multiplication of the secret/private key with the curve’s basepoint.
- Parameters:
pub – Pointer to 32 bytes of memory where the resulting point is written to.
priv – Pointer to 32 bytes of memory where the secret/private key is read from.
Calculate a public point from a secret/private key.
This computes a scalar multiplication of the secret/private key with the curve’s basepoint.
pub
Pointer to 32 bytes of memory, allocated by the caller, where the resulting point is written to.
priv
Pointer to 32 bytes of memory, allocated by the caller, where the secret/private key is read from.
-
bool EverCrypt_Curve25519_ecdh(uint8_t *shared, uint8_t *my_priv, uint8_t *their_pub)#
Execute the diffie-hellmann key exchange.
- Parameters:
shared – Pointer to 32 bytes of memory where the resulting point is written to.
my_priv – Pointer to 32 bytes of memory where our secret/private key is read from.
their_pub – Pointer to 32 bytes of memory where their public point is read from.
Execute the diffie-hellmann key exchange.
shared
Pointer to 32 bytes of memory, allocated by the caller, where the resulting point is written to.
my_priv
Pointer to 32 bytes of memory, allocated by the caller, where our secret/private key is read from.
their_pub
Pointer to 32 bytes of memory, allocated by the caller, where their public point is read from.