Skip to main content

alice_auth/
lib.rs

1//! ALICE-Auth: Ed25519 ZKP Authentication.
2//!
3//! Zero-allocation, branchless Ed25519 challenge-response authentication.
4
5#![allow(
6    clippy::cast_possible_truncation,
7    clippy::cast_possible_wrap,
8    clippy::cast_precision_loss,
9    clippy::cast_sign_loss,
10    clippy::cast_lossless,
11    clippy::similar_names,
12    clippy::many_single_char_names,
13    clippy::module_name_repetitions,
14    clippy::inline_always,
15    clippy::too_many_lines,
16    clippy::wildcard_imports,
17    clippy::doc_markdown,
18    clippy::missing_errors_doc,
19    clippy::missing_panics_doc,
20    clippy::must_use_candidate,
21    clippy::missing_safety_doc,
22    clippy::return_self_not_must_use,
23    clippy::redundant_pub_crate,
24    clippy::items_after_statements,
25    clippy::needless_pass_by_value,
26    clippy::missing_const_for_fn,
27    clippy::single_match_else,
28    clippy::unused_self,
29    clippy::unnecessary_map_or,
30    clippy::option_if_let_else,
31    clippy::unsafe_derive_deserialize,
32    clippy::branches_sharing_code,
33    clippy::useless_conversion,
34    clippy::redundant_closure_for_method_calls,
35    clippy::match_same_arms,
36    clippy::float_cmp,
37    clippy::trivially_copy_pass_by_ref,
38    clippy::use_self,
39    clippy::significant_drop_tightening,
40    clippy::assigning_clones,
41    clippy::or_fun_call,
42    clippy::inline_always,
43    clippy::doc_link_with_quotes,
44    clippy::too_many_arguments,
45    clippy::duplicated_attributes,
46    clippy::manual_let_else
47)]
48#![cfg_attr(not(feature = "std"), no_std)]
49
50#[cfg(feature = "alloc")]
51extern crate alloc;
52#[cfg(feature = "std")]
53extern crate std;
54
55pub mod challenge_ttl;
56pub mod ct;
57pub mod errors;
58pub mod hex;
59pub mod identity;
60/// Key rotation (`Vec` of previous generations、`std` 専用)
61#[cfg(feature = "std")]
62pub mod key_rotation;
63pub mod prelude;
64pub mod protocol;
65pub mod random;
66pub mod social_recovery;
67pub mod trust_chain;
68pub mod types;
69pub mod verify;
70
71#[cfg(feature = "crypto")]
72pub mod crypto_bridge;
73
74#[cfg(feature = "std")]
75pub mod jwt;
76
77#[cfg(feature = "nizk")]
78pub mod nizk;
79
80#[cfg(feature = "std")]
81pub mod totp;
82
83#[cfg(feature = "db")]
84pub mod db_bridge;
85
86#[cfg(feature = "api")]
87pub mod api_bridge;
88
89#[cfg(feature = "pyo3")]
90pub mod python;
91
92#[cfg(feature = "ffi")]
93pub mod ffi;
94
95#[cfg(all(feature = "ffi", feature = "nizk"))]
96pub mod ffi_nizk;
97
98#[cfg(all(feature = "ffi", feature = "crypto"))]
99pub mod ffi_crypto;
100
101#[cfg(all(test, feature = "std"))]
102mod integration_tests;
103
104// Backward-compat re-exports.
105pub use crate::challenge_ttl::*;
106pub use crate::ct::*;
107pub use crate::errors::*;
108pub use crate::identity::*;
109#[cfg(feature = "std")]
110pub use crate::key_rotation::*;
111pub use crate::protocol::*;
112pub use crate::random::*;
113pub use crate::social_recovery::*;
114pub use crate::trust_chain::*;
115pub use crate::types::*;
116pub use crate::verify::*;
117
118#[cfg(feature = "ffi")]
119pub use crate::ffi::*;
120
121#[cfg(all(feature = "ffi", feature = "nizk"))]
122pub use crate::ffi_nizk::*;
123
124#[cfg(all(feature = "ffi", feature = "crypto"))]
125pub use crate::ffi_crypto::*;
126
127// no_std の panic handler は library では定義しない: 最終 binary 側が 1 つだけ提供する
128// (library が持つと consumer の handler と `duplicate lang item: panic_impl` で link 不能、
129//  2026-09-15 まで `cfg(not(std), not(test))` で定義していた = bare-metal check を通すための偽装)