Skip to content

fix: canonicalize Ed25519 algorithm casing#24

Merged
GsCommand merged 1 commit into
mainfrom
codex/fix-ed25519-algorithm-casing-in-runtime-core
May 18, 2026
Merged

fix: canonicalize Ed25519 algorithm casing#24
GsCommand merged 1 commit into
mainfrom
codex/fix-ed25519-algorithm-casing-in-runtime-core

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Ensure runtime-core emits and verifies the canonical CLAS signature algorithm string Ed25519 so runtime does not need to normalize before verification.

Description

  • Change the canonical algorithm constant to SIGNATURE_ALG = "Ed25519" in src/crypto.ts and make signing functions emit metadata.proof.signature.alg via that constant.
  • Update verification logic in src/compat.ts and src/receipt.ts to treat Ed25519 as canonical while temporarily accepting legacy lowercase ed25519 by normalizing it internally before comparison.
  • Broaden proof type declarations to allow the legacy lowercase value for compatibility and update doc comments to document canonical Ed25519 and the temporary acceptance rule.
  • Update README.md to reference the canonical Ed25519, and add/update tests in test/compat.test.ts and test/receipt.test.ts to assert canonical emission, verification without caller normalization, legacy lowercase acceptance, and rejection of unsupported algorithms; files changed: README.md, src/crypto.ts, src/compat.ts, src/receipt.ts, test/compat.test.ts, test/receipt.test.ts; final SIGNATURE_ALG value is "Ed25519"; commit 02561debf528b4b38b6804cc9e65d6b68f0a42cc.

Testing

  • Ran npm install, npm run build, npm test, and npm run typecheck, and all commands completed successfully with npm test reporting 72 tests passed and 0 failures.
  • Tests added/updated verify that signing emits signature.alg === "Ed25519", that verifyCommandLayerReceipt() and verifyReceipt() accept canonical Ed25519 without caller-side normalization, that legacy lowercase ed25519 remains accepted for compatibility, and that unsupported signature algorithms fail as expected, and all these tests passed.

Codex Task

@GsCommand GsCommand merged commit 8fcebef into main May 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant