Skip to content

Add URL encoding, Punycode, AES modes, keyed BLAKE2, HOTP and more hashes - #2

Merged
dipu-bd merged 3 commits into
mainfrom
claude/project-thread-3fa77a
Dec 2, 2026
Merged

dipu-bd merged 3 commits into
mainfrom
claude/project-thread-3fa77a

Conversation

@dipu-bd

@dipu-bd dipu-bd commented Dec 2, 2026

Copy link
Copy Markdown
Member

Requested by Dipu · project thread

Engine side of the next three Toolbox tool sets. The site pages follow in a bitanon.github.io PR.

Op Adds
convert percent, percent-component, percent-form (URL encoding, both directions)
punycode (new) Punycode labels and IDN domains (xn--)
aes (new) ECB, CBC, CTR, CFB, CFB8, OFB, CCM, PCBC, IGE, XTS; padding PKCS#7, ANSI X9.23, ISO 7816-4, zero or none; random IV returned on encrypt; CCM tamper detection
blake2mac (new) Keyed BLAKE2b/BLAKE2s at any length up to the maximum
hotp (new) RFC 4226 codes for a counter and the next few
hash MD2, Keccak-224/384, BLAKE2b-160/384, BLAKE2s-128/160/224, RIPEMD-128/256/320; shakeBits for SHAKE at any length

Known-answer tests

65 VM tests (was 41) and 31 compiled-JavaScript checks (was 18), all passing. New vectors, with their sources cited in the tests:

  • NIST SP 800-38A F.2.1, F.3.7, F.3.13, F.4.1, F.5.1 (ECB, CBC, CFB8, CFB128, OFB, CTR)
  • RFC 3610 packet Use a plain tagline in the README #1 (CCM), including a tampered-ciphertext rejection
  • IEEE 1619-2007 vector 1 (XTS)
  • OpenSSL igetest.c (IGE). I also checked this one independently with pyca/cryptography.
  • RFC 4226 appendix D (HOTP, counters 0 to 9)
  • RFC 3492 sample L, plus Python's idna codec (Punycode)
  • Python's urllib.parse.quote / quote_plus and Dart's Uri.encodeComponent (percent encoding)
  • RFC 1319, the Keccak KAT, Bosselaers' RIPEMD page, and the BLAKE2 reference KAT files. Truncated BLAKE2 and long SHAKE outputs come from Python's hashlib.

PCBC has no published vector. It reuses cipherlib's independent reference (pyca's AES block with PCBC chaining written out by hand).

Merge note: the branch carries a no-change merge of its previous, already-merged head. "Squash and merge" gives one clean commit.


Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuCbv3a5X5mMTT8iAKym8
…shes

- `convert` gains percent (URL) encoding in three flavours, and a new
  `punycode` op covers labels and whole domains.
- New `aes` op: ECB, CBC, CTR, CFB, CFB8, OFB, CCM, PCBC, IGE and XTS with
  a padding choice. Encrypting without an IV picks a random one.
- New `blake2mac` (keyed BLAKE2b/s) and `hotp` ops.
- `hash` adds MD2, Keccak-224/384, BLAKE2b-160/384, BLAKE2s-128/160/224 and
  RIPEMD-128/256/320, and takes `shakeBits` for SHAKE at any length.

Every addition has a known-answer test from its spec (NIST SP 800-38A,
RFC 3610, IEEE 1619, RFC 4226, RFC 3492, RFC 1319, BLAKE2 KAT files) on
the VM and in the compiled JavaScript.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KmuCbv3a5X5mMTT8iAKym8
@dipu-bd dipu-bd self-assigned this Dec 2, 2026
@dipu-bd
dipu-bd merged commit 42d4bf8 into main Dec 2, 2026
1 check passed
@dipu-bd
dipu-bd deleted the claude/project-thread-3fa77a branch December 2, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants