diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/modes/gcm128.c | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/modes/modes_local.h | 38 |
2 files changed, 2 insertions, 44 deletions
diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c index 29f289cb7e..fb03f72754 100644 --- a/src/lib/libcrypto/modes/gcm128.c +++ b/src/lib/libcrypto/modes/gcm128.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: gcm128.c,v 1.31 2025/04/23 14:12:38 jsing Exp $ */ | 1 | /* $OpenBSD: gcm128.c,v 1.32 2025/04/23 14:15:19 jsing Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -55,12 +55,6 @@ | |||
| 55 | #include "crypto_internal.h" | 55 | #include "crypto_internal.h" |
| 56 | #include "modes_local.h" | 56 | #include "modes_local.h" |
| 57 | 57 | ||
| 58 | #if defined(BSWAP4) && defined(__STRICT_ALIGNMENT) | ||
| 59 | /* redefine, because alignment is ensured */ | ||
| 60 | #undef GETU32 | ||
| 61 | #define GETU32(p) BSWAP4(*(const u32 *)(p)) | ||
| 62 | #endif | ||
| 63 | |||
| 64 | #define PACK(s) ((size_t)(s)<<(sizeof(size_t)*8-16)) | 58 | #define PACK(s) ((size_t)(s)<<(sizeof(size_t)*8-16)) |
| 65 | #define REDUCE1BIT(V) \ | 59 | #define REDUCE1BIT(V) \ |
| 66 | do { \ | 60 | do { \ |
diff --git a/src/lib/libcrypto/modes/modes_local.h b/src/lib/libcrypto/modes/modes_local.h index 6e3336dad9..c04db034d0 100644 --- a/src/lib/libcrypto/modes/modes_local.h +++ b/src/lib/libcrypto/modes/modes_local.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: modes_local.h,v 1.3 2025/04/22 14:03:05 jsing Exp $ */ | 1 | /* $OpenBSD: modes_local.h,v 1.4 2025/04/23 14:15:19 jsing Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -27,42 +27,6 @@ typedef unsigned long long u64; | |||
| 27 | typedef unsigned int u32; | 27 | typedef unsigned int u32; |
| 28 | typedef unsigned char u8; | 28 | typedef unsigned char u8; |
| 29 | 29 | ||
| 30 | #if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) | ||
| 31 | #if defined(__GNUC__) && __GNUC__>=2 | ||
| 32 | # if defined(__x86_64) || defined(__x86_64__) | ||
| 33 | # define BSWAP8(x) ({ u64 ret=(x); \ | ||
| 34 | asm ("bswapq %0" \ | ||
| 35 | : "+r"(ret)); ret; }) | ||
| 36 | # define BSWAP4(x) ({ u32 ret=(x); \ | ||
| 37 | asm ("bswapl %0" \ | ||
| 38 | : "+r"(ret)); ret; }) | ||
| 39 | # elif (defined(__i386) || defined(__i386__)) | ||
| 40 | # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ | ||
| 41 | asm ("bswapl %0; bswapl %1" \ | ||
| 42 | : "+r"(hi),"+r"(lo)); \ | ||
| 43 | (u64)hi<<32|lo; }) | ||
| 44 | # define BSWAP4(x) ({ u32 ret=(x); \ | ||
| 45 | asm ("bswapl %0" \ | ||
| 46 | : "+r"(ret)); ret; }) | ||
| 47 | # elif (defined(__arm__) || defined(__arm)) && !defined(__STRICT_ALIGNMENT) | ||
| 48 | # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \ | ||
| 49 | asm ("rev %0,%0; rev %1,%1" \ | ||
| 50 | : "+r"(hi),"+r"(lo)); \ | ||
| 51 | (u64)hi<<32|lo; }) | ||
| 52 | # define BSWAP4(x) ({ u32 ret; \ | ||
| 53 | asm ("rev %0,%1" \ | ||
| 54 | : "=r"(ret) : "r"((u32)(x))); \ | ||
| 55 | ret; }) | ||
| 56 | # endif | ||
| 57 | #endif | ||
| 58 | #endif | ||
| 59 | |||
| 60 | #if defined(BSWAP4) && !defined(__STRICT_ALIGNMENT) | ||
| 61 | #define GETU32(p) BSWAP4(*(const u32 *)(p)) | ||
| 62 | #else | ||
| 63 | #define GETU32(p) ((u32)(p)[0]<<24|(u32)(p)[1]<<16|(u32)(p)[2]<<8|(u32)(p)[3]) | ||
| 64 | #endif | ||
| 65 | |||
| 66 | /* GCM definitions */ | 30 | /* GCM definitions */ |
| 67 | 31 | ||
| 68 | typedef struct { | 32 | typedef struct { |
