Copyright | Copyright © 2021 Lars Kuhtz <lakuhtz@gmail.com> |
---|---|
License | MIT |
Maintainer | Lars Kuhtz <lakuhtz@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data SipHashKey = SipHashKey !Word64 !Word64
- newtype SipHash (c :: Nat) (d :: Nat) = SipHash Word64
- sipHash :: SipHashKey -> Ptr Word8 -> Int -> IO (SipHash 2 4)
- sipHashCD :: forall c d. SipHashParam c => SipHashParam d => SipHashKey -> Ptr Word8 -> Int -> IO (SipHash c d)
- sipHash24 :: SipHashKey -> Ptr Word8 -> Int -> IO (SipHash 2 4)
- sipHash13 :: SipHashKey -> Ptr Word8 -> Int -> IO (SipHash 1 3)
- sipHash48 :: SipHashKey -> Ptr Word8 -> Int -> IO (SipHash 4 8)
- data SipHashContext (c :: Nat) (d :: Nat)
- sipHashInitialize :: SipHashKey -> SipHashContext c d
- sipHashUpdate :: forall (c :: Nat) (d :: Nat). SipHashParam c => SipHashContext c d -> Ptr Word8 -> Int -> IO (SipHashContext c d)
- sipHashFinalize :: forall (c :: Nat) (d :: Nat). SipHashParam c => SipHashParam d => SipHashContext c d -> SipHash c d
- module Data.Hash.Class.Pure.Salted
Documentation
data SipHashKey Source #
The Word46
constructor parameters represent the 128 bit key in little
endian encoding.
Instances
Eq SipHashKey Source # | |
Defined in Data.Hash.SipHash (==) :: SipHashKey -> SipHashKey -> Bool # (/=) :: SipHashKey -> SipHashKey -> Bool # | |
Ord SipHashKey Source # | |
Defined in Data.Hash.SipHash compare :: SipHashKey -> SipHashKey -> Ordering # (<) :: SipHashKey -> SipHashKey -> Bool # (<=) :: SipHashKey -> SipHashKey -> Bool # (>) :: SipHashKey -> SipHashKey -> Bool # (>=) :: SipHashKey -> SipHashKey -> Bool # max :: SipHashKey -> SipHashKey -> SipHashKey # min :: SipHashKey -> SipHashKey -> SipHashKey # | |
Show SipHashKey Source # | |
Defined in Data.Hash.SipHash showsPrec :: Int -> SipHashKey -> ShowS # show :: SipHashKey -> String # showList :: [SipHashKey] -> ShowS # |
newtype SipHash (c :: Nat) (d :: Nat) Source #
SipHash with c
compression rounds and d
finalization rounds.
Instances
Eq (SipHash c d) Source # | |
Ord (SipHash c d) Source # | |
Defined in Data.Hash.SipHash | |
Show (SipHash c d) Source # | |
(SipHashParam c, SipHashParam d) => IncrementalHash (SipHash c d) Source # | |
(SipHashParam c, SipHashParam d) => Hash (SipHash c d) Source # | |
type Context (SipHash c d) Source # | |
Defined in Data.Hash.SipHash | |
type Salt (SipHash c d) Source # | |
Defined in Data.Hash.SipHash |
sipHash :: SipHashKey -> Ptr Word8 -> Int -> IO (SipHash 2 4) Source #
SipHash, with recommended default parameters of c=2 and d=4.
The first and second argument is the 128 bit key, represented as two 64 bit words.
SipHash-c-d
sipHashCD :: forall c d. SipHashParam c => SipHashParam d => SipHashKey -> Ptr Word8 -> Int -> IO (SipHash c d) Source #
Generic SipHash with c rounds per block and d finalization rounds.
The first and second argument is the 128 bit key, represented as two 64 bit words.
sipHash24 :: SipHashKey -> Ptr Word8 -> Int -> IO (SipHash 2 4) Source #
SipHash-2-4
The first and second argument is the 128 bit key, represented as two 64 bit words.
sipHash13 :: SipHashKey -> Ptr Word8 -> Int -> IO (SipHash 1 3) Source #
SipHash-1-3
The first and second argument is the 128 bit key, represented as two 64 bit words.
sipHash48 :: SipHashKey -> Ptr Word8 -> Int -> IO (SipHash 4 8) Source #
SipHash-4-8
The first and second argument is the 128 bit key, represented as two 64 bit words.
Incremental SipHash
data SipHashContext (c :: Nat) (d :: Nat) Source #
Internal mutable SipHashContext.
The first four arguments are the internal state values \(v_{0..3}\) and the last argument represents the pending bytes from an incomplete word of the last chunk of input.
sipHashInitialize :: SipHashKey -> SipHashContext c d Source #
Initialize a new SipHashContext
sipHashUpdate :: forall (c :: Nat) (d :: Nat). SipHashParam c => SipHashContext c d -> Ptr Word8 -> Int -> IO (SipHashContext c d) Source #
Incrementally add input bytes to an SipHash computation and update the internal context.
sipHashFinalize :: forall (c :: Nat) (d :: Nat). SipHashParam c => SipHashParam d => SipHashContext c d -> SipHash c d Source #
Utils
module Data.Hash.Class.Pure.Salted