Skip to content

crypto_verify

John Regan edited this page Jan 3, 2021 · 1 revision

Wrappers for the crypto_verify functions.

Synopsis

local luasodium = require'luasodium'

local message = string.rep('\0',16)
local message2 = string.rep('\0',16)
assert(luasodium.crypto_verify_16(message, message2) == true)

Functions

crypto_verify_16

syntax: boolean equal = luasodium.crypto_verify_16(string message1, string message2)

Performs a constant-time comparison between message1 and message2, both strings must be 16 bytes.

crypto_verify_32

syntax: boolean equal = luasodium.crypto_verify_32(string message1, string message2)

Performs a constant-time comparison between message1 and message2, both strings must be 32 bytes.

Clone this wiki locally