Module utils
Libsodium utility functions
add_le() treats x and y as unsigned little-endian numbers and adds y to x modulo 2^(8*len) in constant time.
add_le()
x
y
increment_le() treats x as an unsigned little-endian number and increments it in constant time.
increment_le()
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.
memcmp()
x[0]
x[1]
x[len-1]
y[0]
y[1]
y[len-1]
false
memzero() tries to effectively zero out the data in x even if optimizations are being applied to the code.
memzero()
mlock() locks memory given region which can help avoiding swapping the sensitive memory region to disk.
mlock()
munlock() unlocks memory region.
munlock()