fix digest size for nat-typed blake2
This commit is contained in:
parent
ccc3930072
commit
9d43c332de
@ -64,7 +64,7 @@ instance (IsDivisibleBy8 bitlen, KnownNat bitlen, IsAtLeast bitlen 8, IsAtMost b
|
|||||||
=> HashAlgorithm (Blake2s bitlen)
|
=> HashAlgorithm (Blake2s bitlen)
|
||||||
where
|
where
|
||||||
type HashBlockSize (Blake2s bitlen) = 64
|
type HashBlockSize (Blake2s bitlen) = 64
|
||||||
type HashDigestSize (Blake2s bitlen) = bitlen
|
type HashDigestSize (Blake2s bitlen) = Div8 bitlen
|
||||||
type HashInternalContextSize (Blake2s bitlen) = 185
|
type HashInternalContextSize (Blake2s bitlen) = 185
|
||||||
hashBlockSize _ = 64
|
hashBlockSize _ = 64
|
||||||
hashDigestSize _ = byteLen (Proxy :: Proxy bitlen)
|
hashDigestSize _ = byteLen (Proxy :: Proxy bitlen)
|
||||||
@ -99,7 +99,7 @@ instance (IsDivisibleBy8 bitlen, KnownNat bitlen, IsAtLeast bitlen 8, IsAtMost b
|
|||||||
=> HashAlgorithm (Blake2b bitlen)
|
=> HashAlgorithm (Blake2b bitlen)
|
||||||
where
|
where
|
||||||
type HashBlockSize (Blake2b bitlen) = 128
|
type HashBlockSize (Blake2b bitlen) = 128
|
||||||
type HashDigestSize (Blake2b bitlen) = bitlen
|
type HashDigestSize (Blake2b bitlen) = Div8 bitlen
|
||||||
type HashInternalContextSize (Blake2b bitlen) = 361
|
type HashInternalContextSize (Blake2b bitlen) = 361
|
||||||
hashBlockSize _ = 128
|
hashBlockSize _ = 128
|
||||||
hashDigestSize _ = byteLen (Proxy :: Proxy bitlen)
|
hashDigestSize _ = byteLen (Proxy :: Proxy bitlen)
|
||||||
@ -122,7 +122,7 @@ instance (IsDivisibleBy8 bitlen, KnownNat bitlen, IsAtLeast bitlen 8, IsAtMost b
|
|||||||
=> HashAlgorithm (Blake2sp bitlen)
|
=> HashAlgorithm (Blake2sp bitlen)
|
||||||
where
|
where
|
||||||
type HashBlockSize (Blake2sp bitlen) = 64
|
type HashBlockSize (Blake2sp bitlen) = 64
|
||||||
type HashDigestSize (Blake2sp bitlen) = bitlen
|
type HashDigestSize (Blake2sp bitlen) = Div8 bitlen
|
||||||
type HashInternalContextSize (Blake2sp bitlen) = 2185
|
type HashInternalContextSize (Blake2sp bitlen) = 2185
|
||||||
hashBlockSize _ = 64
|
hashBlockSize _ = 64
|
||||||
hashDigestSize _ = byteLen (Proxy :: Proxy bitlen)
|
hashDigestSize _ = byteLen (Proxy :: Proxy bitlen)
|
||||||
@ -145,7 +145,7 @@ instance (IsDivisibleBy8 bitlen, KnownNat bitlen, IsAtLeast bitlen 8, IsAtMost b
|
|||||||
=> HashAlgorithm (Blake2bp bitlen)
|
=> HashAlgorithm (Blake2bp bitlen)
|
||||||
where
|
where
|
||||||
type HashBlockSize (Blake2bp bitlen) = 128
|
type HashBlockSize (Blake2bp bitlen) = 128
|
||||||
type HashDigestSize (Blake2bp bitlen) = bitlen
|
type HashDigestSize (Blake2bp bitlen) = Div8 bitlen
|
||||||
type HashInternalContextSize (Blake2bp bitlen) = 2325
|
type HashInternalContextSize (Blake2bp bitlen) = 2325
|
||||||
hashBlockSize _ = 128
|
hashBlockSize _ = 128
|
||||||
hashDigestSize _ = byteLen (Proxy :: Proxy bitlen)
|
hashDigestSize _ = byteLen (Proxy :: Proxy bitlen)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user