Expand description
Prism standard-library cryptography sub-crate.
prism-crypto realizes the cryptography Layer-3 of the standard
library named in Wiki ADR-031: it declares the
cryptographic axis traits (HashAxis, CurveAxis, SignatureAxis,
CommitmentAxis) through the axis! SDK macro and
supplies canonical impls plus matching ConstrainedTypeShape
carriers per the wiki’s ADR-031 roster.
§Scope
HashAxis— content-addressing function. Canonical impls:Sha256Hasher,Sha512Hasher,Sha3_256Hasher,Blake3Hasher,Keccak256Hasher. Each impl is conformance-tested against the relevant standard’s published vectors (FIPS-180-4 for SHA-2, FIPS-202 for SHA-3, BLAKE3 spec for BLAKE3) — seetests/conformance.rs.CommitmentAxis— composes anyHashAxisimpl into a Merkle-root commitment viaMerkleRoot<H, LEAF_BYTES>. The default aliasMerkleRootCommitmentis SHA-256. Per ADR-031 this is the canonical example of standard-library cross-sub-crate composition.CurveAxis,SignatureAxis— declared per ADR-031’s standard-library roster; concrete reference impls are scoped per axis maintenance policy (ADR-031’s “operational policy” carve-out).
§ConstrainedTypeShape declarations
Per ADR-031’s shape-declaration commitment, the canonical cryptographic value-carriers are parametric over byte-width:
Digest<N>— hash output.Digest<32>for SHA-256 / SHA3-256 / Keccak-256 / BLAKE3;Digest<48>for SHA-384;Digest<64>for SHA-512.PublicKey<N>— public-key bytes.Signature<N>— signature bytes.MerkleProofShape<MAX_DEPTH, LEAF_BYTES>— Merkle-inclusion proof.
Each shape is GroundedShape + IntoBindingValue-bound for use as
the Output of a prism_model!-declared application.
§Closure under uor-foundation (ADR-013)
Every axis trait declared here has ::uor_foundation::pipeline::AxisExtension
as a supertrait — the axis! macro enforces this. Concrete impls
that take no type parameters use the companion-macro lane; the
parametric MerkleRoot<H, LEAF_BYTES> hand-writes its
AxisExtension impl since the companion macro takes :ident.
§See also
Re-exports§
pub use commitment::CommitmentAxis;pub use commitment::MerkleProofShape;pub use commitment::MerkleRoot;pub use commitment::MerkleRootCommitment;pub use commitment::MAX_MERKLE_LEAVES;pub use curve::CurveAxis;pub use hash::Blake3Hasher;pub use hash::HashAxis;pub use hash::Keccak256Hasher;pub use hash::Sha256Hasher;pub use hash::Sha3_256Hasher;pub use hash::Sha512Hasher;pub use shapes::Digest;pub use shapes::PublicKey;pub use shapes::Signature;pub use signature::SignatureAxis;
Modules§
- commitment
CommitmentAxisdeclaration, parametric Merkle reference impl, and shape carriers.- curve
CurveAxisdeclaration (wiki ADR-031 elliptic-curve operations).- hash
HashAxisdeclaration and FIPS-180-4 / FIPS-202 / BLAKE3 impls.- shapes
- Parametric
ConstrainedTypeShapecarriers per Wiki ADR-031:Digest<N>,PublicKey<N>,Signature<N>. - signature
SignatureAxisdeclaration (wiki ADR-031 signing/verification).- verbs
- Layer-3 substrate-Term verbs per Wiki ADR-024 + Wiki ADR-055 + Wiki ADR-056.
Macros§
- axis_
extension_ impl_ for_ commitment_ axis - Wiki ADR-030 companion macro: instantiate
AxisExtensionfor a concrete struct implementing this axis trait. The macro emits animpl AxisExtension for <StructIdent>block that delegatesdispatch_kernelto the axis-trait methods perKERNEL_*id. The orphan-rule-conformant per-struct impl mechanism replacing the blanketimpl<T: <axis>> AxisExtension for T(which would violate Rust’s orphan rule from any crate that does not defineAxisExtension). - axis_
extension_ impl_ for_ curve_ axis - Wiki ADR-030 companion macro: instantiate
AxisExtensionfor a concrete struct implementing this axis trait. The macro emits animpl AxisExtension for <StructIdent>block that delegatesdispatch_kernelto the axis-trait methods perKERNEL_*id. The orphan-rule-conformant per-struct impl mechanism replacing the blanketimpl<T: <axis>> AxisExtension for T(which would violate Rust’s orphan rule from any crate that does not defineAxisExtension). - axis_
extension_ impl_ for_ hash_ axis - Wiki ADR-030 companion macro: instantiate
AxisExtensionfor a concrete struct implementing this axis trait. The macro emits animpl AxisExtension for <StructIdent>block that delegatesdispatch_kernelto the axis-trait methods perKERNEL_*id. The orphan-rule-conformant per-struct impl mechanism replacing the blanketimpl<T: <axis>> AxisExtension for T(which would violate Rust’s orphan rule from any crate that does not defineAxisExtension). - axis_
extension_ impl_ for_ signature_ axis - Wiki ADR-030 companion macro: instantiate
AxisExtensionfor a concrete struct implementing this axis trait. The macro emits animpl AxisExtension for <StructIdent>block that delegatesdispatch_kernelto the axis-trait methods perKERNEL_*id. The orphan-rule-conformant per-struct impl mechanism replacing the blanketimpl<T: <axis>> AxisExtension for T(which would violate Rust’s orphan rule from any crate that does not defineAxisExtension).
Constants§
- STANDARD_
LIBRARY_ VERSION - Wiki ADR-031 standard-library version banner. Each prism standard- library sub-crate exposes this so application authors can introspect the canonical-reference version of the axes it declares.