Commit Graph

13 Commits

Author SHA1 Message Date
Zoltán Kéri b9338777e3 encoding/base32: Fix buffer allocation and bounds checking
Fix buffer allocation size calculation and add proper bounds checking to
ensure output buffer has sufficient space. This fixes crashes that could
occur with inputs like "AA" and other edge cases where the output buffer
was too small.

Remove #no_bounds_check as proper bounds checking is necessary for safe
error handling. The small performance trade-off is worth the improved
robustness.
2024-12-24 02:20:32 +01:00
Zoltán Kéri 8c761627c8 encoding/base32: Replace assertions with error returns
Replace assertions with proper error handling in base32.decode() to allow
programs to handle invalid input gracefully rather than crashing.

The function now returns ([]byte, Error) instead of just []byte.
2024-12-24 02:17:57 +01:00
gingerBill 930c929294 Indentation fixes 2024-06-29 18:49:57 +01:00
gingerBill 334e08c750 Update numerous package declaration names 2024-04-18 12:17:39 +01:00
gingerBill 251da264ed Remove unneeded semicolons from the core library 2021-08-31 22:21:13 +01:00
gingerBill 10f91a0d3f Make base32 and base64 adhere to -strict-style 2021-03-14 12:54:28 +00:00
gingerBill 3bcccf88d5 vet all core packages 2021-01-09 23:43:34 +00:00
gingerBill fc4fdd588e Remove usage of do in core library 2020-09-23 17:17:14 +01:00
gingerBill 89d824216a Add extra information to -show-more-timings 2020-05-21 09:30:15 +01:00
zhibog 694ee02247 Missed one 2019-11-09 18:06:33 +01:00
zhibog 0451c88ab6 Fixed indenting 2019-11-09 18:04:30 +01:00
zhibog dc2d5239c5 Removed comments regarding RFC test vectors 2019-11-08 20:06:58 +01:00
zhibog 20db0e7f09 Added Base32 + official test vectors from the RFC 2019-11-01 22:35:09 +01:00