Skip to main content

hekate_rsa/
lib.rs

1// SPDX-FileCopyrightText: 2026 Andrei Kochergin <andrei@oumuamua.dev>
2// SPDX-FileCopyrightText: 2026 Oumuamua Labs <info@oumuamua.dev>
3// SPDX-License-Identifier: AGPL-3.0-only
4
5//! RSA-2048 PKCS#1 v1.5 signature verification
6//! for Hekate, the Rust zero-knowledge proof engine.
7//!
8//! [`Pkcs1Statement`] builds the program, instance and
9//! witness that prove `s^65537 mod N` equals the RFC 8017 ยง9.2
10//! encoding of `H`, SHA-256 chained over committed block words
11//! with FIPS 180-4 padding left to the caller. `N` is public,
12//! and the signature and the message are in the witness.
13//! [`encode_sha256`] computes that encoding natively.
14//!
15//! - [RSA-2048 PKCS#1 v1.5 Verification][rsa]: what the proof
16//!   states and how the tables split the work
17//!
18//! [rsa]: https://oumuamua.dev/primitives/signatures/rsa
19
20#![cfg_attr(not(feature = "std"), no_std)]
21
22extern crate alloc;
23
24pub mod pkcs1;
25pub mod statement;
26
27pub use pkcs1::{DIGEST_INFO_SHA256, encode_sha256, padding_limbs};
28pub use statement::Pkcs1Statement;