[Pkg-haskell-commits] darcs: haskell-nettle: New upstream version 0.1.1 + nettle3 patch

Clint Adams clint at debian.org
Thu Jun 4 16:16:13 UTC 2015


Thu Jun  4 16:16:00 UTC 2015  Clint Adams <clint at debian.org>
  * New upstream version 0.1.1 + nettle3 patch

    M ./changelog +7
    M ./control -3 +3
    A ./patches/0001-port-to-nettle3.patch
    M ./patches/series +1

Thu Jun  4 16:16:00 UTC 2015  Clint Adams <clint at debian.org>
  * New upstream version 0.1.1 + nettle3 patch
diff -rN -u old-haskell-nettle/changelog new-haskell-nettle/changelog
--- old-haskell-nettle/changelog	2015-06-04 16:16:13.776602307 +0000
+++ new-haskell-nettle/changelog	2015-06-04 16:16:13.776602307 +0000
@@ -1,3 +1,10 @@
+haskell-nettle (0.1.1-1) unstable; urgency=medium
+
+  * New upstream version.
+  * Patch for nettle 3 API breakage.  closes: #787600.
+
+ -- Clint Adams <clint at debian.org>  Thu, 04 Jun 2015 12:08:31 -0400
+
 haskell-nettle (0.1.0-3) unstable; urgency=medium
 
   * Upload to unstable
diff -rN -u old-haskell-nettle/control new-haskell-nettle/control
--- old-haskell-nettle/control	2015-06-04 16:16:13.776602307 +0000
+++ new-haskell-nettle/control	2015-06-04 16:16:13.780602378 +0000
@@ -18,7 +18,7 @@
   , libghc-tagged-dev
   , libghc-tagged-prof
   , pkg-config
-  , nettle-dev
+  , nettle-dev (>= 3)
   , libghc-quickcheck2-dev
   , libghc-test-framework-dev (>= 0.3.3)
   , libghc-test-framework-hunit-dev
@@ -29,7 +29,7 @@
   , libghc-crypto-cipher-types-doc
   , libghc-securemem-doc
   , libghc-tagged-doc
-Standards-Version: 3.9.5
+Standards-Version: 3.9.6
 Homepage: http://hackage.haskell.org/package/nettle
 Vcs-Darcs: http://darcs.debian.org/pkg-haskell/haskell-nettle
 Vcs-Browser: http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/haskell-nettle
@@ -41,7 +41,7 @@
 Depends: ${haskell:Depends}
   , ${shlibs:Depends}
   , ${misc:Depends}
-  , nettle-dev
+  , nettle-dev (>= 3)
 Recommends: ${haskell:Recommends}
 Suggests: ${haskell:Suggests}
 Provides: ${haskell:Provides}
