Module sodiumoxide::utils[][src]

Expand description

Libsodium utility functions

Functions

add_le

add_le() treats x and y as unsigned little-endian numbers and adds y to x modulo 2^(8*len) in constant time.

increment_le

increment_le() treats x as an unsigned little-endian number and increments it in constant time.

memcmp

memcmp() returns true if x[0], x[1], …, x[len-1] are the same as y[0], y[1], …, y[len-1]. Otherwise it returns false.

memzero

memzero() tries to effectively zero out the data in x even if optimizations are being applied to the code.

mlock

mlock() locks memory given region which can help avoiding swapping the sensitive memory region to disk.

munlock

munlock() unlocks memory region.