Status lives in ../PORTING-STATUS.md. Port faithfully from reference/didwebvh-java/;
never commit.
crypto/ScidGenerator.java, crypto/EntryHashGenerator.java, crypto/PreRotationHashGenerator.java
(spec §3.7.3, §3.7.4, §3.7.7; see ../ARCHITECTURE.md).
scid_generator.dart,entry_hash_generator.dart,pre_rotation_hash_generator.dart.
Vector-gated: known SCIDs and entry hashes from test-vectors/ and interop/ must match exactly.
- Generated SCID/entry-hash/pre-rotation-hash equal the vector values byte-for-byte.
- Ported the three Java classes 1:1 as
abstract final class(static-only utilities, Dart's analog of the Javafinal class+ private constructor). They reuse the iteration-2 primitives (Jcs.canonicalize,MultihashUtil.hashAndEncode,Base58Btc.encode); all three SCID/entry/pre-rotation outputs are bare base58btc with nozmultibase prefix, matching Java'sBase58Btc.encode. EntryHashGenerator.generate: Java parses the entry JSON into a GsonJsonObject, removesproof, setsversionId, thenJcs.canonicalize(JsonObject)— whose object overload internally re-serializes and re-parses. The Dart port instead decodes to aMap, mutates (remove('proof'),['versionId'] = predecessor), and canonicalizes the map directly via the newJcs.canonicalizeValue— no encode→parse round-trip. This is the idiomatic Dart shape (we hold a decoded value) and is byte-identical to the string path (asserted by aJcsunit test) and to the vectors (entry-hash-chain test). Decision recorded inPORTING-DECISIONS.md§8; the same change was applied toProofGenerator(iteration 4) for consistency.ScidGenerator.verify: mirrors Java'sparams.merge(new Parameters().setScid("{SCID}")). Java would NPE ifgetParameters()were null; the Dart port usesparams!to reproduce that throw-on-null for invalid input (a real first entry always has parameters).- Kept the generators package-private (not re-exported by the barrel), consistent with how iteration 2 left the
crypto primitives; tests import them via
package:didwebvh/src/crypto/.... - Gate:
tool/verify.sh --coverage→VERIFY OK, 130 tests pass; all three new generator files appear incoverage/lcov.info. Includes theJcs.canonicalizeValuework (see above) and its equivalence test.