Merge branch 'master' of https://github.com/haskell-crypto/cryptonite
This commit is contained in:
commit
605e5cf6a6
@ -12,7 +12,7 @@
|
|||||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||||
module Crypto.MAC.CMAC
|
module Crypto.MAC.CMAC
|
||||||
( cmac
|
( cmac
|
||||||
, CMAC(..)
|
, CMAC
|
||||||
, subKeys
|
, subKeys
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@ -24,9 +24,9 @@ import Crypto.Cipher.Types
|
|||||||
import Crypto.Internal.ByteArray (ByteArrayAccess, ByteArray, Bytes)
|
import Crypto.Internal.ByteArray (ByteArrayAccess, ByteArray, Bytes)
|
||||||
import qualified Crypto.Internal.ByteArray as B
|
import qualified Crypto.Internal.ByteArray as B
|
||||||
|
|
||||||
|
-- | Authentication code
|
||||||
newtype CMAC a = CMAC { cmacGetBytes :: Bytes }
|
newtype CMAC a = CMAC Bytes
|
||||||
deriving ByteArrayAccess
|
deriving (ByteArrayAccess)
|
||||||
|
|
||||||
instance Eq (CMAC a) where
|
instance Eq (CMAC a) where
|
||||||
CMAC b1 == CMAC b2 = B.constEq b1 b2
|
CMAC b1 == CMAC b2 = B.constEq b1 b2
|
||||||
|
|||||||
@ -61,7 +61,7 @@ msg0 :: ByteString
|
|||||||
msg0 = BS.empty
|
msg0 = BS.empty
|
||||||
|
|
||||||
bsCMAC :: BlockCipher k => k -> ByteString -> ByteString
|
bsCMAC :: BlockCipher k => k -> ByteString -> ByteString
|
||||||
bsCMAC k = B.convert . CMAC.cmacGetBytes . CMAC.cmac k
|
bsCMAC k = B.convert . CMAC.cmac k
|
||||||
|
|
||||||
gAES128 :: TestTree
|
gAES128 :: TestTree
|
||||||
gAES128 =
|
gAES128 =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user