otp_crypto/utils library
OTP Crypto – Low-level utilities
Collection of byte helpers used across the crypto stack:
- Base64 (standard) encode/decode with padding normalization
- u64 big-endian encoding (for window field)
- Constant-time byte equality
- Byte concatenation / zeroization
SECURITY NOTES:
constantTimeEquals
prevents timing leaks when comparing MACs.- Use
secureZero
on temporary sensitive buffers you control. fromBase64Strict
rejects invalid Base64 (after trimming whitespace).
Classes
- Bytes
- Misc byte helpers.