Skip to content

Optimize crypto module performance with local caching#9

Merged
derek-miller merged 1 commit into
mainfrom
optimize
Jan 28, 2026
Merged

Optimize crypto module performance with local caching#9
derek-miller merged 1 commit into
mainfrom
optimize

Conversation

@derek-miller
Copy link
Copy Markdown
Contributor

  • Introduced local caching for string, table, and math functions across various crypto modules to enhance performance.
  • Replaced table lookups in hot loops with locally cached references.
  • Updated the following modules with caching optimizations:
    • blake2
    • poly1305
    • sha512
    • aes_gcm
    • chacha20
    • chacha20_poly1305
    • x25519
    • x448
  • Added ParsedProtocolName type annotation in init.lua for better type clarity.
  • Upgraded the bitn library to its latest version.

- Add local caching for string/table/math functions in all crypto modules
- Avoid table lookups in hot loops for better performance
- Update blake2, poly1305, sha512, aes_gcm, chacha20, chacha20_poly1305
- Update x25519, x448 with string/table function caching
- Refactor x25519 and aes_gcm to use standard Lua array indexing
- Add consistent helper functions for pre-allocating arrays
- Use bit64_new() consistently for Int64HighLow creation
- Add ParsedProtocolName type annotation to init.lua
- Update bitn library to latest version
@derek-miller derek-miller merged commit 529d980 into main Jan 28, 2026
8 checks passed
@derek-miller derek-miller deleted the optimize branch January 28, 2026 02:15
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