Skip to content

Convert BigIntegers to null-padded bytes without shifting per byte - #272

Merged
ic0ns merged 2 commits into
mainfrom
fix/null-padded-bytes-without-shifts
Nov 10, 2026
Merged

ic0ns merged 2 commits into
mainfrom
fix/null-padded-bytes-without-shifts

Conversation

@face-al

@face-al face-al commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Closes #271

  • Takes the low bytes of toByteArray() instead of one shiftRight per byte.
  • Same output for 200k random values (0-600 bits, edge cases, negatives) in DataConverterNullPaddedTest; allocation ~1.1 GB -> ~0 per TLS-Scanner scan.

@ic0ns
ic0ns merged commit ce60b02 into main Nov 10, 2026
13 checks passed
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.

bigIntegerToNullPaddedByteArray shifts the BigInteger once per byte

2 participants