summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/modes/modes_local.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/modes/modes_local.h')
-rw-r--r--src/lib/libcrypto/modes/modes_local.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/lib/libcrypto/modes/modes_local.h b/src/lib/libcrypto/modes/modes_local.h
index 81994876e3..d833d40ee3 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.5 2025/05/17 14:43:17 jsing Exp $ */ 1/* $OpenBSD: modes_local.h,v 1.6 2025/05/18 09:05:59 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 *
@@ -15,37 +15,30 @@
15__BEGIN_HIDDEN_DECLS 15__BEGIN_HIDDEN_DECLS
16 16
17#if defined(_LP64) 17#if defined(_LP64)
18typedef long i64;
19typedef unsigned long u64;
20#define U64(C) C##UL 18#define U64(C) C##UL
21#else 19#else
22typedef long long i64;
23typedef unsigned long long u64;
24#define U64(C) C##ULL 20#define U64(C) C##ULL
25#endif 21#endif
26 22
27typedef unsigned int u32;
28typedef unsigned char u8;
29
30/* GCM definitions */ 23/* GCM definitions */
31 24
32typedef struct { 25typedef struct {
33 u64 hi, lo; 26 uint64_t hi, lo;
34} u128; 27} u128;
35 28
36struct gcm128_context { 29struct gcm128_context {
37 /* Following 6 names follow names in GCM specification */ 30 /* Following 6 names follow names in GCM specification */
38 union { 31 union {
39 u64 u[2]; 32 uint64_t u[2];
40 u32 d[4]; 33 uint32_t d[4];
41 u8 c[16]; 34 uint8_t c[16];
42 size_t t[16/sizeof(size_t)]; 35 size_t t[16/sizeof(size_t)];
43 } Yi, EKi, EK0, len, Xi, H; 36 } Yi, EKi, EK0, len, Xi, H;
44 /* Relative position of Xi, H and pre-computed Htable is used 37 /* Relative position of Xi, H and pre-computed Htable is used
45 * in some assembler modules, i.e. don't change the order! */ 38 * in some assembler modules, i.e. don't change the order! */
46 u128 Htable[16]; 39 u128 Htable[16];
47 void (*gmult)(u64 Xi[2], const u128 Htable[16]); 40 void (*gmult)(uint64_t Xi[2], const u128 Htable[16]);
48 void (*ghash)(u64 Xi[2], const u128 Htable[16], const u8 *inp, 41 void (*ghash)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp,
49 size_t len); 42 size_t len);
50 unsigned int mres, ares; 43 unsigned int mres, ares;
51 block128_f block; 44 block128_f block;
@@ -59,10 +52,10 @@ struct xts128_context {
59 52
60struct ccm128_context { 53struct ccm128_context {
61 union { 54 union {
62 u64 u[2]; 55 uint64_t u[2];
63 u8 c[16]; 56 uint8_t c[16];
64 } nonce, cmac; 57 } nonce, cmac;
65 u64 blocks; 58 uint64_t blocks;
66 block128_f block; 59 block128_f block;
67 void *key; 60 void *key;
68}; 61};