Skip to main content

Crate rfe_types

Crate rfe_types 

Source
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§

AuditEntry
Append-only audit entry — blake3 chained for tamper evidence. Clean-room of LedgerEntry from zerocore-gateway/audit-ledger.
ClientId
Client/customer identifier.
ComplianceReport
ExportableAuditRoot
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.
RequestId
Unique request/correlation identifier (UUID v4).
SealInput
Frozen in rfe-types v0.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.
SignedAuditExportEnvelope

Enums§

AuditExportError
AuditSignatureAlgorithm
FraudSign
RfeError

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.