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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved
//
// SPDX-License-Identifier: Apache-2.0
//! # reallyme-crypto
//!
//! Umbrella crate that re-exports the ReallyMe cryptographic primitives,
//! dispatch and signer abstractions behind one dependency and a consistent
//! feature set.
//!
//! ## Platform lanes
//!
//! Rust exposes two backend lanes selected by Cargo feature and target:
//! `native` (portable Rust) and `wasm` (package-owned Rust compiled for
//! WebAssembly with target-appropriate entropy support).
//! Swift and Kotlin provider selection lives in their package facades; those
//! facades call this Rust workspace through FFI/JNI only for algorithms whose
//! provider policy explicitly selects Rust. A lane never silently falls back to
//! another backend.
//!
//! The canonical contract is not the Rust API by itself. It is the shared set
//! of protobuf/enums, package algorithm identifiers, typed error taxonomy,
//! provider manifest, and conformance vectors. Rust is the reference
//! implementation and the shared implementation for selected primitives; native
//! platform routes are interchangeable only when vectors and typed-error tests
//! prove identical input, output, failure, and edge-case behavior.
//!
//! ## Security posture
//!
//! `#![forbid(unsafe_code)]` here; secret material is returned in zeroizing
//! wrappers; signature verification fails closed; and cross-implementation
//! conformance vectors pin the Rust output against an independent oracle.
//! See `SECURITY.md` and `SECURITY_MEMORY_MODEL.md` at the repository root.
//!
//! Compile-checked usage examples live in the crate README so tests remain
//! separate from production implementation files.
compile_error!;
pub use crypto_core as core;
pub use ;
/// Operation-layer domain conventions shared by Rust and adapter boundaries.
/// Typed ownership, retention, export, and destruction contracts for secrets.
/// JSON Web Key envelope types and public-key conversion helpers.
pub use envelopes_jwk as jwk;
/// Bidirectional conversion between JWK and Multikey public-key envelopes.
pub use envelopes_jwk_multikey as jwk_multikey;
/// Algorithm-selected dispatch: keygen, sign/verify, key agreement, KEM, AEAD,
/// hashing, and multikey binding routed by an [`core::Algorithm`] selector.
/// Primary generated protobuf operation-response boundary.
/// Signer/verifier traits and dispatch-backed implementations for producing and
/// checking detached signatures.
/// AES-GCM authenticated encryption primitives and their typed key/nonce
/// wrappers and length constants.
/// AES-256-GCM authenticated encryption with typed key and nonce boundaries.
/// AES-128, AES-192, and AES-256 Key Wrap (RFC 3394) for compact key material.
/// AES-256-GCM-SIV nonce-misuse-resistant authenticated encryption primitive and
/// its typed key/nonce wrappers and length constants.
/// ChaCha20-Poly1305 and XChaCha20-Poly1305 authenticated encryption
/// primitives with typed key and nonce wrappers.
/// Argon2id password-based key derivation, including platform-tuned cost
/// profiles and typed salt/secret/derived-key wrappers.
/// OS-backed cryptographically secure randomness and typed generators for AEAD
/// nonces and Argon2 salts.
/// Ed25519 signatures: keypair generation, sign/verify, and public-key encoding.
/// HMAC authentication tags over SHA-256, SHA-384, and SHA-512.
/// JWA ECDH-ES Concat KDF over SHA-256 for deriving content-encryption keys
/// from an ECDH shared secret.
/// NIST P-256 (secp256r1) ECDSA over pre-hashed messages, with public-key
/// compression and Secure Enclave handle encoding.
/// NIST P-384 (secp384r1) ECDSA and ECDH, with public-key
/// compression/decompression helpers.
/// NIST P-521 (secp521r1) ECDSA and ECDH, with public-key
/// compression/decompression helpers.
/// PBKDF2 password-based key derivation conforming to RFC 8018.
/// RSA signature verification for PKCS#1 v1.5 and PSS.
/// secp256k1 ECDSA signs SHA-256(message) once, returns compact low-S `r || s`,
/// and uses compressed SEC1 public keys as the canonical API representation.
/// X25519 Diffie–Hellman key agreement and public-key encoding.
/// X-Wing hybrid KEM over X25519 plus ML-KEM-768.
/// RFC 9180 HPKE Base-mode encryption over supported DHKEM/HKDF/AEAD suites.
/// HKDF (RFC 5869) extract-and-expand key derivation over the SHA-2/SHA-3 suites,
/// with domain-separated key derivation helpers.
/// KMAC256 key derivation for protocols using NIST SP 800-108 and SP 800-185.
/// ML-DSA-44 (FIPS 204) post-quantum signatures: keygen, sign/verify, and
/// public-key encoding.
/// ML-DSA-65 (FIPS 204) post-quantum signatures: keygen, sign/verify, and
/// public-key encoding.
/// ML-DSA-87 (FIPS 204) post-quantum signatures: keygen, sign/verify, and
/// public-key encoding.
/// SLH-DSA-SHA2-128s (FIPS 205) hash-based post-quantum signatures.
/// ML-KEM-512 (FIPS 203) post-quantum key encapsulation: keygen, encapsulate,
/// and decapsulate.
/// ML-KEM-768 (FIPS 203) post-quantum key encapsulation: keygen, encapsulate,
/// and decapsulate.
/// ML-KEM-1024 (FIPS 203) post-quantum key encapsulation: keygen, encapsulate,
/// and decapsulate.
/// SHA-2-256 hashing and its fixed-length digest wrapper.
/// SHA-3-256 hashing and its fixed-length digest wrapper.