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 and ECDH primitive.
6
7#![forbid(unsafe_code)]
8
9mod constants;
10
11#[cfg(feature = "native")]
12mod derive_shared_secret;
13#[cfg(feature = "native")]
14mod encoding;
15#[cfg(feature = "native")]
16mod keypair;
17#[cfg(feature = "native")]
18mod sign;
19#[cfg(feature = "native")]
20mod verify;
21
22pub use constants::{
23    P521_PUBLIC_KEY_COMPRESSED_LEN, P521_PUBLIC_KEY_RAW_LEN, P521_PUBLIC_KEY_UNCOMPRESSED_LEN,
24    P521_SECRET_KEY_LEN, P521_SHARED_SECRET_LEN, P521_SIGNATURE_DER_MAX_LEN,
25};
26#[cfg(feature = "native")]
27pub use derive_shared_secret::derive_p521_shared_secret;
28#[cfg(feature = "native")]
29pub use encoding::{
30    compress_p521, compress_p521 as compress_public_key, decompress_p521,
31    decompress_p521 as decompress_public_key,
32};
33#[cfg(feature = "native")]
34pub use keypair::{generate_p521_keypair, generate_p521_keypair_from_secret_key};
35#[cfg(feature = "native")]
36pub use sign::sign_p521_der_prehash;
37#[cfg(feature = "native")]
38pub use verify::verify_p521_der_prehash;