Arduino Cryptography Library

DiffieHellman key agreement based on the elliptic curve modulo 2^255  19. More...
#include <Curve25519.h>
Static Public Member Functions  
static bool  eval (uint8_t result[32], const uint8_t s[32], const uint8_t x[32]) 
Evaluates the raw Curve25519 function. More...  
static void  dh1 (uint8_t k[32], uint8_t f[32]) 
Performs phase 1 of a DiffieHellman key exchange using Curve25519. More...  
static bool  dh2 (uint8_t k[32], uint8_t f[32]) 
Performs phase 2 of a DiffieHellman key exchange using Curve25519. More...  
Friends  
class  Ed25519 
DiffieHellman key agreement based on the elliptic curve modulo 2^255  19.
References: http://cr.yp.to/ecdh.html, RFC 7748
Definition at line 30 of file Curve25519.h.

static 
Performs phase 1 of a DiffieHellman key exchange using Curve25519.
k  The key value to send to the other party as part of the exchange. 
f  The generated secret value for this party. This must not be transmitted to any party or stored in permanent storage. It only needs to be kept in memory until dh2() is called. 
The f value is generated with RNG.rand(). It is the caller's responsibility to ensure that the global random number pool has sufficient entropy to generate the 32 bytes of f safely before calling this function.
The following example demonstrates how to perform a full DiffieHellman key exchange using dh1() and dh2():
Reference: RFC 7748
Definition at line 245 of file Curve25519.cpp.

static 
Performs phase 2 of a DiffieHellman key exchange using Curve25519.
k  On entry, this is the key value that was received from the other party as part of the exchange. On exit, this will be the shared secret. 
f  The secret value for this party that was generated by dh1(). The f value will be destroyed by this function. 
Reference: RFC 7748
Definition at line 283 of file Curve25519.cpp.

static 
Evaluates the raw Curve25519 function.
result  The result of evaluating the curve function. 
s  The S parameter to the curve function. 
x  The X(Q) parameter to the curve function. If this pointer is NULL then the value 9 is used for x. 
This function is provided to assist with implementating other algorithms with the curve. Normally applications should use dh1() and dh2() directly instead.
Reference: RFC 7748
Definition at line 80 of file Curve25519.cpp.