sodium_add

Adding large numbers

The sodium_add() function accepts two arrays of unsigned numbers encoded in little- endian format, a and b, both of size len bytes. It computes (a + b) mod 2^(8*len) in constant time for a given length, and overwrites a with the result.

  1. alias sodium_add = deimos.sodium.utils.sodium_add
  2. void sodium_add(ubyte[] a, ubyte[] b)
    pragma(inline, true) @nogc @trusted
    void
    sodium_add
    (
    scope ubyte[] a
    ,
    scope const ubyte[] b
    )

Throws

NoGcException, if a_.length != b.length

See Also

Meta

History

This function was introduced in libsodium 1.0.7.