diff -rN -u old-haskell-nettle/patches/0001-port-to-nettle3.patch new-haskell-nettle/patches/0001-port-to-nettle3.patch
--- old-haskell-nettle/patches/0001-port-to-nettle3.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-haskell-nettle/patches/0001-port-to-nettle3.patch	2015-06-04 16:16:13.780602378 +0000
@@ -0,0 +1,780 @@
+From a47c2ab1001852f99d617cae950bba885466dafd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Stefan=20B=C3=BChler?= <stbuehler at web.de>
+Date: Tue, 2 Jun 2015 19:24:24 +0200
+Subject: [PATCH 1/5] port to nettle3
+
+---
+ src/Crypto/Nettle/Ciphers.hs                 | 130 ++++++++---------
+ src/Crypto/Nettle/Ciphers/ForeignImports.hsc | 207 ++++++++++++++++++++++-----
+ src/nettle-ciphers.c                         | 124 +++++++++++++++-
+ src/nettle-ciphers.h                         |  55 ++++++-
+ src/nettle-hash.h                            |   6 +
+ 5 files changed, 411 insertions(+), 111 deletions(-)
+
+diff --git a/src/Crypto/Nettle/Ciphers.hs b/src/Crypto/Nettle/Ciphers.hs
+index 866468d..97a8850 100644
+--- a/src/Crypto/Nettle/Ciphers.hs
++++ b/src/Crypto/Nettle/Ciphers.hs
+@@ -125,7 +125,6 @@ instance StreamNonceCipher Typ where \
+ 	; streamNonceSize = witness nbsc_nonceSize \
+ 	}
+ 
+-
+ {-|
+ 'AES' is the generic cipher context for the AES cipher, supporting key sizes
+ of 128, 196 and 256 bits (16, 24 and 32 bytes). The 'blockSize' is always 128 bits (16 bytes).
+@@ -142,35 +141,32 @@ instance NettleCipher AES where
+ 	nc_Ctx           = AES
+ instance NettleBlockCipher AES where
+ 	nbc_blockSize          = Tagged 16
+-	nbc_encrypt_ctx_offset = Tagged c_hs_aes_ctx_encrypt
+-	nbc_decrypt_ctx_offset = Tagged c_hs_aes_ctx_decrypt
+-	nbc_ecb_encrypt        = Tagged c_aes_encrypt
+-	nbc_ecb_decrypt        = Tagged c_aes_decrypt
+-	nbc_fun_encrypt        = Tagged p_aes_encrypt
+-	nbc_fun_decrypt        = Tagged p_aes_decrypt
++	nbc_ecb_encrypt        = Tagged c_hs_aes_encrypt
++	nbc_ecb_decrypt        = Tagged c_hs_aes_decrypt
++	nbc_fun_encrypt        = Tagged p_hs_aes_encrypt
++	nbc_fun_decrypt        = Tagged p_hs_aes_decrypt
+ 
+ INSTANCE_BLOCKCIPHER(AES)
+ 
+-
+ {-|
+ 'AES128' provides the same interface as 'AES', but is restricted to 128-bit keys.
+ -}
+ newtype AES128 = AES128 SecureMem
+ instance NettleCipher AES128 where
+-	nc_cipherInit    = Tagged c_hs_aes_init
++	nc_cipherInit    = Tagged (\ctx _ key -> c_hs_aes128_init ctx key)
+ 	nc_cipherName    = Tagged "AES-128"
+ 	nc_cipherKeySize = Tagged $ KeySizeFixed 16
+-	nc_ctx_size      = Tagged c_hs_aes_ctx_size
++	nc_ctx_size      = Tagged c_hs_aes128_ctx_size
+ 	nc_ctx (AES128 c) = c
+ 	nc_Ctx            = AES128
+ instance NettleBlockCipher AES128 where
+ 	nbc_blockSize          = Tagged 16
+-	nbc_encrypt_ctx_offset = Tagged c_hs_aes_ctx_encrypt
+-	nbc_decrypt_ctx_offset = Tagged c_hs_aes_ctx_decrypt
+-	nbc_ecb_encrypt        = Tagged c_aes_encrypt
+-	nbc_ecb_decrypt        = Tagged c_aes_decrypt
+-	nbc_fun_encrypt        = Tagged p_aes_encrypt
+-	nbc_fun_decrypt        = Tagged p_aes_decrypt
++	nbc_encrypt_ctx_offset = Tagged c_hs_aes128_ctx_encrypt
++	nbc_decrypt_ctx_offset = Tagged c_hs_aes128_ctx_decrypt
++	nbc_ecb_encrypt        = Tagged c_aes128_encrypt
++	nbc_ecb_decrypt        = Tagged c_aes128_decrypt
++	nbc_fun_encrypt        = Tagged p_aes128_encrypt
++	nbc_fun_decrypt        = Tagged p_aes128_decrypt
+ 
+ INSTANCE_BLOCKCIPHER(AES128)
+ 
+@@ -180,20 +176,20 @@ INSTANCE_BLOCKCIPHER(AES128)
+ -}
+ newtype AES192 = AES192 SecureMem
+ instance NettleCipher AES192 where
+-	nc_cipherInit    = Tagged c_hs_aes_init
++	nc_cipherInit    = Tagged (\ctx _ key -> c_hs_aes192_init ctx key)
+ 	nc_cipherName    = Tagged "AES-192"
+ 	nc_cipherKeySize = Tagged $ KeySizeFixed 24
+-	nc_ctx_size      = Tagged c_hs_aes_ctx_size
++	nc_ctx_size      = Tagged c_hs_aes192_ctx_size
+ 	nc_ctx  (AES192 c) = c
+ 	nc_Ctx             = AES192
+ instance NettleBlockCipher AES192 where
+ 	nbc_blockSize          = Tagged 16
+-	nbc_encrypt_ctx_offset = Tagged c_hs_aes_ctx_encrypt
+-	nbc_decrypt_ctx_offset = Tagged c_hs_aes_ctx_decrypt
+-	nbc_ecb_encrypt        = Tagged c_aes_encrypt
+-	nbc_ecb_decrypt        = Tagged c_aes_decrypt
+-	nbc_fun_encrypt        = Tagged p_aes_encrypt
+-	nbc_fun_decrypt        = Tagged p_aes_decrypt
++	nbc_encrypt_ctx_offset = Tagged c_hs_aes192_ctx_encrypt
++	nbc_decrypt_ctx_offset = Tagged c_hs_aes192_ctx_decrypt
++	nbc_ecb_encrypt        = Tagged c_aes192_encrypt
++	nbc_ecb_decrypt        = Tagged c_aes192_decrypt
++	nbc_fun_encrypt        = Tagged p_aes192_encrypt
++	nbc_fun_decrypt        = Tagged p_aes192_decrypt
+ 
+ INSTANCE_BLOCKCIPHER(AES192)
+ 
+@@ -203,20 +199,20 @@ INSTANCE_BLOCKCIPHER(AES192)
+ -}
+ newtype AES256 = AES256 SecureMem
+ instance NettleCipher AES256 where
+-	nc_cipherInit    = Tagged c_hs_aes_init
++	nc_cipherInit    = Tagged (\ctx _ key -> c_hs_aes256_init ctx key)
+ 	nc_cipherName    = Tagged "AES-256"
+ 	nc_cipherKeySize = Tagged $ KeySizeFixed 32
+-	nc_ctx_size      = Tagged c_hs_aes_ctx_size
++	nc_ctx_size      = Tagged c_hs_aes256_ctx_size
+ 	nc_ctx  (AES256 c) = c
+ 	nc_Ctx             = AES256
+ instance NettleBlockCipher AES256 where
+ 	nbc_blockSize          = Tagged 16
+-	nbc_encrypt_ctx_offset = Tagged c_hs_aes_ctx_encrypt
+-	nbc_decrypt_ctx_offset = Tagged c_hs_aes_ctx_decrypt
+-	nbc_ecb_encrypt        = Tagged c_aes_encrypt
+-	nbc_ecb_decrypt        = Tagged c_aes_decrypt
+-	nbc_fun_encrypt        = Tagged p_aes_encrypt
+-	nbc_fun_decrypt        = Tagged p_aes_decrypt
++	nbc_encrypt_ctx_offset = Tagged c_hs_aes256_ctx_encrypt
++	nbc_decrypt_ctx_offset = Tagged c_hs_aes256_ctx_decrypt
++	nbc_ecb_encrypt        = Tagged c_aes256_encrypt
++	nbc_ecb_decrypt        = Tagged c_aes256_decrypt
++	nbc_fun_encrypt        = Tagged p_aes256_encrypt
++	nbc_fun_decrypt        = Tagged p_aes256_decrypt
+ 
+ INSTANCE_BLOCKCIPHER(AES256)
+ 
+@@ -297,12 +293,10 @@ instance NettleCipher Camellia where
+ 	nc_Ctx             = Camellia
+ instance NettleBlockCipher Camellia where
+ 	nbc_blockSize          = Tagged 16
+-	nbc_encrypt_ctx_offset = Tagged c_hs_camellia_ctx_encrypt
+-	nbc_decrypt_ctx_offset = Tagged c_hs_camellia_ctx_decrypt
+-	nbc_ecb_encrypt        = Tagged c_camellia_crypt
+-	nbc_ecb_decrypt        = Tagged c_camellia_crypt
+-	nbc_fun_encrypt        = Tagged p_camellia_crypt
+-	nbc_fun_decrypt        = Tagged p_camellia_crypt
++	nbc_ecb_encrypt        = Tagged c_hs_camellia_encrypt
++	nbc_ecb_decrypt        = Tagged c_hs_camellia_decrypt
++	nbc_fun_encrypt        = Tagged p_hs_camellia_encrypt
++	nbc_fun_decrypt        = Tagged p_hs_camellia_decrypt
+ 
+ INSTANCE_BLOCKCIPHER(Camellia)
+ 
+@@ -311,20 +305,20 @@ INSTANCE_BLOCKCIPHER(Camellia)
+ -}
+ newtype Camellia128 = Camellia128 SecureMem
+ instance NettleCipher Camellia128 where
+-	nc_cipherInit    = Tagged c_hs_camellia_init
++	nc_cipherInit    = Tagged (\ctx _ key -> c_hs_camellia128_init ctx key)
+ 	nc_cipherName    = Tagged "Camellia-128"
+ 	nc_cipherKeySize = Tagged $ KeySizeFixed 16
+-	nc_ctx_size      = Tagged c_hs_camellia_ctx_size
++	nc_ctx_size      = Tagged c_hs_camellia128_ctx_size
+ 	nc_ctx  (Camellia128 c) = c
+ 	nc_Ctx             = Camellia128
+ instance NettleBlockCipher Camellia128 where
+ 	nbc_blockSize          = Tagged 16
+-	nbc_encrypt_ctx_offset = Tagged c_hs_camellia_ctx_encrypt
+-	nbc_decrypt_ctx_offset = Tagged c_hs_camellia_ctx_decrypt
+-	nbc_ecb_encrypt        = Tagged c_camellia_crypt
+-	nbc_ecb_decrypt        = Tagged c_camellia_crypt
+-	nbc_fun_encrypt        = Tagged p_camellia_crypt
+-	nbc_fun_decrypt        = Tagged p_camellia_crypt
++	nbc_encrypt_ctx_offset = Tagged c_hs_camellia128_ctx_encrypt
++	nbc_decrypt_ctx_offset = Tagged c_hs_camellia128_ctx_decrypt
++	nbc_ecb_encrypt        = Tagged c_camellia128_crypt
++	nbc_ecb_decrypt        = Tagged c_camellia128_crypt
++	nbc_fun_encrypt        = Tagged p_camellia128_crypt
++	nbc_fun_decrypt        = Tagged p_camellia128_crypt
+ 
+ INSTANCE_BLOCKCIPHER(Camellia128)
+ 
+@@ -333,20 +327,20 @@ INSTANCE_BLOCKCIPHER(Camellia128)
+ -}
+ newtype Camellia192 = Camellia192 SecureMem
+ instance NettleCipher Camellia192 where
+-	nc_cipherInit    = Tagged c_hs_camellia_init
++	nc_cipherInit    = Tagged (\ctx _ key -> c_hs_camellia192_init ctx key)
+ 	nc_cipherName    = Tagged "Camellia-192"
+ 	nc_cipherKeySize = Tagged $ KeySizeFixed 24
+-	nc_ctx_size      = Tagged c_hs_camellia_ctx_size
++	nc_ctx_size      = Tagged c_hs_camellia192_ctx_size
+ 	nc_ctx  (Camellia192 c) = c
+ 	nc_Ctx             = Camellia192
+ instance NettleBlockCipher Camellia192 where
+ 	nbc_blockSize          = Tagged 16
+-	nbc_encrypt_ctx_offset = Tagged c_hs_camellia_ctx_encrypt
+-	nbc_decrypt_ctx_offset = Tagged c_hs_camellia_ctx_decrypt
+-	nbc_ecb_encrypt        = Tagged c_camellia_crypt
+-	nbc_ecb_decrypt        = Tagged c_camellia_crypt
+-	nbc_fun_encrypt        = Tagged p_camellia_crypt
+-	nbc_fun_decrypt        = Tagged p_camellia_crypt
++	nbc_encrypt_ctx_offset = Tagged c_hs_camellia192_ctx_encrypt
++	nbc_decrypt_ctx_offset = Tagged c_hs_camellia192_ctx_decrypt
++	nbc_ecb_encrypt        = Tagged c_camellia192_crypt
++	nbc_ecb_decrypt        = Tagged c_camellia192_crypt
++	nbc_fun_encrypt        = Tagged p_camellia192_crypt
++	nbc_fun_decrypt        = Tagged p_camellia192_crypt
+ 
+ INSTANCE_BLOCKCIPHER(Camellia192)
+ 
+@@ -355,20 +349,20 @@ INSTANCE_BLOCKCIPHER(Camellia192)
+ -}
+ newtype Camellia256 = Camellia256 SecureMem
+ instance NettleCipher Camellia256 where
+-	nc_cipherInit    = Tagged c_hs_camellia_init
++	nc_cipherInit    = Tagged (\ctx _ key -> c_hs_camellia256_init ctx key)
+ 	nc_cipherName    = Tagged "Camellia-256"
+ 	nc_cipherKeySize = Tagged $ KeySizeFixed 32
+-	nc_ctx_size      = Tagged c_hs_camellia_ctx_size
++	nc_ctx_size      = Tagged c_hs_camellia256_ctx_size
+ 	nc_ctx  (Camellia256 c) = c
+ 	nc_Ctx             = Camellia256
+ instance NettleBlockCipher Camellia256 where
+ 	nbc_blockSize          = Tagged 16
+-	nbc_encrypt_ctx_offset = Tagged c_hs_camellia_ctx_encrypt
+-	nbc_decrypt_ctx_offset = Tagged c_hs_camellia_ctx_decrypt
+-	nbc_ecb_encrypt        = Tagged c_camellia_crypt
+-	nbc_ecb_decrypt        = Tagged c_camellia_crypt
+-	nbc_fun_encrypt        = Tagged p_camellia_crypt
+-	nbc_fun_decrypt        = Tagged p_camellia_crypt
++	nbc_encrypt_ctx_offset = Tagged c_hs_camellia256_ctx_encrypt
++	nbc_decrypt_ctx_offset = Tagged c_hs_camellia256_ctx_decrypt
++	nbc_ecb_encrypt        = Tagged c_camellia256_crypt
++	nbc_ecb_decrypt        = Tagged c_camellia256_crypt
++	nbc_fun_encrypt        = Tagged p_camellia256_crypt
++	nbc_fun_decrypt        = Tagged p_camellia256_crypt
+ 
+ INSTANCE_BLOCKCIPHER(Camellia256)
+ 
+@@ -378,7 +372,7 @@ and a variable key size of 40 up to 128 bits (5 to 16 bytes).
+ -}
+ newtype CAST128 = CAST128 SecureMem
+ instance NettleCipher CAST128 where
+-	nc_cipherInit    = Tagged c_cast128_set_key
++	nc_cipherInit    = Tagged c_cast5_set_key
+ 	nc_cipherName    = Tagged "CAST-128"
+ 	nc_cipherKeySize = Tagged $ KeySizeRange 5 16
+ 	nc_ctx_size      = Tagged c_cast128_ctx_size
+@@ -533,11 +527,11 @@ wrap_salsa20_set_key :: Ptr Word8 -> Word -> Ptr Word8 -> IO ()
+ wrap_salsa20_set_key ctxptr keylen keyptr = do
+ 	c_salsa20_set_key ctxptr keylen keyptr
+ 	withByteStringPtr (B.replicate 8 0) $ \_ nonceptr ->
+-		c_salsa20_set_iv ctxptr nonceptr
++		c_salsa20_set_nonce ctxptr nonceptr
+ 
+ -- check nonce length
+-wrap_salsa20_set_iv :: Ptr Word8 -> Word -> Ptr Word8 -> IO ()
+-wrap_salsa20_set_iv ctxptr ivlen ivptr = if ivlen == 8 then c_salsa20_set_iv ctxptr ivptr else fail "Invalid nonce length"
++wrap_salsa20_set_nonce :: Ptr Word8 -> Word -> Ptr Word8 -> IO ()
++wrap_salsa20_set_nonce ctxptr ivlen ivptr = if ivlen == 8 then c_salsa20_set_nonce ctxptr ivptr else fail "Invalid nonce length"
+ 
+ {-|
+ 'SALSA20' is a fairly recent stream cipher designed by D. J. Bernstein.
+@@ -566,7 +560,7 @@ instance NettleBlockedStreamCipher SALSA20 where
+ 	nbsc_incompleteState (SALSA20 (_, inc)) = inc
+ 	nbsc_streamCombine = Tagged c_salsa20_crypt
+ 	nbsc_nonceSize     = Tagged $ KeySizeFixed 8
+-	nbsc_setNonce      = Tagged $ Just wrap_salsa20_set_iv
++	nbsc_setNonce      = Tagged $ Just wrap_salsa20_set_nonce
+ INSTANCE_BLOCKEDSTREAMNONCECIPHER(SALSA20)
+ 
+ 
+@@ -587,5 +581,5 @@ instance NettleBlockedStreamCipher ESTREAM_SALSA20 where
+ 	nbsc_incompleteState (ESTREAM_SALSA20 (_, inc)) = inc
+ 	nbsc_streamCombine = Tagged c_salsa20r12_crypt
+ 	nbsc_nonceSize     = Tagged $ KeySizeFixed 8
+-	nbsc_setNonce      = Tagged $ Just wrap_salsa20_set_iv
++	nbsc_setNonce      = Tagged $ Just wrap_salsa20_set_nonce
+ INSTANCE_BLOCKEDSTREAMNONCECIPHER(ESTREAM_SALSA20)
+diff --git a/src/Crypto/Nettle/Ciphers/ForeignImports.hsc b/src/Crypto/Nettle/Ciphers/ForeignImports.hsc
+index 33e7cc9..34a0d52 100644
+--- a/src/Crypto/Nettle/Ciphers/ForeignImports.hsc
++++ b/src/Crypto/Nettle/Ciphers/ForeignImports.hsc
+@@ -23,13 +23,38 @@ module Crypto.Nettle.Ciphers.ForeignImports
+ 	, c_gcm_digest
+ 
+ 	, c_hs_aes_ctx_size
+-	, c_hs_aes_ctx_encrypt
+-	, c_hs_aes_ctx_decrypt
+ 	, c_hs_aes_init
+-	, c_aes_encrypt
+-	, p_aes_encrypt
+-	, c_aes_decrypt
+-	, p_aes_decrypt
++	, c_hs_aes_encrypt
++	, p_hs_aes_encrypt
++	, c_hs_aes_decrypt
++	, p_hs_aes_decrypt
++
++	, c_hs_aes128_ctx_size
++	, c_hs_aes128_ctx_encrypt
++	, c_hs_aes128_ctx_decrypt
++	, c_hs_aes128_init
++	, c_aes128_encrypt
++	, p_aes128_encrypt
++	, c_aes128_decrypt
++	, p_aes128_decrypt
++
++	, c_hs_aes192_ctx_size
++	, c_hs_aes192_ctx_encrypt
++	, c_hs_aes192_ctx_decrypt
++	, c_hs_aes192_init
++	, c_aes192_encrypt
++	, p_aes192_encrypt
++	, c_aes192_decrypt
++	, p_aes192_decrypt
++
++	, c_hs_aes256_ctx_size
++	, c_hs_aes256_ctx_encrypt
++	, c_hs_aes256_ctx_decrypt
++	, c_hs_aes256_init
++	, c_aes256_encrypt
++	, p_aes256_encrypt
++	, c_aes256_decrypt
++	, p_aes256_decrypt
+ 
+ 	, c_arctwo_ctx_size
+ 	, c_arctwo_set_key
+@@ -48,14 +73,35 @@ module Crypto.Nettle.Ciphers.ForeignImports
+ 	, p_blowfish_decrypt
+ 
+ 	, c_hs_camellia_ctx_size
+-	, c_hs_camellia_ctx_encrypt
+-	, c_hs_camellia_ctx_decrypt
+ 	, c_hs_camellia_init
+-	, c_camellia_crypt
+-	, p_camellia_crypt
++	, c_hs_camellia_encrypt
++	, p_hs_camellia_encrypt
++	, c_hs_camellia_decrypt
++	, p_hs_camellia_decrypt
++
++	, c_hs_camellia128_ctx_size
++	, c_hs_camellia128_ctx_encrypt
++	, c_hs_camellia128_ctx_decrypt
++	, c_hs_camellia128_init
++	, c_camellia128_crypt
++	, p_camellia128_crypt
++
++	, c_hs_camellia192_ctx_size
++	, c_hs_camellia192_ctx_encrypt
++	, c_hs_camellia192_ctx_decrypt
++	, c_hs_camellia192_init
++	, c_camellia192_crypt
++	, p_camellia192_crypt
++
++	, c_hs_camellia256_ctx_size
++	, c_hs_camellia256_ctx_encrypt
++	, c_hs_camellia256_ctx_decrypt
++	, c_hs_camellia256_init
++	, c_camellia256_crypt
++	, p_camellia256_crypt
+ 
+ 	, c_cast128_ctx_size
+-	, c_cast128_set_key
++	, c_cast5_set_key
+ 	, c_cast128_encrypt
+ 	, p_cast128_encrypt
+ 	, c_cast128_decrypt
+@@ -95,7 +141,7 @@ module Crypto.Nettle.Ciphers.ForeignImports
+ 
+ 	, c_salsa20_ctx_size
+ 	, c_salsa20_set_key
+-	, c_salsa20_set_iv
++	, c_salsa20_set_nonce
+ 	, c_salsa20_crypt
+ 	, c_salsa20r12_crypt
+ 	) where
+@@ -145,21 +191,67 @@ foreign import ccall unsafe "nettle_gcm_digest"
+ 
+ c_hs_aes_ctx_size :: Int
+ c_hs_aes_ctx_size = #{size struct hs_aes_ctx}
+-c_hs_aes_ctx_encrypt :: Ptr Word8 -> Ptr Word8
+-c_hs_aes_ctx_encrypt = #ptr struct hs_aes_ctx, encrypt
+-c_hs_aes_ctx_decrypt :: Ptr Word8 -> Ptr Word8
+-c_hs_aes_ctx_decrypt = #ptr struct hs_aes_ctx, decrypt
+ foreign import ccall unsafe "hs_nettle_aes_init"
+ 	c_hs_aes_init :: Ptr Word8 -> Word -> Ptr Word8 -> IO ()
+-foreign import ccall unsafe "nettle_aes_encrypt"
+-	c_aes_encrypt :: NettleCryptFunc
+-foreign import ccall unsafe "&nettle_aes_encrypt"
+-	p_aes_encrypt :: FunPtr NettleCryptFunc
+-foreign import ccall unsafe "nettle_aes_decrypt"
+-	c_aes_decrypt :: NettleCryptFunc
+-foreign import ccall unsafe "&nettle_aes_decrypt"
+-	p_aes_decrypt :: FunPtr NettleCryptFunc
+-
++foreign import ccall unsafe "hs_nettle_aes_encrypt"
++	c_hs_aes_encrypt :: NettleCryptFunc
++foreign import ccall unsafe "&hs_nettle_aes_encrypt"
++	p_hs_aes_encrypt :: FunPtr NettleCryptFunc
++foreign import ccall unsafe "hs_nettle_aes_decrypt"
++	c_hs_aes_decrypt :: NettleCryptFunc
++foreign import ccall unsafe "&hs_nettle_aes_decrypt"
++	p_hs_aes_decrypt :: FunPtr NettleCryptFunc
++
++c_hs_aes128_ctx_size :: Int
++c_hs_aes128_ctx_size = #{size struct hs_aes128_ctx}
++c_hs_aes128_ctx_encrypt :: Ptr Word8 -> Ptr Word8
++c_hs_aes128_ctx_encrypt = #ptr struct hs_aes128_ctx, encrypt
++c_hs_aes128_ctx_decrypt :: Ptr Word8 -> Ptr Word8
++c_hs_aes128_ctx_decrypt = #ptr struct hs_aes128_ctx, decrypt
++foreign import ccall unsafe "hs_nettle_aes128_init"
++	c_hs_aes128_init :: Ptr Word8 -> Ptr Word8 -> IO ()
++foreign import ccall unsafe "nettle_aes128_encrypt"
++	c_aes128_encrypt :: NettleCryptFunc
++foreign import ccall unsafe "&nettle_aes128_encrypt"
++	p_aes128_encrypt :: FunPtr NettleCryptFunc
++foreign import ccall unsafe "nettle_aes128_decrypt"
++	c_aes128_decrypt :: NettleCryptFunc
++foreign import ccall unsafe "&nettle_aes128_decrypt"
++	p_aes128_decrypt :: FunPtr NettleCryptFunc
++
++c_hs_aes192_ctx_size :: Int
++c_hs_aes192_ctx_size = #{size struct hs_aes192_ctx}
++c_hs_aes192_ctx_encrypt :: Ptr Word8 -> Ptr Word8
++c_hs_aes192_ctx_encrypt = #ptr struct hs_aes192_ctx, encrypt
++c_hs_aes192_ctx_decrypt :: Ptr Word8 -> Ptr Word8
++c_hs_aes192_ctx_decrypt = #ptr struct hs_aes192_ctx, decrypt
++foreign import ccall unsafe "hs_nettle_aes192_init"
++	c_hs_aes192_init :: Ptr Word8 -> Ptr Word8 -> IO ()
++foreign import ccall unsafe "nettle_aes192_encrypt"
++	c_aes192_encrypt :: NettleCryptFunc
++foreign import ccall unsafe "&nettle_aes192_encrypt"
++	p_aes192_encrypt :: FunPtr NettleCryptFunc
++foreign import ccall unsafe "nettle_aes192_decrypt"
++	c_aes192_decrypt :: NettleCryptFunc
++foreign import ccall unsafe "&nettle_aes192_decrypt"
++	p_aes192_decrypt :: FunPtr NettleCryptFunc
++
++c_hs_aes256_ctx_size :: Int
++c_hs_aes256_ctx_size = #{size struct hs_aes256_ctx}
++c_hs_aes256_ctx_encrypt :: Ptr Word8 -> Ptr Word8
++c_hs_aes256_ctx_encrypt = #ptr struct hs_aes256_ctx, encrypt
++c_hs_aes256_ctx_decrypt :: Ptr Word8 -> Ptr Word8
++c_hs_aes256_ctx_decrypt = #ptr struct hs_aes256_ctx, decrypt
++foreign import ccall unsafe "hs_nettle_aes256_init"
++	c_hs_aes256[...incomplete...]



More information about the Pkg-haskell-commits mailing list