spake2-0.4.2: Implementation of the SPAKE2 Password-Authenticated Key Exchange algorithm
Safe HaskellNone
LanguageHaskell2010

Crypto.Spake2.Util

Description

 
Synopsis

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.

unsafeNumberToBytes :: ByteArray bytes => Int -> Integer -> bytes Source #

Serialize a number according to the SPAKE2 protocol.

Panics if the number is too big to fit into the given number of bytes.