Skip to main content

pkcs11_abi/
lib.rs

1//! PKCS#11 function-table layouts, catalogs, selection, and readers.
2//!
3//! Without the default `native` feature, this is a dependency-free `no_std`
4//! crate for inspecting little-endian Linux LP64 and ILP32 table snapshots.
5//! The `native` feature adds tables derived from the compilation target's
6//! `cryptoki-sys` bindings, helpers for live native tables, and native
7//! parameter declarations in the `params` module.
8//!
9//! Version and provenance values passed to selection APIs are assertions made
10//! by the caller. This crate validates supported combinations and read bounds;
11//! it does not authenticate where a table came from.
12
13#![cfg_attr(not(feature = "native"), no_std)]
14
15pub mod layout;
16#[cfg(feature = "native")]
17pub mod params;
18#[cfg(kani)]
19mod proofs;
20#[cfg(feature = "native")]
21pub mod tables;
22
23pub use layout::{
24    FUNCTION_NAMES, InterfaceLayout, LayoutError, LinuxLayout, Provenance, Selection, Version,
25    function_name, function_offset, read_function_pointer, read_word_le, select, table_bytes,
26};
27#[cfg(feature = "native")]
28pub use params::{
29    CK_MU_GEN_PARAMS, CK_MU_GEN_PARAMS_PTR, CK_X9_42_MQV_DERIVE_PARAMS,
30    CK_X9_42_MQV_DERIVE_PARAMS_PTR, CKM_ML_DSA_EXTERNAL_MU, CKM_ML_DSA_EXTERNAL_MU_GEN,
31};
32#[cfg(feature = "native")]
33pub use tables::{
34    FUNCTION_LIST_3_0_EXTRA_FIELDS, FUNCTION_LIST_3_2_EXTRA_FIELDS, FUNCTION_LIST_FIELDS, FnField,
35    Surface, TableSet, TableSpan, detect_null_functions, read_fn_pointers, tables_for,
36};