Skip to content

Commit 0511b68

Browse files
perturbingch1bo
authored andcommitted
add initial req for crypto to impact analysis
1 parent 9a8152b commit 0511b68

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

docs/ImpactAnalysis.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,51 @@ The following experiments each pertain to several of the risks above.
417417
418418
# Cryptography
419419

420-
> [!WARNING]
421-
> TODO: Describe requirements and changes to the **Cryptography / Cardano base components**
420+
This section derives **requirements** for adding BLS signatures to `cardano-base` and sketches **changes** to satisfy them. The scope is limited to cryptographic primitives and their integration into existing classes; vote construction/logic is out of scope. This work should align with [this](https://www.ietf.org/archive/id/draft-irtf-cfrg-bls-signature-05.html) IETF draft.
421+
422+
> Note that with the implementation of [CIP-0381](https://cips.cardano.org/cip/CIP-0381) `cardano-base` already contains basic utility functions needed to create these bindings; the work below is thus expanding on that.
423+
424+
## Requirements
425+
426+
### Functional
427+
428+
- *REQ-BlsKeyGenSecure*.
429+
Provide secure key generation with strong randomness requirements, resistance to side-channel leakage.
430+
- *REQ-BlsVariantAbstraction*.
431+
Support both BLS variants—small public key and small signature—behind a single abstraction. Public APIs are variant-agnostic.
432+
- *REQ-BlsSkToPk*.
433+
Deterministic sk → pk derivation for the chosen variant.
434+
- *REQ-BlsSignVerify*.
435+
Signature generation and verification APIs, variant-agnostic and domain-separated (DST supplied by caller). Besides the DST, the interface should also implement a per message augmentation (as the hash to curve function also has in the IETF draft)
436+
- *REQ-BlsPoP*.
437+
Proof-of-Possession creation and verification to mitigate rogue-key attacks.
438+
- *REQ-BlsAggregateSignatures*.
439+
Aggregate a list of public keys and signatures into one
440+
- *REQ-BlsBatchVerify*.
441+
Batch verification API for efficient verification of many `(pk, msg, sig)` messages.
442+
- *REQ-BlsTypes*.
443+
Introduce opaque types for `SecretKey`, `PublicKey`, `Signature`, and `AggSignature` (if needed by consensus).
444+
- *REQ-BlsDSIGNIntegration*.
445+
Provide a `DSIGN` instance so consensus can use BLS via the existing `DSIGN` class, including aggregation-capable helpers where appropriate.
446+
- *REQ-BlsSerialisation*.
447+
Deterministic serialisation: `ToCBOR`/`FromCBOR` and raw-bytes for keys/signatures; strict length/subgroup/infinity checks; canonical compressed encodings as per the Zcash standard for BLS points.
448+
- *REQ-BlsConformanceVectors*.
449+
Add conformance tests using test vectors from the Rust implementation to ensure cross-impl compatibility.
450+
451+
### Non-functional
452+
453+
- *REQ-BlsPerfBenchmarks*.
454+
Benchmark single-verify, aggregate-verify, and batch-verify; report the impact of batching vs individual verification.
455+
- *REQ-BlsRustParity*.
456+
Compare performance against the Rust implementation; document gaps and ensure functional parity on vectors.
457+
- *REQ-BlsDeterminismPortability*.
458+
Deterministic results across platforms/architectures; outputs independent of CPU feature detection.
459+
460+
### Remarks
461+
462+
- Note that the PoP checks probably are done at the certificate level, and that the above-described API should not be responsible for this.
463+
- The current code on BLS12-381 already abstracts over both curves `G1`/`G2`, we should maintain this.
464+
- The `BLST` package also exposes fast verification over many messages and signatures + public keys by doing a combined pairing check. This might be helpful, though it's currently unclear if we can use this speedup. It might be the case, since we have *linear Leios, that this is never needed.
422465

423466
# Performance & Tracing (P&T)
424467

0 commit comments

Comments
 (0)