@@ -27,24 +27,24 @@ data AEADModeImpl st = AEADModeImpl
27
27
-- | Authenticated Encryption with Associated Data algorithms
28
28
data AEAD cipher = forall st . AEAD
29
29
{ aeadModeImpl :: AEADModeImpl st
30
- , aeadState :: st
30
+ , aeadState :: ! st
31
31
}
32
32
33
33
-- | Append some header information to an AEAD context
34
34
aeadAppendHeader :: ByteArrayAccess aad => AEAD cipher -> aad -> AEAD cipher
35
- aeadAppendHeader (AEAD impl st) aad = AEAD impl $ ( aeadImplAppendHeader impl) st aad
35
+ aeadAppendHeader (AEAD impl st) aad = AEAD impl $ aeadImplAppendHeader impl st aad
36
36
37
37
-- | Encrypt some data and update the AEAD context
38
38
aeadEncrypt :: ByteArray ba => AEAD cipher -> ba -> (ba , AEAD cipher )
39
- aeadEncrypt (AEAD impl st) ba = second (AEAD impl) $ ( aeadImplEncrypt impl) st ba
39
+ aeadEncrypt (AEAD impl st) ba = second (AEAD impl) $ aeadImplEncrypt impl st ba
40
40
41
41
-- | Decrypt some data and update the AEAD context
42
42
aeadDecrypt :: ByteArray ba => AEAD cipher -> ba -> (ba , AEAD cipher )
43
- aeadDecrypt (AEAD impl st) ba = second (AEAD impl) $ ( aeadImplDecrypt impl) st ba
43
+ aeadDecrypt (AEAD impl st) ba = second (AEAD impl) $ aeadImplDecrypt impl st ba
44
44
45
45
-- | Finalize the AEAD context and return the authentication tag
46
46
aeadFinalize :: AEAD cipher -> Int -> AuthTag
47
- aeadFinalize (AEAD impl st) n = ( aeadImplFinalize impl) st n
47
+ aeadFinalize (AEAD impl st) = aeadImplFinalize impl st
48
48
49
49
-- | Simple AEAD encryption
50
50
aeadSimpleEncrypt :: (ByteArrayAccess aad , ByteArray ba )
0 commit comments