botan-low-0.0.1.0: Low-level Botan bindings
Copyright(c) Leo D 2023
LicenseBSD-3-Clause
Maintainerleo@apotheca.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Botan.Low.Utility

Description

 
Synopsis

Documentation

constantTimeCompare Source #

Arguments

:: ByteString

x

-> ByteString

y

-> Int

len

-> IO Bool 

Returns 0 if x[0..len] == y[0..len], -1 otherwise.

scrubMem Source #

Arguments

:: Ptr a

mem

-> Int

bytes

-> IO () 

hexEncode Source #

Arguments

:: ByteString

x

-> HexEncodingFlags

flags

-> IO Text

y

Performs hex encoding of binary data in x of size len bytes. The output buffer out must be of at least x*2 bytes in size. If flags contains BOTAN_FFI_HEX_LOWER_CASE, hex encoding will only contain lower-case letters, upper-case letters otherwise. Returns 0 on success, 1 otherwise. DISCUSS: Handling of positive return code / BOTAN_FFI_INVALID_VERIFIER? DISCUSS: Use of Text.decodeUtf8 - bad, partial function! - but safe here?

hexDecode Source #

Arguments

:: Text

hex_str

-> IO ByteString

out

"Hex decode some data" DISCUSS: Return value, maybe vs exception DISCUSS: Botan documentation is lacking here WARNING: Does not actually check that len is a multiple of 2

base64Decode Source #

Arguments

:: Text

base64_str

-> IO ByteString

out

Ditto everything hexDecode