diff options
Diffstat (limited to 'src/BTLS/BoringSSL/HMAC.chs')
-rw-r--r-- | src/BTLS/BoringSSL/HMAC.chs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/BTLS/BoringSSL/HMAC.chs b/src/BTLS/BoringSSL/HMAC.chs index 5c53122..1e5e82c 100644 --- a/src/BTLS/BoringSSL/HMAC.chs +++ b/src/BTLS/BoringSSL/HMAC.chs @@ -36,18 +36,15 @@ mallocHMACCtx = createWithFinalizer {#call HMAC_CTX_init as ^#} hmacCtxCleanup foreign import ccall "&HMAC_CTX_cleanup" hmacCtxCleanup :: FinalizerPtr HMACCtx -hmacInitEx :: Ptr HMACCtx -> Ptr a -> CULong -> Ptr EVPMD -> Ptr Engine -> IO () -hmacInitEx ctx bytes size md engine = - requireSuccess $ - {#call HMAC_Init_ex as ^#} ctx (asVoidPtr bytes) size md engine - -hmacUpdate :: Ptr HMACCtx -> Ptr CUChar -> CULong -> IO () -hmacUpdate ctx bytes size = - alwaysSucceeds $ {#call HMAC_Update as ^#} ctx bytes size - -hmacFinal :: Ptr HMACCtx -> Ptr CUChar -> Ptr CUInt -> IO () -hmacFinal ctx out outSize = - requireSuccess $ {#call HMAC_Final as ^#} ctx out outSize +{#fun HMAC_Init_ex as hmacInitEx + {`Ptr HMACCtx', asVoidPtr `Ptr a', id `CULong', `Ptr EVPMD', `Ptr Engine'} + -> `()' requireSuccess*-#} + +{#fun HMAC_Update as hmacUpdate + {`Ptr HMACCtx', id `Ptr CUChar', id `CULong'} -> `()' alwaysSucceeds*-#} + +{#fun HMAC_Final as hmacFinal + {`Ptr HMACCtx', id `Ptr CUChar', id `Ptr CUInt'} -> `()' requireSuccess*-#} instance Storable HMACCtx where sizeOf _ = {#sizeof HMAC_CTX#} |