1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Copyright (C) 2026 quip.network
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: AGPL-3.0-or-later
//! Core hash-based signature library.
//!
//! This crate exports:
//!
//! - WOTS+ primitives
//! - independent SPHINCS+C layer
//! - SHRINCS hybrid signer / verifier
//! - shared types used by higher-level wrappers
//!
//! # Features
//!
//! - **`std`** (default): host surface, env traces, serde std.
//! - **`alloc`**: `Vec`-based signature wire types (required for crypto APIs).
//! - **`solana`**: optional `solana-program` + syscall hash routing.
//! - Profile selectors and `wasm-bindings` as before.
//!
//! Pure-core no-alloc (fixed arrays only) is out of scope for this release;
//! `no_std + alloc` is the embedded baseline.
// The core crate contains no `unsafe`. Lock that in — except under
// `wasm-bindings`, where wasm-bindgen's generated glue emits `unsafe` the crate
// does not author.
// Panic-prevention lints (review bead qg4): library code must not panic on
// untrusted input. Scoped to non-test builds so `#[cfg(test)]` modules may use
// unwrap/expect freely. The broader `indexing-slicing` and full `pedantic`
// sets are intentionally deferred — under CI's `-D warnings` they would force
// a large, churn-heavy rewrite of the crypto slice code with no safety gain
// (the verifier already bounds every attacker-controlled index).
// Always available: the crate has no pure-core no-alloc build path.
// `no_std + alloc` is the embedded baseline (see module docs above). The
// `alloc` cargo feature remains as a no-op marker so existing
// `--features alloc,...` invocations and `std = ["alloc", ...]` keep working.
extern crate alloc;
// Layering: the scheme-neutral building blocks (`hash`, `abi`, `buf`,
// `profiles`, `treehash`) sit at the crate root; `sphincs_plus_c` is the
// stateless scheme and is oblivious to `shrincs`; `shrincs` builds its
// hybrid (stateful UXMSS + stateless recovery) on top of `sphincs_plus_c`.
// `wasm` sits above both.
pub
pub
pub
pub
pub
pub
// HASH_LEN is the 32-byte hash *slot* width shared by every profile: every
// hash-valued wire field is a 32-byte slot (Solidity `bytes32`) regardless of
// the parameter set. A truncated profile emits high-aligned, zero-padded node
// values inside this slot (see HASH_TRUNC_LEN and `mask_hash`).
pub const HASH_LEN: usize = 32;
pub use ErrorCode;
pub use SphincsPlusCVerifier;
pub use ;
pub use ;
pub use ;