Skip to main content

crypto_p521/
lib.rs

1// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved
2//
3// SPDX-License-Identifier: Apache-2.0
4
5//! NIST P-521 ECDSA / ES512 primitive.
6
7#![forbid(unsafe_code)]
8
9mod constants;
10
11#[cfg(feature = "native")]
12mod encoding;
13#[cfg(feature = "native")]
14mod keypair;
15#[cfg(feature = "native")]
16mod sign;
17#[cfg(feature = "native")]
18mod verify;
19
20pub use constants::{
21    P521_PUBLIC_KEY_COMPRESSED_LEN, P521_PUBLIC_KEY_RAW_LEN, P521_PUBLIC_KEY_UNCOMPRESSED_LEN,
22    P521_SECRET_KEY_LEN, P521_SIGNATURE_DER_MAX_LEN,
23};
24#[cfg(feature = "native")]
25pub use encoding::{compress_p521, decompress_p521};
26#[cfg(feature = "native")]
27pub use keypair::{generate_p521_keypair, generate_p521_keypair_from_secret_key};
28#[cfg(feature = "native")]
29pub use sign::sign_p521_der_prehash;
30#[cfg(feature = "native")]
31pub use verify::verify_p521_der_prehash;