Skip to content

Commit

Permalink
Remove sodium_compare() from the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Nov 1, 2015
1 parent afa8623 commit 1fa3b53
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,3 @@ It runs in constant-time for a given length, and considers the number to be enco

This function was introduced in libsodium 1.0.4.

## Comparing large numbers

```c
int sodium_compare(const unsigned char *b1_, const unsigned char *b2, size_t len);
```
The `sodium_compare()` function returns `-1` if `b1_`, as a number encoded in little-endian format, is lower than `b2_`.
It returns `1` if, using the same encoding, `b1_` is greater than `b2_`.
Finally, it returns `0` if `b1_` and `b2_` are identical.
This function can be used to compare nonces and counters in constant time.
In order to check only for equality, `sodium_memcmp()` is preferred, as it is faster.
`sodium_compare()` was introduced in libsodium 1.0.4.

0 comments on commit 1fa3b53

Please sign in to comment.