ubl-crypto

Crates.ioubl-crypto
lib.rsubl-crypto
version0.1.0
created_at2026-01-10 16:35:24.539427+00
updated_at2026-01-10 16:35:24.539427+00
descriptionUBL crypto helpers: SK wrapper, KID, HMAC, did:key, batch verify for Universal Business Ledger.
homepagehttps://logline.foundation
repositoryhttps://github.com/LogLine-Foundation/logline-workspace
max_upload_size
id2034410
size30,644
(danvoulez)

documentation

https://docs.rs/ubl-crypto

README

ubl-crypto

crates.io docs.rs MSRV license

Crypto primitives for the LogLine Workspace.

Features

Hashing

  • blake3_hex — BLAKE3 hash → hex string
  • blake3_cid — BLAKE3 hash → Cid32 (ubl-types)
  • blake3_cid_chunks — Incremental BLAKE3 → Cid32

Ed25519 Signatures

  • SecretKey, Keypair — Key management with zeroize
  • sign_cid_hex, verify_cid_hex — Sign/verify CID hex strings
  • sign_bytes, verify_bytes — Sign/verify with ubl-types wrappers
  • derive_public_bytes — Derive PublicKeyBytes from secret seed

HMAC

  • hmac_sign, hmac_verify — HMAC-SHA256 with base64url

DID:key

  • did_key_encode_ed25519, did_key_decode_ed25519 — Ed25519 DID encoding

Key IDs

  • key_id_v1, key_id_v2 — Key identifier formats

Installation

[dependencies]
ubl-crypto = "0.3"

Quick Example

use ubl_crypto::{blake3_cid, derive_public_bytes, sign_bytes, verify_bytes};

// BLAKE3 → Cid32
let cid = blake3_cid(b"hello");
println!("cid = {cid}");

// Ed25519 with fixed seed (deterministic)
let sk = [7u8; 32];
let pk = derive_public_bytes(&sk);
let sig = sign_bytes(b"message", &sk);
assert!(verify_bytes(b"message", &pk, &sig));

Roadmap

  • Key rotation (KID + grace period)
  • AEAD for evidence encryption
  • KMS adapters

License

MIT OR Apache-2.0 © LogLine Foundation

Commit count: 14

cargo fmt