Skip to content

Align PHP Randflake parity with original implementation#1

Open
lemon-mint wants to merge 1 commit into
Adambean:mainfrom
lemon-mint:main
Open

Align PHP Randflake parity with original implementation#1
lemon-mint wants to merge 1 commit into
Adambean:mainfrom
lemon-mint:main

Conversation

@lemon-mint
Copy link
Copy Markdown

Align PHP Randflake parity with original implementation

Summary

Align the PHP implementation with the original Go/Python/TypeScript Randflake behavior.

Changes

  • Use little-endian SPARX-64 packing/unpacking to match the original implementation.
  • Replace RFC4648 byte-stream Base32Hex with Randflake’s mathematical base32hex conversion.
  • Remove the unused Paragon ConstantTime Base32Hex dependency.
  • Preserve secret bytes exactly instead of trimming them.
  • Add upstream official test vectors and verify encryption, encoding, decoding, decryption, and
    inspect output.

Verification

  • Used the official Randflake test vectors from the upstream Go implementation.
  • phpunit
  • phpstan analyse
  • php-cs-fixer --dry-run
  • composer validate --strict

Use the upstream official test vectors to verify encrypted IDs, base32hex strings, and inspect output against the Go implementation. Switch SPARX-64 packing to little-endian and replace RFC4648 byte Base32Hex with Randflake's mathematical base32hex conversion.
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.

1 participant