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
// SPDX-License-Identifier: MIT
//
// Rivide Post-Quantum Cryptography Library
// Copyright (C) 2026 Moh. Ananda Firmansyah Putra
//! # Rivide: Post-Quantum Cryptography Rust Crate
//!
//! Official high-performance, zero-allocation Rust bindings for the **Rivide**
//! Post-Quantum Cryptography (PQC) C99 library. Implements official **NIST FIPS 203** (ML-KEM)
//! and **NIST FIPS 204** (ML-DSA) standards with automated RAII memory zeroization.
//!
//! ## Quick Start
//!
//! ### ML-KEM-768 Key Encapsulation (FIPS 203)
//!
//! ```rust
//! use rivide::kem::MlKem768;
//!
//! // 1. Alice generates ML-KEM-768 keypair
//! let alice = MlKem768::keypair().expect("KeyGen failed");
//!
//! // 2. Bob encapsulates shared secret using Alice's public key
//! let bob = MlKem768::encapsulate(&alice.public_key).expect("Encaps failed");
//!
//! // 3. Alice decapsulates shared secret
//! let shared_secret = MlKem768::decapsulate(&bob.ciphertext, &alice.secret_key)
//! .expect("Decaps failed");
//!
//! assert_eq!(shared_secret, bob.shared_secret);
//! ```
//!
//! ### ML-DSA-65 Digital Signatures (FIPS 204)
//!
//! ```rust
//! use rivide::dsa::MlDsa65;
//!
//! // 1. Generate signing keypair
//! let signer = MlDsa65::keypair().expect("KeyGen failed");
//!
//! // 2. Sign arbitrary message payload
//! let message = b"Quantum-Safe Signed Transaction Payload";
//! let signature = MlDsa65::sign(message, &signer.secret_key).expect("Sign failed");
//!
//! // 3. Verify signature authenticity
//! let is_valid = MlDsa65::verify(&signature, message, &signer.public_key);
//! assert!(is_valid);
//! ```
// Re-exports for ergonomics
pub use ;
pub use ;
pub use RivideError;
pub use ;
pub use ;
/// Initializes the underlying Rivide C library subsystem.
///
/// Note: Initialization is called automatically upon first use, but can be invoked explicitly.