libsodium-bindings-0.0.1.1: FFI bindings to libsodium
Copyright(C) Koz Ross 2022
LicenseBSD-3-Clause
Maintainerkoz.ross@retro-freedom.nz
StabilityStable
PortabilityGHC only
Safe HaskellTrustworthy
LanguageHaskell2010

LibSodium.Bindings.Comparison

Description

Secure comparison functions, designed to run in constant time for a given input length.

Synopsis

Documentation

sodiumMemcmp Source #

Arguments

:: Ptr CUChar

First location with data to compare

-> Ptr CUChar

Second location with data to compare

-> CSize

How many bytes to compare

-> CInt

0 if all bytes match, -1 otherwise

Compares the given amount of bytes at the given locations for equality. Constant-time for any given length.

See: sodium_memcmp()

Since: 0.0.1.0

sodiumIsZero Source #

Arguments

:: Ptr CUChar

Location with data to check

-> CSize

How many bytes to check

-> CInt

1 if all the bytes were zeroes, 0 otherwise

Checks if the given number of bytes at the given location are all equal to zero. Constant-time for any given length.

See: sodium_is_zero()

Since: 0.0.1.0