Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_ecc.c File Reference

Curve25519 primitives: X25519 key agreement and Ed25519 signatures. More...

#include "nilorea/n_ecc.h"
#include "nilorea/n_log.h"
#include <openssl/evp.h>
#include <openssl/err.h>
Include dependency graph for n_ecc.c:

Go to the source code of this file.

Functions

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.
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_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_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_x25519_keypair (unsigned char *priv, unsigned char *pub)
 generate an X25519 keypair as N_ECC_KEY_LEN-byte raw private and public keys.

Detailed Description

Curve25519 primitives: X25519 key agreement and Ed25519 signatures.

Author
Castagnier Mickael
Version
1.0

Definition in file n_ecc.c.