[DHG_packages] 01/01: cryptonite: Two more byteorder patches, one by Edmund and one by me

Joachim Breitner nomeata at moszumanska.debian.org
Thu Aug 27 08:30:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

nomeata pushed a commit to annotated tag haskell-cryptonite_v0.6-3
in repository DHG_packages.

commit 10c55a985c5a8a801857d7c53f6e39b36c87a752
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Thu Aug 27 10:15:56 2015 +0200

    cryptonite: Two more byteorder patches, one by Edmund and one by me
---
 p/haskell-cryptonite/debian/changelog               |  7 +++++++
 .../debian/patches/integerify-endianness-fix        | 15 +++++++++++++++
 .../debian/patches/number-test-case-fix             | 21 +++++++++++++++++++++
 p/haskell-cryptonite/debian/patches/series          |  3 +++
 p/haskell-cryptonite/debian/patches/use-mkLE        | 13 +++++++++++++
 5 files changed, 59 insertions(+)

diff --git a/p/haskell-cryptonite/debian/changelog b/p/haskell-cryptonite/debian/changelog
index 4c9e523..bedde91 100644
--- a/p/haskell-cryptonite/debian/changelog
+++ b/p/haskell-cryptonite/debian/changelog
@@ -1,3 +1,10 @@
+haskell-cryptonite (0.6-3) experimental; urgency=medium
+
+  * Two more byteorder patches, one by Edmund and one by me
+  * Backported patch from upstream to fix bug in the testsuite
+
+ -- Joachim Breitner <nomeata at debian.org>  Thu, 27 Aug 2015 10:15:51 +0200
+
 haskell-cryptonite (0.6-2) experimental; urgency=medium
 
   * Byteorder compatibility patch by Edmund Grimley Evans (Closes: #796800)
diff --git a/p/haskell-cryptonite/debian/patches/integerify-endianness-fix b/p/haskell-cryptonite/debian/patches/integerify-endianness-fix
new file mode 100644
index 0000000..05e78ae
--- /dev/null
+++ b/p/haskell-cryptonite/debian/patches/integerify-endianness-fix
@@ -0,0 +1,15 @@
+Description: Endianness fix to integerify
+Author: Edmund Grimley Evans (
+Bug: https://github.com/vincenthz/cryptonite/issues/30
+
+--- haskell-cryptonite-0.6.orig/cbits/cryptonite_scrypt.c
++++ haskell-cryptonite-0.6/cbits/cryptonite_scrypt.c
+@@ -46,7 +46,7 @@ static void blockmix_salsa8(uint32_t *in
+ 
+ static inline uint64_t integerify(uint32_t *B, const uint32_t r)
+ {
+-	return le64_to_cpu(*((uint64_t *) (B + (2*r-1) * 16)));
++	return B[(2*r-1) * 16] | (uint64_t)B[(2*r-1) * 16 + 1] << 32;
+ }
+ 
+ static inline uint32_t load32(const uint8_t *p)
diff --git a/p/haskell-cryptonite/debian/patches/number-test-case-fix b/p/haskell-cryptonite/debian/patches/number-test-case-fix
new file mode 100644
index 0000000..0375f6d
--- /dev/null
+++ b/p/haskell-cryptonite/debian/patches/number-test-case-fix
@@ -0,0 +1,21 @@
+Description: fix 0 case.
+Origin: https://github.com/vincenthz/cryptonite/commit/169570c9632a29c95432468016f294853bcd1ba2
+
+--- haskell-cryptonite-0.6.orig/tests/Number.hs
++++ haskell-cryptonite-0.6/tests/Number.hs
+@@ -21,10 +21,11 @@ serializationVectors =
+ 
+ tests = testGroup "number"
+     [ testProperty "num-bits" $ \(Int0_2901 i) ->
+-        and [ (numBits (2^i-1) == i)
+-            , (numBits (2^i) == i+1)
+-            , (numBits (2^i + (2^i-1)) == i+1)
+-            ]
++        if i == 0 then True else
++            and [ (numBits (2^i-1) == i)
++                , (numBits (2^i) == i+1)
++                , (numBits (2^i + (2^i-1)) == i+1)
++                ]
+     , testProperty "num-bits2" $ \(Positive i) ->
+         not (i `testBit` numBits i) && (i `testBit` (numBits i - 1))
+     , testProperty "generate-param" $ \testDRG (Int0_2901 bits)  ->
diff --git a/p/haskell-cryptonite/debian/patches/series b/p/haskell-cryptonite/debian/patches/series
index cdf39c5..0a02de1 100644
--- a/p/haskell-cryptonite/debian/patches/series
+++ b/p/haskell-cryptonite/debian/patches/series
@@ -1 +1,4 @@
 cryptonite-byteorder.patch
+integerify-endianness-fix
+number-test-case-fix
+use-mkLE
diff --git a/p/haskell-cryptonite/debian/patches/use-mkLE b/p/haskell-cryptonite/debian/patches/use-mkLE
new file mode 100644
index 0000000..740657d
--- /dev/null
+++ b/p/haskell-cryptonite/debian/patches/use-mkLE
@@ -0,0 +1,13 @@
+Description: use mkLE instead of LE
+Author: Joachim Breitner <nomeata at debian.org>
+Bug: https://github.com/vincenthz/cryptonite/issues/31
+
+--- haskell-cryptonite-0.6.orig/Crypto/Cipher/ChaChaPoly1305.hs
++++ haskell-cryptonite-0.6/Crypto/Cipher/ChaChaPoly1305.hs
+@@ -108,5 +108,5 @@ finalize :: State -> Poly1305.Auth
+ finalize (State _ macState aadLength plainLength) =
+     Poly1305.finalize $ Poly1305.updates macState
+         [ pad16 plainLength
+-        , either (error "finalize: internal error") id $ P.fill 16 (P.putStorable (LE aadLength) >> P.putStorable (LE plainLength))
++        , either (error "finalize: internal error") id $ P.fill 16 (P.putStorable (toLE aadLength) >> P.putStorable (toLE plainLength))
+         ]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git



More information about the Pkg-haskell-commits mailing list