[arch-commits] Commit in haskell-cryptonite/trunk (PKGBUILD i686.patch)

Felix Yan felixonmars at archlinux.org
Wed Jun 15 02:47:54 UTC 2016


    Date: Wednesday, June 15, 2016 @ 02:47:54
  Author: felixonmars
Revision: 180124

upgpkg: haskell-cryptonite 0.17-1

rebuild with asn1-encoding-0.9.4, cgrep-6.6.15, data-default-0.7.1, data-default-class-0.1.1, js-jquery-3.0.0, microlens-0.4.4.3, pipes-http-1.0.3, scientific-0.3.4.7, shake-0.15.9, tagsoup-0.14

Modified:
  haskell-cryptonite/trunk/PKGBUILD
Deleted:
  haskell-cryptonite/trunk/i686.patch

------------+
 PKGBUILD   |   14 ++---------
 i686.patch |   75 -----------------------------------------------------------
 2 files changed, 3 insertions(+), 86 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-06-15 02:47:53 UTC (rev 180123)
+++ PKGBUILD	2016-06-15 02:47:54 UTC (rev 180124)
@@ -4,7 +4,7 @@
 
 _hkgname=cryptonite
 pkgname=haskell-cryptonite
-pkgver=0.16
+pkgver=0.17
 pkgrel=1
 pkgdesc="Cryptography Primitives sink"
 url="https://github.com/vincenthz/cryptonite"
@@ -11,17 +11,9 @@
 license=("custom:BSD3")
 arch=('i686' 'x86_64')
 depends=("ghc=8.0.1" "haskell-memory")
-source=("http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz"
-        i686.patch)
-sha256sums=('5c3bf190954986ea4af466914eb7a0c55a0b4c1c66552d00341277c89082511a'
-            '0bd68b7fd7caa859ca9a5dd7343c45c0dfd22c0c5cd55dec626de2dd9804abec')
+source=("http://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
+sha256sums=('a6c6a129b844c55580c4bfd79ecdf5bdc37ea8be6634ae7858015219111156c8')
 
-prepare() {
-    cd $_hkgname-$pkgver
-    # https://github.com/haskell-crypto/cryptonite/issues/88
-    patch -p1 -i ../i686.patch
-}
-
 build() {
     cd "${srcdir}/${_hkgname}-${pkgver}"
     

Deleted: i686.patch
===================================================================
--- i686.patch	2016-06-15 02:47:53 UTC (rev 180123)
+++ i686.patch	2016-06-15 02:47:54 UTC (rev 180124)
@@ -1,75 +0,0 @@
-From f5a811e755eee253bc34897f327e096e04ad1286 Mon Sep 17 00:00:00 2001
-From: Vincent Hanquez <vincent at snarc.org>
-Date: Fri, 3 Jun 2016 07:12:38 +0100
-Subject: [PATCH] [rdrand] add an untested workaround for i686 machine
-
----
- cbits/cryptonite_rdrand.c | 35 ++++++++++++++++++++++++++++-------
- 1 file changed, 28 insertions(+), 7 deletions(-)
-
-diff --git a/cbits/cryptonite_rdrand.c b/cbits/cryptonite_rdrand.c
-index 54409fc..66501e5 100644
---- a/cbits/cryptonite_rdrand.c
-+++ b/cbits/cryptonite_rdrand.c
-@@ -65,17 +65,38 @@ static inline int crypto_random_rdrand64_step(uint64_t *buffer)
- 	   : \
- 	   : "cc")
- 
-+/* inline encoding of 'rdrand %eax' to cover old binutils
-+ * - no inputs
-+ * - 'cc' to the clobber list as we modify condition code.
-+ * - output of rdrand in eax and have a 8 bit error condition
-+ */
-+#define inline_rdrand_eax(val, err) \
-+	asm(".byte 0x0f,0xc7,0xf0; setc %1" \
-+	   : "=a" (val), "=q" (err) \
-+	   : \
-+	   : "cc")
-+
-+#ifdef __x86_64__
-+# define RDRAND_SZ 8
-+# define RDRAND_T  uint64_t
-+#define inline_rdrand(val, err) inline_rdrand_rax(val, err)
-+#else
-+# define RDRAND_SZ 4
-+# define RDRAND_T  uint32_t
-+#define inline_rdrand(val, err) inline_rdrand_eax(val, err)
-+#endif
-+
- /* Returns the number of bytes succesfully generated */
- int cryptonite_get_rand_bytes(uint8_t *buffer, size_t len)
- {
--	uint64_t tmp;
--	int aligned = (intptr_t) buffer % 8;
-+	RDRAND_T tmp;
-+	int aligned = (intptr_t) buffer % RDRAND_SZ;
- 	int orig_len = len;
--	int to_alignment = 8 - aligned;
-+	int to_alignment = RDRAND_SZ - aligned;
- 	uint8_t ok;
- 
- 	if (aligned != 0) {
--		inline_rdrand_rax(tmp, ok);
-+		inline_rdrand(tmp, ok);
- 		if (!ok)
- 			return 0;
- 		memcpy(buffer, (uint8_t *) &tmp, to_alignment);
-@@ -83,15 +104,15 @@ int cryptonite_get_rand_bytes(uint8_t *buffer, size_t len)
- 		len -= to_alignment;
- 	}
- 
--	for (; len >= 8; buffer += 8, len -= 8) {
--		inline_rdrand_rax(tmp, ok);
-+	for (; len >= RDRAND_SZ; buffer += RDRAND_SZ, len -= RDRAND_SZ) {
-+		inline_rdrand(tmp, ok);
- 		if (!ok)
- 			return (orig_len - len);
- 		*((uint64_t *) buffer) = tmp;
- 	}
- 
- 	if (len > 0) {
--		inline_rdrand_rax(tmp, ok);
-+		inline_rdrand(tmp, ok);
- 		if (!ok)
- 			return (orig_len - len);
- 		memcpy(buffer, (uint8_t *) &tmp, len);



More information about the arch-commits mailing list