summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-11-03 13:26:22 +0100
committerTomas Mraz <tomas@openssl.org>2023-01-09 08:35:19 +0100
commit842311ae30b23b9ee54e6c5963c7c5f3fd1d8c25 (patch)
treed65d3f9c5f47ff4034d8aba795474b8767baa9d7 /crypto
parent6f252dd632afe0f24139a6c75958a8d8245a4e6a (diff)
Revert "Fix an occasional CI failure due to unaligned access"
This reverts commit 8511520842b744d1794ea794c032ce5f78cd874b. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19597) (cherry picked from commit f83490fb9ce4dd1c09d4f94526fbcad14bd2fd85)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bn/rsaz_exp_x2.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/crypto/bn/rsaz_exp_x2.c b/crypto/bn/rsaz_exp_x2.c
index c6542ad49a..f8b76d71d6 100644
--- a/crypto/bn/rsaz_exp_x2.c
+++ b/crypto/bn/rsaz_exp_x2.c
@@ -31,14 +31,6 @@ NON_EMPTY_TRANSLATION_UNIT
# define ALIGN64
# endif
-# if defined(__GNUC__)
-# define ALIGN1 __attribute__((aligned(1)))
-# elif defined(_MSC_VER)
-# define ALIGN1 __declspec(align(1))
-# else
-# define ALIGN1
-# endif
-
# define ALIGN_OF(ptr, boundary) \
((unsigned char *)(ptr) + (boundary - (((size_t)(ptr)) & (boundary - 1))))
@@ -478,9 +470,9 @@ static void to_words52(BN_ULONG *out, int out_len,
in_str = (uint8_t *)in;
for (; in_bitsize >= (2 * DIGIT_SIZE); in_bitsize -= (2 * DIGIT_SIZE), out += 2) {
- out[0] = (*(uint64_t_align1 *)in_str) & DIGIT_MASK;
+ out[0] = (*(uint64_t *)in_str) & DIGIT_MASK;
in_str += 6;
- out[1] = ((*(uint64_t_align1 *)in_str) >> 4) & DIGIT_MASK;
+ out[1] = ((*(uint64_t *)in_str) >> 4) & DIGIT_MASK;
in_str += 7;
out_len -= 2;
}
@@ -536,10 +528,11 @@ static void from_words52(BN_ULONG *out, int out_bitsize, const BN_ULONG *in)
{
uint8_t *out_str = (uint8_t *)out;
- for (; out_bitsize >= (2 * DIGIT_SIZE); out_bitsize -= (2 * DIGIT_SIZE), in += 2) {
- (*(uint64_t_align1 *)out_str) = in[0];
+ for (; out_bitsize >= (2 * DIGIT_SIZE);
+ out_bitsize -= (2 * DIGIT_SIZE), in += 2) {
+ (*(uint64_t *)out_str) = in[0];
out_str += 6;
- (*(uint64_t_align1 *)out_str) ^= in[1] << 4;
+ (*(uint64_t *)out_str) ^= in[1] << 4;
out_str += 7;
}