Expand description
Shared types for Rust Fintech Ecosystem (RFE).
Provides newtype identifiers, Blake3 hashing helpers, and Decimal
re-exports used across RFE crates. No I/O, no async.
Re-exports§
pub use rust_decimal;
Modules§
- hashing
- test_
vectors - NORM Protocol v1 Canonical Test Vectors. Used to verify cross-platform determinism across Xtensa (TrustBox) and x86_64 (Risk-Lens).
Structs§
- Audit
Entry - Append-only audit entry — blake3 chained for tamper evidence. Clean-room of LedgerEntry from zerocore-gateway/audit-ledger.
- Client
Id - Client/customer identifier.
- Compliance
Report - Exportable
Audit Root - Dual-hash audit root for regulatory export (GOST R 34.11-2012 / Streebog-256). The blake3_root is the internal chain root; streebog_root is its Streebog-256 re-hash required for CBR submissions and SMEV 4 payload signatures.
- Inn
- Russian taxpayer identification number (INN), 10 or 12 digits.
- LoanId
- Loan/order identifier.
- Ogrn
- Russian OGRN — primary state registration number, 13 or 15 digits.
- Request
Id - Unique request/correlation identifier (UUID v4).
- Seal
Input - Frozen in
rfe-typesv0.1.0 for TrustBox compatibility. Breaking field changes require a semver-major release. Canonical fields:nonce,request_hash,result_hash,chain_head_pre. - Sensitive
- Wrapper to prevent PII leakage in logs.
- Signed
Audit Export Envelope
Enums§
Constants§
- SEAL_
DOMAIN_ PREFIX - NORM Protocol v1 Seal Input. Prefix: “NORM_SEAL_V1” (12 bytes)
Traits§
- Hashable
- Any type that can produce a deterministic content hash.
Functions§
- audit_
root_ gost_ export - Produce an ExportableAuditRoot from an existing BLAKE3 chain root. This is the only function in the codebase that computes Streebog-256. Call exclusively at the export boundary (SMEV 4 payload, CBR submission header).
- blake3_
chain - Iterated blake3 hash over multiple byte slices (in order). Matches the pattern from zerocore-gateway/common for audit chaining.
- blake3_
hash - Compute blake3 hash of a single byte slice.
- build_
signed_ audit_ export - round_
financial - Round to 2 decimal places using banker’s rounding (HALF_EVEN). Used for financial calculations per CBR requirements.
- safe_
div - Safe division returning zero instead of panicking on zero denominator.