diff --git a/crates/twigpine-node/src/ans104.rs b/crates/twigpine-node/src/ans104.rs index 07819a65..8f3f5119 100644 --- a/crates/twigpine-node/src/ans104.rs +++ b/crates/twigpine-node/src/ans104.rs @@ -90,9 +90,8 @@ use sha2::{Digest, Sha256, Sha384}; /// The signature type byte for Ed25519. ANS-104 defines several /// signature algorithms. Binary parsing accepts the spec signature /// types (1 to 4), but `sign_data_item` and `verify_data_item` on this -/// slice support Ed25519 (sigtype 2) only. The Ethereum golden output -/// is illustrative and non-normative (see -/// `scripts/ans104_golden_output.txt`). +/// slice support Ed25519 (sigtype 2) only. The golden vector is +/// Ed25519 (see `scripts/ans104_golden_output.txt`). pub const SIGNATURE_TYPE_ED25519: u8 = 2; #[allow(dead_code)] // used by the binary golden-vector test; clippy sees no caller at the bin-build level pub const SIGNATURE_TYPE_ETHEREUM: u8 = 3; @@ -991,8 +990,7 @@ mod tests { //! module (low-level primitives) AND the golden vector in //! `dataitem_matches_arbundles_golden_vector` — a real signed //! DataItem captured from arbundles 0.10.x via - //! `scripts/ans104_golden_ed25519.mjs` (Ed25519 interop pin; the legacy - //! Ethereum script `scripts/ans104_golden.mjs` is illustrative only). The team memory + //! `scripts/ans104_golden_ed25519.mjs` (the Ed25519 interop pin). The team memory //! `self-roundtrip-tests-do-not-prove-interop.md` is the policy. use super::*; use twigpine_core::identity::Keypair; diff --git a/scripts/ans104_golden.mjs b/scripts/ans104_golden.mjs deleted file mode 100644 index e9c2b69e..00000000 --- a/scripts/ans104_golden.mjs +++ /dev/null @@ -1,33 +0,0 @@ -import { createData, EthereumSigner } from "arbundles"; -import { createHash } from "node:crypto"; -import base64url from "base64url"; - -const data = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-=[]{};':\",./<>?`~"; -const tags = [ - { name: "tag1", value: "value1" }, - { name: "tag2", value: "value2" }, -]; -const anchor = "thisSentenceIs32BytesLongTrustMe"; -const target = "OXcT1sVRSA5eGwt2k6Yuz8-3e3g9WJi5uSE99CWqsBs"; -const signer = new EthereumSigner("8da4ef21b864d2cc526dbdb2a120bd2874c36c9d0a1fb7f8c63d7f7a8b41de8f"); - -const item = createData(data, signer, { anchor, target, tags }); -// Sign so the captured signature is real: `createData` alone leaves a -// zeroed placeholder, whose id is just sha256(zeros). -await item.sign(signer); -const raw = item.getRaw(); -const id = item.id; - -// `item.signature` is base64url(rawSignature). Decode and sha256. -const sigBytes = base64url.toBuffer(item.signature); -const idCheck = base64url.encode(createHash("sha256").update(sigBytes).digest()); -if (idCheck !== id) { - console.error(`MISMATCH: id=${id} sha256(sig)=${idCheck}`); - process.exit(1); -} - -console.log("id =", id); -console.log("signature_b64=", item.signature); -console.log("signature_len=", sigBytes.length); -console.log("binary_len =", raw.length); -console.log("binary_hex =", raw.toString("hex")); diff --git a/scripts/ans104_golden_output.txt b/scripts/ans104_golden_output.txt index 49e55d0c..793588ed 100644 --- a/scripts/ans104_golden_output.txt +++ b/scripts/ans104_golden_output.txt @@ -34,6 +34,7 @@ The Rust side will: 4. Assert sha256(signature_bytes) base64url-encodes to the captured id. 5. Assert to_binary round-trips byte-exact (signature slot preserved). -Legacy Ethereum script (scripts/ans104_golden.mjs) now signs before -capture as well; its output is illustrative only — the node verifies -Ed25519 (sigtype 2) on the verify path. +The node verifies Ed25519 (sigtype 2) on the verify path. An older script +that signed an illustrative Ethereum (sigtype 3) item was removed: nothing +pinned its output, and it was the only caller of elliptic's ECDSA +(GHSA-848j-6mx2-7j84, no patched version).