Documentation
¶
Index ¶
Constants ¶
const ( RNDGETENTCNT = 0x80045200 RNDADDTOENTCNT = 0x40045201 RNDGETPOOL = 0x80085202 RNDADDENTROPY = 0x40085203 RNDZAPENTCNT = 0x5204 RNDCLEARPOOL = 0x5206 RNDRESEEDCRNG = 0x5207 )
Variables ¶
This section is empty.
Functions ¶
func AddEntropy ¶
AddEntropy will add the contents of `buf` to the entropy pool. The kernel takes these bytes and "mixes" tthem * using a CRC-like algorithm. Additionally, cnt is added to the entropy count (see `AddToEntCnt()`). * * This is like writing data to `/dev/(u)random`, then calling RNDADDTOENTCOUNT. * * AddEntropy is a wrapper around the RNDADDENTROPY IOCTL on `/dev/(u)random`.
func AddToEntCnt ¶
AddToEntCnt adds the specified integer to the entropy count. * * Note: this does not directly add to the value, but adds by an algorithm that asymptotically * approaches the pool size. See `devices/char/random.c` in the kernel source code for details. * * AddToEntCnt is a wrapper around the RNDADDTOENTCNT IOCTL on `/dev/(u)random`.
func ClearPool ¶
func ClearPool() error
* ClearPool clears the entropy pool counters (i.e. the entropy count). Historically, this also cleared all of the * bytes in the entropy pool, but on modern kernels this is just an alias for ZapEntCnt. * * ClearPool is a wrapper around the RNDCLEARPOOL IOCTL on `/dev/(u)random`.
func GetEntCnt ¶
GetEntCnt returns the current count for the system. * * This is the same as reading the contents of `/proc/sys/kernel/random/entropy_avail`, but is accomplished through the RNDGETENTCNT IOCTL. * * GetEntCnt is a wrapper around the RNDGETENTCNT IOCTL on `/dev/(u)random`.
func ReseedCrng ¶
func ReseedCrng() error
* ReseedCrng will re-seed the CRNG used to generate `/dev/urandom`. * * ReseedCrng is a wrapper around the RNDRESEEDCRNG IOCTL on `/dev/(u)random`
func ZapEntCnt ¶
func ZapEntCnt() error
* ZapEntCnt clears the entropy pool counters (i.e the entropy count). This might be useful if, for instance, you * suspect your entropy pool is tainted or your entropy count has been artificially inflated. * * ZapEntCnt is a wrapper around the RNDZAPENTCNT IOCTL on `/dev/(u)random`.
Types ¶
This section is empty.