Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- expandData :: (ByteArrayAccess input, ByteArray output) => ByteString -> input -> Int -> output
- expandArbitraryElementSeed :: (ByteArrayAccess ikm, ByteArray out) => ikm -> Int -> out
- bytesToNumber :: ByteArrayAccess bytes => bytes -> Integer
- numberToBytes :: ByteArray bytes => Int -> Integer -> Maybe bytes
- unsafeNumberToBytes :: ByteArray bytes => Int -> Integer -> bytes
Documentation
expandData :: (ByteArrayAccess input, ByteArray output) => ByteString -> input -> Int -> output Source #
Take an arbitrary sequence of bytes and expand it to be the given number of bytes. Do this by extracting a pseudo-random key and expanding it using HKDF.
expandArbitraryElementSeed :: (ByteArrayAccess ikm, ByteArray out) => ikm -> Int -> out Source #
Given a seed value for an arbitrary element (see arbitraryElement
),
expand it to be of the given length.
bytesToNumber :: ByteArrayAccess bytes => bytes -> Integer Source #
Deserialize a number according to the SPAKE2 protocol.
Just kidding, there isn't a SPAKE2 protocol. This just matches the Python implementation.
Inverse of numberToBytes
.
numberToBytes :: ByteArray bytes => Int -> Integer -> Maybe bytes Source #
Serialize a number according to the SPAKE2 protocol.
Just kidding, there isn't a SPAKE2 protocol. This just matches the Python implementation.
Inverse of bytesToNumber
.