package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Feb 16, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Mathutils
Mathematical utility functions for cryptographic and numerical operations.
Features
- Random Number Generation - Generate random uint64 values and ranges from a PRNG
- Integer Operations - Ceiling division and floor logarithm functions
Designed for cryptographic use with proper rejection sampling for uniform distribution.
Documentation
¶
Package mathutils provides mathematical utility functions for cryptographic and numerical operations.
See README.md for details.
func CeilDiv(numerator, denominator int) int
CeilDiv returns `ceil(numerator/denominator) for integer inputs. Equivalently,
it returns `x`, the smallest integer that satisfies `(x*b) >= a`.
CeilLog2 return ceil(log2(x)).
FloorLog2 return floor(log2(x)).
RandomUint64 samples a random uint64 from the provided PRNG.
RandomUint64Range samples a random uint64 in the range [0, bound) from the provided PRNG.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.