hsm_crypto_service/lib.rs
1// Copyright (c) 2026 Tuloup Simon
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16//! Crypto business logic for the mini-HSM.
17//!
18//! This crate sits between the low-level [`atecc608b`] driver and the USB
19//! protocol layer. It owns the slot conventions, the PIN session state, and
20//! the orchestration of the multi-step signing workflow (Nonce passthrough
21//! followed by Sign external).
22
23#![no_std]
24#![deny(missing_docs)]
25#![deny(unsafe_code)]
26#![warn(clippy::pedantic)]
27#![allow(rustdoc::private_intra_doc_links)]
28
29pub(crate) mod encrypted_write;
30pub mod error;
31pub(crate) mod pin;
32pub(crate) mod service;
33pub mod session;
34pub(crate) mod slots;
35
36pub use error::CryptoServiceError;
37pub use service::CryptoService;
38pub use session::{Clock, Session, SESSION_TIMEOUT_MS};