diff options
-rw-r--r-- | src/BTLS/BoringSSL/HKDF.chs | 2 | ||||
-rw-r--r-- | src/BTLS/BoringSSL/Rand.chs | 2 | ||||
-rw-r--r-- | src/Codec/Crypto/HKDF.hs | 2 | ||||
-rw-r--r-- | src/System/Random/Crypto.hs | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/BTLS/BoringSSL/HKDF.chs b/src/BTLS/BoringSSL/HKDF.chs index 7a3181b..1a28ccc 100644 --- a/src/BTLS/BoringSSL/HKDF.chs +++ b/src/BTLS/BoringSSL/HKDF.chs @@ -32,5 +32,5 @@ import BTLS.Result -> `()' requireSuccess*-#} {#fun HKDF_expand as hkdfExpand - { id `Ptr CUChar', id `CULong', `Ptr EVPMD', unsafeUseAsCBuffer* `ByteString'& + { id `Ptr CUChar', `Int', `Ptr EVPMD', unsafeUseAsCBuffer* `ByteString'& , unsafeUseAsCBuffer* `ByteString'& } -> `()' requireSuccess*-#} diff --git a/src/BTLS/BoringSSL/Rand.chs b/src/BTLS/BoringSSL/Rand.chs index d43d26b..b007266 100644 --- a/src/BTLS/BoringSSL/Rand.chs +++ b/src/BTLS/BoringSSL/Rand.chs @@ -24,4 +24,4 @@ import BTLS.Result #include <openssl/rand.h> {#fun RAND_bytes as randBytes - {id `Ptr CUChar', id `CULong'} -> `()' alwaysSucceeds*-#} + {id `Ptr CUChar', `Int'} -> `()' alwaysSucceeds*-#} diff --git a/src/Codec/Crypto/HKDF.hs b/src/Codec/Crypto/HKDF.hs index a8c8fa9..5dd9b1f 100644 --- a/src/Codec/Crypto/HKDF.hs +++ b/src/Codec/Crypto/HKDF.hs @@ -47,5 +47,5 @@ expand (Algorithm md) (AssociatedData info) outLen (SecretKey secret) = SecretKey $ unsafeLocalState $ allocaArray outLen $ \pOutKey -> do - hkdfExpand pOutKey (fromIntegral outLen) md secret info + hkdfExpand pOutKey outLen md secret info packCUStringLen (pOutKey, outLen) diff --git a/src/System/Random/Crypto.hs b/src/System/Random/Crypto.hs index 903f7aa..ed5706d 100644 --- a/src/System/Random/Crypto.hs +++ b/src/System/Random/Crypto.hs @@ -26,5 +26,5 @@ import BTLS.Buffer (packCUStringLen) randomBytes :: Int -> IO ByteString randomBytes len = allocaArray len $ \pBuf -> do - randBytes pBuf (fromIntegral len) + randBytes pBuf len packCUStringLen (pBuf, len) |