-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | binary strings supporting constant-time base16 and comparisons -- -- binary string types supporting constant-time base16 encoding and -- decoding, as well as constant time lexicographic comparisons. Note -- that the time required does depend linearly on length, but is -- otherwise data-independent. @package hash-string @version 0.1.0.0 module Crypto.HashString.FFI -- | Type intended to represent short-ish cryptographic values, say up to -- 128 bytes or so. Supports constant-time comparisons (i.e. run time -- depends on length of the inputs but is otherwise independent of -- content), as well as constant-time base16 and base64 conversions. newtype HashString HashString :: ByteArray -> HashString [unHashString] :: HashString -> ByteArray base16EncodeLength :: Int -> Int base16DecodeLength :: Int -> Maybe Int c_const_memcmp_ba :: ByteArray# -> ByteArray# -> CSize -> CInt c_hexDecode_ba :: MutableByteArray# RealWorld -> ByteArray# -> CSize -> IO CInt c_hexDecode_mba_bs :: MutableByteArray# RealWorld -> CString -> CSize -> IO CInt c_hexEncode_ba :: MutableByteArray# RealWorld -> ByteArray# -> CSize -> IO () c_hexEncode_bs_ba :: Ptr Word8 -> ByteArray# -> CSize -> IO () c_xorleft_ba :: ByteArray# -> CSize -> ByteArray# -> CSize -> MutableByteArray# RealWorld -> IO () c_xormin_ba :: ByteArray# -> ByteArray# -> CSize -> MutableByteArray# RealWorld -> IO () c_xormax_ba :: ByteArray# -> CSize -> ByteArray# -> CSize -> MutableByteArray# RealWorld -> IO () -- | binary string types supporting constant-time base16 encoding and -- decoding, as well as constant time lexicographic comparisons. Note -- that the time required does depend linearly on length, but is -- otherwise data-independent. module Crypto.HashString -- | Type intended to represent short-ish cryptographic values, say up to -- 128 bytes or so. Supports constant-time comparisons (i.e. run time -- depends on length of the inputs but is otherwise independent of -- content), as well as constant-time base16 and base64 conversions. data HashString fromShort :: ShortByteString -> HashString fromShortBase16 :: ShortByteString -> Maybe HashString toShort :: HashString -> ShortByteString toShortBase16 :: HashString -> ShortByteString fromByteString :: ByteString -> HashString fromBase16 :: ByteString -> Maybe HashString toByteString :: HashString -> ByteString toBase16 :: HashString -> ByteString toBase16Builder :: HashString -> Builder -- | Xor two hashstrings. The length of the result is always the same as -- the length of the left argument; bytes are either removed from or -- added to the end of the right argument as needed to match length. xorLeft :: HashString -> HashString -> HashString -- | Xor two hashstrings. The length of the result is always the same as -- the length of the shorter argument, removing bytes from the end of the -- longer string as needed to match length. xorMin :: HashString -> HashString -> HashString -- | Xor two hashstrings. The length of the result is always the same as -- the length of the longer argument, adding null bytes onto the end of -- the shorter string as needed to match length. xorMax :: HashString -> HashString -> HashString takeBytes :: Foldable f => Int -> f HashString -> [HashString]