Table of Contents
ECC: Curve25519 (X25519 ECDH + Ed25519 EdDSA) over EVP
Functions
| Name | |
|---|---|
| int | n_x25519_keypair(unsigned char * priv, unsigned char * pub) generate an X25519 keypair as N_ECC_KEY_LEN-byte raw private and public keys. |
| int | n_x25519_derive(const unsigned char * priv, const unsigned char * peer_pub, unsigned char * shared) X25519 ECDH: derive the N_ECC_KEY_LEN-byte shared secret from our raw private key and the peer's raw public key. |
| int | n_ed25519_verify(const unsigned char * pub, const unsigned char * msg, size_t len, const unsigned char * sig) Ed25519 verify the N_ECC_SIG_LEN-byte sig over len bytes of msg under the N_ECC_KEY_LEN-byte raw public key. |
| int | n_ed25519_sign(const unsigned char * priv, const unsigned char * msg, size_t len, unsigned char * sig) Ed25519 sign len bytes of msg with the N_ECC_KEY_LEN-byte raw private key into sig (N_ECC_SIG_LEN bytes). |
| int | n_ed25519_keypair(unsigned char * priv, unsigned char * pub) generate an Ed25519 keypair as N_ECC_KEY_LEN-byte raw private and public keys. |
Defines
| Name | |
|---|---|
| N_ECC_SIG_LEN Ed25519 signature length in bytes. |
|
| N_ECC_KEY_LEN raw X25519/Ed25519 key length in bytes |
|
| N_ECC_AVAILABLE 1 when the linked library provides Curve25519 through the raw-key EVP API (OpenSSL 1.1.1+, LibreSSL 3.7+), 0 otherwise. |
Functions Documentation
function n_x25519_keypair
int n_x25519_keypair(
unsigned char * priv,
unsigned char * pub
)
generate an X25519 keypair as N_ECC_KEY_LEN-byte raw private and public keys.
Returns 0 on success, -1 on error.
function n_x25519_derive
int n_x25519_derive(
const unsigned char * priv,
const unsigned char * peer_pub,
unsigned char * shared
)
X25519 ECDH: derive the N_ECC_KEY_LEN-byte shared secret from our raw private key and the peer's raw public key.
Returns 0 on success, -1 on error.
function n_ed25519_verify
int n_ed25519_verify(
const unsigned char * pub,
const unsigned char * msg,
size_t len,
const unsigned char * sig
)
Ed25519 verify the N_ECC_SIG_LEN-byte sig over len bytes of msg under the N_ECC_KEY_LEN-byte raw public key.
Returns 0 if the signature is valid, -1 otherwise.
function n_ed25519_sign
int n_ed25519_sign(
const unsigned char * priv,
const unsigned char * msg,
size_t len,
unsigned char * sig
)
Ed25519 sign len bytes of msg with the N_ECC_KEY_LEN-byte raw private key into sig (N_ECC_SIG_LEN bytes).
Returns 0 on success, -1 on error.
function n_ed25519_keypair
int n_ed25519_keypair(
unsigned char * priv,
unsigned char * pub
)
generate an Ed25519 keypair as N_ECC_KEY_LEN-byte raw private and public keys.
Returns 0 on success, -1 on error.
Macros Documentation
define N_ECC_SIG_LEN
#define N_ECC_SIG_LEN 64
Ed25519 signature length in bytes.
define N_ECC_KEY_LEN
#define N_ECC_KEY_LEN 32
raw X25519/Ed25519 key length in bytes
define N_ECC_AVAILABLE
#define N_ECC_AVAILABLE N_OSSL_HAVE_RAW_EVP_25519
1 when the linked library provides Curve25519 through the raw-key EVP API (OpenSSL 1.1.1+, LibreSSL 3.7+), 0 otherwise.
This one still builds against OpenSSL 1.0.2, which has neither EVP_PKEY_X25519/EVP_PKEY_ED25519 nor EVP_PKEY_new_raw_*_key(); there every entry point below compiles to a logged failure returning -1, so callers still link and can skip the call on this test. The threshold lives in n_openssl_compat.h, which knows that OPENSSL_VERSION_NUMBER is a fixed compatibility value under LibreSSL.
Modules
- AABB3D
- ACCEPT_POOL
- ALLEGRO4
- ALLEGRO5
- ANIM_LIB
- ASTAR
- ATLAS_LIB
- AVRO
- CLOCK_SYNC
- COMMONS
- CONFIGFILE
- CYPHER_BASE64
- CYPHER_VIGENERE
- DEAD_RECKONING
- ENUMS
- EXCEPTIONS
- GAME_ENV
- GIT
- GUI
- HASH_TABLE
- ISOMETRIC_ENGINE
- LIST
- LOG
- LOGNODUP
- LZ4
- NETWORKING
- NETWORK_MSG
- N_COOKIES
- N_DIFF
- N_DIGEST
- N_DISK_CACHE
- N_DNS
- N_ECC
- N_ENTROPY
- N_FILES
- N_FLUIDS
- N_GUI_COLOR
- N_GUI_COLORWHEEL
- N_GUI_CURVE
- N_GUI_GRID
- N_GUI_POPUP
- N_HEX
- N_HTTP3
- N_HTTP_COOKIE
- N_HTTP_FORM
- N_HTTP_MIME
- N_HTTP_REQ
- N_HTTP_RESP
- N_HTTP_ROUTER
- N_HTTP_SERVER
- N_ICC
- N_JSON
- N_KAFKA
- N_LINALG
- N_MODULE
- N_OPENSSL_COMPAT
- N_PRETTY
- N_PTH
- N_QUERY
- N_RANDOM
- N_SHA256
- N_STR
- N_TIFF
- N_TIME
- N_USER
- N_X509
- N_ZIP
- PARTICLES
- PCRE
- PHYSICS
- SIGNALS
- STACK
- THREADS
- TRAJECTORY
- TREE
- ZLIB