Expand description
Optional sanitization integration helpers for base64-ng.
This crate deliberately lives outside the core base64-ng package so the
base crate keeps its zero-runtime-dependency contract. Applications that
already admit sanitization can opt into this companion crate and decode
secret-bearing Base64 directly into sanitization secret containers.
The extension trait targets base64_ng::ct::CtEngine rather than the
ordinary strict decoder. sanitization 2.1.0’s native ct primitives are
re-exported for callers that want Choice-based verification after decode.
Enable memory-lock or high-assurance for locked secret containers on
supported native targets.
use base64_ng::ct;
use base64_ng_sanitization::{CtDecodeSanitizationExt, SanitizationCtEqExt};
let secret = ct::STANDARD
.decode_secret_bytes::<5>(b"aGVsbG8=")
.unwrap();
assert!(secret.sanitization_verify(b"hello", "example declassifies equality"));Modules§
- ct
- Data-oblivious primitives for secret-handling code.
Enums§
- Locked
Decode Error - Error returned by fail-closed locked-secret decode helpers.
- Protected
Allocation - Which protected allocation failed during a two-allocation decode.
- Sanitization
Decode Error - Error returned by fixed-size sanitization decode helpers.
- Sanitization
Protected Decode Error - Redacted failure from a 2.0 protected sanitization decode.
- Secret
VecDecode Error - Error returned by bounded heap-backed secret decode helpers.
Constants§
- DEFAULT_
SECRET_ VEC_ DECODE_ MAX_ LEN - Default decoded-byte ceiling for dynamic secret convenience methods.
- MAX_
SANITIZATION_ STACK_ SECRET_ BYTES - Maximum secret capacity allocated on the stack by this companion crate.
Traits§
- CtDecode
Sanitization Bounded Ext - Explicitly bounded, fallibly allocated dynamic secret decode helpers.
- CtDecode
Sanitization Ext - Extension helpers for decoding with
base64_ng::ct::CtEngineintosanitizationsecret containers. - CtDecode
Sanitization Protected Ext - Detailed fail-closed decode helpers for protected locked storage.
- Locked
Sanitization CtEq Ext - Integrity-checked comparison helpers for locked secret containers.
- Sanitization
CtEq Ext - Native
sanitization::ctcomparison helpers for decoded secret containers. - Sanitization
Protected Decode Ext - 2.0 decode helpers with separately protected staging and destination.
Functions§
- sanitization_
ct_ eq_ public_ len - Compare two byte slices through
sanitization::ctwith public length.