AtlatestRepositorysigil-crypto
sigil-crypto / tree / nativeed25519-verify.h
1
/*2
* Ed25519 verification core. See ed25519-verify.c. No Sigil dependency.3
*/4
#ifndef SIGIL_CRYPTO_ED25519_VERIFY_H5
#define SIGIL_CRYPTO_ED25519_VERIFY_H7
#include <stddef.h>9
/* 1 when signature (R || S) is a valid RFC 8032 Ed25519 signature of10
* message under public_key, 0 otherwise. Non-canonical or small-order A11
* and R, and S >= L, are rejected. */12
int sigil_crypto_ed25519_verify(const unsigned char public_key[32],13
const unsigned char *message,14
size_t message_len,15
const unsigned char signature[64]);17
/* 1 when the 32-byte point encoding has y < p (RFC 8032 section 5.1.318
* step 1). Exposed for the differential harness's boundary tests. */19
int sigil_crypto_ed25519_point_is_canonical(const unsigned char p[32]);21
/* 1 when the encoding decodes to a point whose order divides 8. Exposed22
* for the differential harness, which checks it against the 8-torsion23
* points derived independently from the curve equation. */24
int sigil_crypto_ed25519_has_small_order(const unsigned char p[32]);26
#endif