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_H
5#define SIGIL_CRYPTO_ED25519_VERIFY_H
6
7#include <stddef.h>
8
9/* 1 when signature (R || S) is a valid RFC 8032 Ed25519 signature of
10 * message under public_key, 0 otherwise. Non-canonical or small-order A
11 * and R, and S >= L, are rejected. */
12int 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.3
18 * step 1). Exposed for the differential harness's boundary tests. */
19int sigil_crypto_ed25519_point_is_canonical(const unsigned char p[32]);
21/* 1 when the encoding decodes to a point whose order divides 8. Exposed
22 * for the differential harness, which checks it against the 8-torsion
23 * points derived independently from the curve equation. */
24int sigil_crypto_ed25519_has_small_order(const unsigned char p[32]);
26#endif