-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
depends/common/ffmpeg/0004-ffmpeg-linux-fix-asm-binutil-since-2.41.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- a/libavcodec/x86/mathops.h | ||
+++ b/libavcodec/x86/mathops.h | ||
@@ -35,12 +35,20 @@ | ||
static av_always_inline av_const int MULL(int a, int b, unsigned shift) | ||
{ | ||
int rt, dummy; | ||
+ if (__builtin_constant_p(shift)) | ||
__asm__ ( | ||
"imull %3 \n\t" | ||
"shrdl %4, %%edx, %%eax \n\t" | ||
:"=a"(rt), "=d"(dummy) | ||
- :"a"(a), "rm"(b), "ci"((uint8_t)shift) | ||
+ :"a"(a), "rm"(b), "i"(shift & 0x1F) | ||
); | ||
+ else | ||
+ __asm__ ( | ||
+ "imull %3 \n\t" | ||
+ "shrdl %4, %%edx, %%eax \n\t" | ||
+ :"=a"(rt), "=d"(dummy) | ||
+ :"a"(a), "rm"(b), "c"((uint8_t)shift) | ||
+ ); | ||
return rt; | ||
} | ||
|
||
@@ -113,19 +121,31 @@ __asm__ volatile(\ | ||
// avoid +32 for shift optimization (gcc should do that ...) | ||
#define NEG_SSR32 NEG_SSR32 | ||
static inline int32_t NEG_SSR32( int32_t a, int8_t s){ | ||
+ if (__builtin_constant_p(s)) | ||
__asm__ ("sarl %1, %0\n\t" | ||
: "+r" (a) | ||
- : "ic" ((uint8_t)(-s)) | ||
+ : "i" (-s & 0x1F) | ||
); | ||
+ else | ||
+ __asm__ ("sarl %1, %0\n\t" | ||
+ : "+r" (a) | ||
+ : "c" ((uint8_t)(-s)) | ||
+ ); | ||
return a; | ||
} | ||
|
||
#define NEG_USR32 NEG_USR32 | ||
static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ | ||
+ if (__builtin_constant_p(s)) | ||
__asm__ ("shrl %1, %0\n\t" | ||
: "+r" (a) | ||
- : "ic" ((uint8_t)(-s)) | ||
+ : "i" (-s & 0x1F) | ||
); | ||
+ else | ||
+ __asm__ ("shrl %1, %0\n\t" | ||
+ : "+r" (a) | ||
+ : "c" ((uint8_t)(-s)) | ||
+ ); | ||
return a; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
depends/common/gnutls/0002-hack-fix-about-rsa_compute_root_tr.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
From a333f0d2dde8cfc6d784351be4ec062f12a21dd8 Mon Sep 17 00:00:00 2001 | ||
From: Alwin Esch <[email protected]> | ||
Date: Tue, 26 Mar 2024 22:52:39 +0100 | ||
Subject: [PATCH] hack-fix-about-rsa_compute_root_tr | ||
|
||
--- | ||
lib/nettle/backport/rsa-sign-tr.c | 18 +++++++++--------- | ||
1 file changed, 9 insertions(+), 9 deletions(-) | ||
|
||
diff --git a/lib/nettle/backport/rsa-sign-tr.c b/lib/nettle/backport/rsa-sign-tr.c | ||
index 83a5d52..6b22dc4 100644 | ||
--- a/lib/nettle/backport/rsa-sign-tr.c | ||
+++ b/lib/nettle/backport/rsa-sign-tr.c | ||
@@ -88,10 +88,10 @@ rsa_unblind (const struct rsa_public_key *pub, | ||
* attacks which rely on faults on hardware, or even software MPI | ||
* implementation. */ | ||
int | ||
-rsa_compute_root_tr(const struct rsa_public_key *pub, | ||
- const struct rsa_private_key *key, | ||
- void *random_ctx, nettle_random_func *random, | ||
- mpz_t x, const mpz_t m) | ||
+backport_rsa_compute_root_tr(const struct rsa_public_key *pub, | ||
+ const struct rsa_private_key *key, | ||
+ void *random_ctx, nettle_random_func *random, | ||
+ mpz_t x, const mpz_t m) | ||
{ | ||
int res; | ||
mpz_t t, mb, xb, ri; | ||
@@ -142,7 +142,7 @@ _rsa_sec_compute_root_tr(const struct rsa_public_key *pub, | ||
|
||
nn = mpz_size (pub->n); | ||
|
||
- res = rsa_compute_root_tr(pub, key, random_ctx, random, xz, | ||
+ res = backport_rsa_compute_root_tr(pub, key, random_ctx, random, xz, | ||
mpz_roinit_n(mz, m, nn)); | ||
|
||
if (res) | ||
@@ -347,10 +347,10 @@ _rsa_sec_compute_root_tr(const struct rsa_public_key *pub, | ||
* in buffer copying both in case of success or error. | ||
*/ | ||
int | ||
-rsa_compute_root_tr(const struct rsa_public_key *pub, | ||
- const struct rsa_private_key *key, | ||
- void *random_ctx, nettle_random_func *random, | ||
- mpz_t x, const mpz_t m) | ||
+backport_rsa_compute_root_tr(const struct rsa_public_key *pub, | ||
+ const struct rsa_private_key *key, | ||
+ void *random_ctx, nettle_random_func *random, | ||
+ mpz_t x, const mpz_t m) | ||
{ | ||
TMP_GMP_DECL (l, mp_limb_t); | ||
mp_size_t nn = mpz_size(pub->n); | ||
-- | ||
2.40.1 | ||
|