21 releases
Uses new Rust 2024
| new 0.2.7 | Aug 2, 2026 |
|---|---|
| 0.2.6 | Jul 31, 2026 |
| 0.2.2 | Jun 13, 2026 |
| 0.1.12 | Jun 4, 2026 |
| 0.1.0 | Jan 31, 2026 |
#2827 in Cryptography
12,584 downloads per month
Used in 53 crates
(18 directly)
180KB
3.5K
SLoC
affinidi-crypto
Cryptographic primitives and JWK types for the Affinidi Trust Development Kit. Provides key generation, encoding, and conversion utilities across multiple elliptic curve families.
Supported Algorithms
| Algorithm | Feature Flag | Curve / Family |
|---|---|---|
| Ed25519 / X25519 | ed25519 |
Curve25519 |
| P-256 (secp256r1) | p256 |
NIST P-256 |
| P-384 | p384 |
NIST P-384 |
| secp256k1 | k256 |
secp256k1 |
| ML-DSA-44 / 65 / 87 | ml-dsa |
FIPS 204 (post-quantum) |
| SLH-DSA-SHA2-128s | slh-dsa |
FIPS 205 (post-quantum) |
The four classical curves are enabled by default. Post-quantum signatures
are off by default — enable post-quantum for both, or ml-dsa /
slh-dsa individually.
did:key Raw-Bytes Helpers
Under the ed25519 feature, the did_key module exposes a raw-bytes
API for apps doing HPKE, sealed transfer, or other non-DIDComm key
agreement: encode / decode between a did:key:z6Mk… identifier and a
[u8; 32] Ed25519 public key, and derive an X25519 public key without
round-tripping through a multikey string. The multikey-string helpers in
ed25519.rs remain for multikey-native callers.
Installation
[dependencies]
affinidi-crypto = "0.1"
Or with only specific curves:
[dependencies]
affinidi-crypto = { version = "0.1", default-features = false, features = ["ed25519", "p256"] }
WASM Support
This crate supports wasm32 targets with the getrandom/js feature
automatically enabled.
Related Crates
affinidi-encoding— Multibase/multicodec encoding (dependency)affinidi-secrets-resolver— Secret management built on this crateaffinidi-data-integrity— W3C Data Integrity proofs
License
Dependencies
~8–11MB
~216K SLoC