Skip to content

Commit 870f7cc

Browse files
authored
Merge pull request #6394 from douzzer/20230509-THIS_MODULE-mem-and-more-Wconversion
20230509-THIS_MODULE-mem-and-more-Wconversion
2 parents 04e831f + f2c97d5 commit 870f7cc

9 files changed

Lines changed: 80 additions & 60 deletions

File tree

linuxkm/linuxkm_memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/* included by wolfcrypt/src/memory.c */
2323

24-
#if defined(WOLFSSL_LINUXKM_SIMD_X86)
24+
#if defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS) && defined(CONFIG_X86)
2525
#ifdef LINUXKM_SIMD_IRQ
2626
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
2727
static union fpregs_state **wolfcrypt_linuxkm_fpu_states = NULL;
@@ -335,7 +335,7 @@
335335

336336
return;
337337
}
338-
#endif /* WOLFSSL_LINUXKM_SIMD_X86 && WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED */
338+
#endif /* WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS && CONFIG_X86 */
339339

340340
#if defined(__PIE__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
341341
/* needed in 6.1+ because show_free_areas() static definition in mm.h calls

linuxkm/linuxkm_wc_port.h

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,30 @@
119119
#endif
120120
#include <linux/net.h>
121121
#include <linux/slab.h>
122+
122123
#if defined(WOLFSSL_AESNI) || defined(USE_INTEL_SPEEDUP) || defined(WOLFSSL_SP_X86_64_ASM)
123124
#ifndef CONFIG_X86
124125
#error X86 SIMD extensions requested, but CONFIG_X86 is not set.
125126
#endif
127+
#ifndef WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS
128+
#define WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS
129+
#endif
130+
#elif defined(WOLFSSL_ARMASM) || defined(WOLFSSL_SP_ARM32_ASM) || \
131+
defined(WOLFSSL_SP_ARM64_ASM) || defined(WOLFSSL_SP_ARM_THUMB_ASM) ||\
132+
defined(WOLFSSL_SP_ARM_CORTEX_M_ASM)
133+
#if !defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
134+
#error ARM SIMD extensions requested, but CONFIG_ARM* is not set.
135+
#endif
136+
#ifndef WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS
137+
#define WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS
138+
#endif
139+
#else
140+
#ifndef WOLFSSL_NO_ASM
141+
#define WOLFSSL_NO_ASM
142+
#endif
143+
#endif
144+
145+
#if defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS) && defined(CONFIG_X86)
126146
#define WOLFSSL_LINUXKM_SIMD
127147
#define WOLFSSL_LINUXKM_SIMD_X86
128148
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
@@ -148,28 +168,21 @@
148168
#ifndef RESTORE_VECTOR_REGISTERS
149169
#define RESTORE_VECTOR_REGISTERS() restore_vector_registers_x86()
150170
#endif
151-
#elif defined(WOLFSSL_ARMASM) || defined(WOLFSSL_SP_ARM32_ASM) || \
152-
defined(WOLFSSL_SP_ARM64_ASM) || defined(WOLFSSL_SP_ARM_THUMB_ASM) ||\
153-
defined(WOLFSSL_SP_ARM_CORTEX_M_ASM)
154-
#if !defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
155-
#error ARM SIMD extensions requested, but CONFIG_ARM* is not set.
156-
#endif
171+
#elif defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS) && (defined(CONFIG_ARM) || defined(CONFIG_ARM64))
157172
#define WOLFSSL_LINUXKM_SIMD
158173
#define WOLFSSL_LINUXKM_SIMD_ARM
159174
#include <asm/fpsimd.h>
175+
#ifdef LINUXKM_SIMD_IRQ
176+
#error LINUXKM_SIMD_IRQ is unavailable on ARM (not implemented)
177+
#endif
160178
#ifndef SAVE_VECTOR_REGISTERS
161179
#define SAVE_VECTOR_REGISTERS(fail_clause) { int _svr_ret = save_vector_registers_arm(); if (_svr_ret != 0) { fail_clause } }
162180
#endif
163181
#ifndef RESTORE_VECTOR_REGISTERS
164182
#define RESTORE_VECTOR_REGISTERS() restore_vector_registers_arm()
165183
#endif
166-
#ifdef LINUXKM_SIMD_IRQ
167-
#error LINUXKM_SIMD_IRQ is unavailable on ARM (not implemented)
168-
#endif
169-
#else
170-
#ifndef WOLFSSL_NO_ASM
171-
#define WOLFSSL_NO_ASM
172-
#endif
184+
#elif defined(WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS)
185+
#error WOLFSSL_LINUXKM_USE_SAVE_VECTOR_REGISTERS is set for an unsupported architecture.
173186
#endif
174187

175188
_Pragma("GCC diagnostic pop");

linuxkm/module_hooks.c

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,21 @@ static int wolfssl_init(void)
141141

142142
#ifdef HAVE_LINUXKM_PIE_SUPPORT
143143

144-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
145-
#define THIS_MODULE_BASE (THIS_MODULE->core_layout.base)
144+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
145+
/* see linux commit ac3b432839 */
146+
#define THIS_MODULE_TEXT_BASE (THIS_MODULE->mem[MOD_TEXT].base)
147+
#define THIS_MODULE_TEXT_SIZE (THIS_MODULE->mem[MOD_TEXT].size)
148+
#define THIS_MODULE_RO_BASE (THIS_MODULE->mem[MOD_RODATA].base)
149+
#define THIS_MODULE_RO_SIZE (THIS_MODULE->mem[MOD_RODATA].size)
150+
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
151+
#define THIS_MODULE_TEXT_BASE (THIS_MODULE->core_layout.base)
146152
#define THIS_MODULE_TEXT_SIZE (THIS_MODULE->core_layout.text_size)
153+
#define THIS_MODULE_RO_BASE ((char *)THIS_MODULE->core_layout.base + THIS_MODULE->core_layout.text_size)
147154
#define THIS_MODULE_RO_SIZE (THIS_MODULE->core_layout.ro_size)
148155
#else
149-
#define THIS_MODULE_BASE (THIS_MODULE->module_core)
156+
#define THIS_MODULE_TEXT_BASE (THIS_MODULE->module_core)
150157
#define THIS_MODULE_TEXT_SIZE (THIS_MODULE->core_text_size)
158+
#define THIS_MODULE_RO_BASE ((char *)THIS_MODULE->module_core + THIS_MODULE->core_ro_size)
151159
#define THIS_MODULE_RO_SIZE (THIS_MODULE->core_ro_size)
152160
#endif
153161

@@ -159,8 +167,8 @@ static int wolfssl_init(void)
159167
unsigned int text_hash, rodata_hash;
160168

161169
if ((pie_text_start < pie_text_end) &&
162-
(pie_text_start >= (char *)THIS_MODULE_BASE) &&
163-
(pie_text_end - (char *)THIS_MODULE_BASE <= THIS_MODULE_TEXT_SIZE))
170+
(pie_text_start >= (char *)THIS_MODULE_TEXT_BASE) &&
171+
(pie_text_end - (char *)THIS_MODULE_TEXT_BASE <= THIS_MODULE_TEXT_SIZE))
164172
{
165173
text_hash = hash_span(pie_text_start, pie_text_end);
166174
} else {
@@ -169,14 +177,14 @@ static int wolfssl_init(void)
169177
pie_text_start,
170178
pie_text_end,
171179
pie_text_end-pie_text_start,
172-
THIS_MODULE_BASE,
173-
(char *)THIS_MODULE_BASE + THIS_MODULE_TEXT_SIZE);
180+
THIS_MODULE_TEXT_BASE,
181+
(char *)THIS_MODULE_TEXT_BASE + THIS_MODULE_TEXT_SIZE);
174182
text_hash = 0;
175183
}
176184

177185
if ((pie_rodata_start < pie_rodata_end) && // cppcheck-suppress comparePointers
178-
(pie_rodata_start >= (char *)THIS_MODULE_BASE + THIS_MODULE_TEXT_SIZE) &&
179-
(pie_rodata_end - (char *)THIS_MODULE_BASE <= THIS_MODULE_RO_SIZE))
186+
(pie_rodata_start >= (char *)THIS_MODULE_RO_BASE) &&
187+
(pie_rodata_end - (char *)THIS_MODULE_RO_BASE <= THIS_MODULE_RO_SIZE))
180188
{
181189
rodata_hash = hash_span(pie_rodata_start, pie_rodata_end);
182190
} else {
@@ -185,19 +193,19 @@ static int wolfssl_init(void)
185193
pie_rodata_start,
186194
pie_rodata_end,
187195
pie_rodata_end-pie_rodata_start,
188-
(char *)THIS_MODULE_BASE + THIS_MODULE_TEXT_SIZE,
189-
(char *)THIS_MODULE_BASE + THIS_MODULE_RO_SIZE);
196+
(char *)THIS_MODULE_RO_BASE,
197+
(char *)THIS_MODULE_RO_BASE + THIS_MODULE_RO_SIZE);
190198
rodata_hash = 0;
191199
}
192200

193201
/* note, "%pK" conceals the actual layout information. "%px" exposes
194202
* the true module start address, which is potentially useful to an
195203
* attacker.
196204
*/
197-
pr_info("wolfCrypt container hashes (spans): %x (%lu) %x (%lu), module base %pK\n",
205+
pr_info("wolfCrypt container hashes (spans): %x (%lu) %x (%lu), text base %pK, ro base %pK\n",
198206
text_hash, pie_text_end-pie_text_start,
199207
rodata_hash, pie_rodata_end-pie_rodata_start,
200-
THIS_MODULE_BASE);
208+
THIS_MODULE_TEXT_BASE, THIS_MODULE_RO_BASE);
201209
}
202210
#endif /* HAVE_LINUXKM_PIE_SUPPORT */
203211

wolfcrypt/src/asn.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@ int GetLength_ex(const byte* input, word32* inOutIdx, int* len, word32 maxIdx,
21592159
/* Bottom 7 bits are the number of bytes to calculate length with.
21602160
* Note: 0 indicates indefinite length encoding *not* 0 bytes of length.
21612161
*/
2162-
word32 bytes = b & 0x7F;
2162+
word32 bytes = (word32)b & 0x7FU;
21632163
int minLen;
21642164

21652165
/* Calculate minimum length to be encoded with bytes. */
@@ -2935,7 +2935,7 @@ static int SetASNIntMP(mp_int* n, int maxSz, byte* output)
29352935
length = mp_unsigned_bin_size(n);
29362936
if (maxSz >= 0 && (1 + length + (leadingBit ? 1 : 0)) > maxSz)
29372937
return BUFFER_E;
2938-
idx = SetASNInt(length, leadingBit ? 0x80 : 0x00, output);
2938+
idx = SetASNInt(length, (byte)(leadingBit ? 0x80U : 0x00U), output);
29392939
if (maxSz >= 0 && (idx + length) > maxSz)
29402940
return BUFFER_E;
29412941

@@ -14468,7 +14468,7 @@ word32 SetLength(word32 length, byte* output)
1446814468

1446914469
if (output) {
1447014470
/* Encode count byte. */
14471-
output[i] = j | ASN_LONG_LENGTH;
14471+
output[i] = (byte)(j | ASN_LONG_LENGTH);
1447214472
}
1447314473
/* Skip over count byte. */
1447414474
i++;
@@ -14550,8 +14550,8 @@ word32 SetSet(word32 len, byte* output)
1455014550
*/
1455114551
word32 SetImplicit(byte tag, byte number, word32 len, byte* output)
1455214552
{
14553-
tag = ((tag == ASN_SEQUENCE || tag == ASN_SET) ? ASN_CONSTRUCTED : 0)
14554-
| ASN_CONTEXT_SPECIFIC | number;
14553+
tag = (byte)(((tag == ASN_SEQUENCE || tag == ASN_SET) ? ASN_CONSTRUCTED : 0)
14554+
| ASN_CONTEXT_SPECIFIC | number);
1455514555
return SetHeader(tag, len, output);
1455614556
}
1455714557

@@ -14566,8 +14566,8 @@ word32 SetImplicit(byte tag, byte number, word32 len, byte* output)
1456614566
*/
1456714567
word32 SetExplicit(byte number, word32 len, byte* output)
1456814568
{
14569-
return SetHeader(ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | number, len,
14570-
output);
14569+
return SetHeader((byte)(ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | number),
14570+
len, output);
1457114571
}
1457214572

1457314573
#if defined(OPENSSL_EXTRA)
@@ -14754,8 +14754,7 @@ word32 SetAlgoID(int algoOID, byte* output, int type, int curveSz)
1475414754

1475514755
tagSz = (type == oidHashType ||
1475614756
(type == oidSigType && !IsSigAlgoECC((word32)algoOID)) ||
14757-
(type == oidKeyType && algoOID == RSAk)) ? 2 : 0;
14758-
14757+
(type == oidKeyType && algoOID == RSAk)) ? 2U : 0U;
1475914758
algoName = OidFromId((word32)algoOID, (word32)type, &algoSz);
1476014759
if (algoName == NULL) {
1476114760
WOLFSSL_MSG("Unknown Algorithm");
@@ -18634,7 +18633,7 @@ static int DecodeSubtree(const byte* input, word32 sz, Base_entry** head,
1863418633
}
1863518634

1863618635
/* Get type, LSB 4-bits */
18637-
bType = (b & ASN_TYPE_MASK);
18636+
bType = (byte)(b & ASN_TYPE_MASK);
1863818637

1863918638
if (bType == ASN_DNS_TYPE || bType == ASN_RFC822_TYPE ||
1864018639
bType == ASN_DIR_TYPE) {
@@ -21988,7 +21987,7 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
2198821987

2198921988
if (decrementMaxPathLen && cert->ca->maxPathLen > 0) {
2199021989
WOLFSSL_MSG("\tmaxPathLen status: reduce by 1");
21991-
cert->maxPathLen = cert->ca->maxPathLen - 1;
21990+
cert->maxPathLen = (byte)(cert->ca->maxPathLen - 1);
2199221991
if (verify != NO_VERIFY && type != CA_TYPE &&
2199321992
type != TRUSTED_PEER_TYPE) {
2199421993
WOLFSSL_MSG("\tmaxPathLen status: OK");
@@ -22006,7 +22005,7 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
2200622005
} else if (cert->ca && cert->isCA) {
2200722006
/* case where cert->pathLength extension is not set */
2200822007
if (cert->ca->maxPathLen > 0) {
22009-
cert->maxPathLen = cert->ca->maxPathLen - 1;
22008+
cert->maxPathLen = (byte)(cert->ca->maxPathLen - 1);
2201022009
} else {
2201122010
cert->maxPathLen = 0;
2201222011
if (verify != NO_VERIFY && type != CA_TYPE &&
@@ -31240,15 +31239,15 @@ int StoreECC_DSA_Sig_Bin(byte* out, word32* outLen, const byte* r, word32 rLen,
3124031239
idx = SetSequence(rLen+rAddLeadZero + sLen+sAddLeadZero + headerSz, out);
3124131240

3124231241
/* store r */
31243-
ret = SetASNInt((int)rLen, rAddLeadZero ? 0x80 : 0x00, &out[idx]);
31242+
ret = SetASNInt((int)rLen, (byte)(rAddLeadZero ? 0x80U : 0x00U), &out[idx]);
3124431243
if (ret < 0)
3124531244
return ret;
3124631245
idx += (word32)ret;
3124731246
XMEMCPY(&out[idx], r, rLen);
3124831247
idx += rLen;
3124931248

3125031249
/* store s */
31251-
ret = SetASNInt((int)sLen, sAddLeadZero ? 0x80 : 0x00, &out[idx]);
31250+
ret = SetASNInt((int)sLen, (byte)(sAddLeadZero ? 0x80U : 0x00U), &out[idx]);
3125231251
if (ret < 0)
3125331252
return ret;
3125431253
idx += (word32)ret;

wolfcrypt/src/coding.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ static WC_INLINE byte Base64_Char2Val(byte c)
100100
byte mask;
101101

102102
c -= BASE64_MIN;
103-
mask = (((byte)(0x3f - c)) >> 7) - 1;
103+
mask = (byte)((((byte)(0x3f - c)) >> 7) - 1);
104104
/* Load a value from the first cache line and use when mask set. */
105-
v = base64Decode[ c & 0x3f ] & mask ;
105+
v = (byte)(base64Decode[ c & 0x3f ] & mask);
106106
/* Load a value from the second cache line and use when mask not set. */
107-
v |= base64Decode[(c & 0x0f) | 0x40] & (~mask);
107+
v |= (byte)(base64Decode[(c & 0x0f) | 0x40] & (~mask));
108108

109109
return v;
110110
#else
@@ -236,8 +236,8 @@ int Base64_Decode(const byte* in, word32 inLen, byte* out, word32* outLen)
236236

237237
e1 = Base64_Char2Val(e1);
238238
e2 = Base64_Char2Val(e2);
239-
e3 = (e3 == PAD) ? 0 : Base64_Char2Val(e3);
240-
e4 = (e4 == PAD) ? 0 : Base64_Char2Val(e4);
239+
e3 = (byte)((e3 == PAD) ? 0 : Base64_Char2Val(e3));
240+
e4 = (byte)((e4 == PAD) ? 0 : Base64_Char2Val(e4));
241241

242242
if (e1 == BAD || e2 == BAD || e3 == BAD || e4 == BAD) {
243243
WOLFSSL_MSG("Bad Base64 Decode bad character");

wolfcrypt/src/ecc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ static int wc_ecc_curve_load(const ecc_set_type* dp, ecc_curve_spec** pCurve,
16331633
curve->dp = dp; /* set dp info */
16341634

16351635
/* determine items to load */
1636-
load_items = (((byte)~(word32)curve->load_mask) & load_mask);
1636+
load_items = (byte)(((byte)~(word32)curve->load_mask) & load_mask);
16371637
curve->load_mask |= load_items;
16381638

16391639
/* load items */
@@ -6928,7 +6928,7 @@ int wc_ecc_sign_hash_ex(const byte* in, word32 inlen, WC_RNG* rng,
69286928

69296929
/* may still need bit truncation too */
69306930
if (err == MP_OKAY && (WOLFSSL_BIT_SIZE * inlen) > orderBits)
6931-
mp_rshb(e, WOLFSSL_BIT_SIZE - (orderBits & 0x7));
6931+
mp_rshb(e, (int)(WOLFSSL_BIT_SIZE - (orderBits & 0x7)));
69326932
}
69336933

69346934
/* make up a key and export the public copy */
@@ -8389,7 +8389,7 @@ static int ecc_verify_hash(mp_int *r, mp_int *s, const byte* hash,
83898389

83908390
/* may still need bit truncation too */
83918391
if (err == MP_OKAY && (WOLFSSL_BIT_SIZE * hashlen) > orderBits)
8392-
mp_rshb(e, WOLFSSL_BIT_SIZE - (orderBits & 0x7));
8392+
mp_rshb(e, (int)(WOLFSSL_BIT_SIZE - (orderBits & 0x7)));
83938393
}
83948394

83958395
/* check for async hardware acceleration */

wolfcrypt/src/hmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ int wc_HmacSetKey(Hmac* hmac, int type, const byte* key, word32 length)
586586
XMEMSET(ip + length, 0, hmac_block_size - length);
587587

588588
for(i = 0; i < hmac_block_size; i++) {
589-
op[i] = ip[i] ^ OPAD;
589+
op[i] = (byte)(ip[i] ^ OPAD);
590590
ip[i] ^= IPAD;
591591
}
592592
}

wolfcrypt/src/misc.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ WC_MISC_STATIC WC_INLINE void xorbufout(void* out, const void* buf,
289289
/* Move alignment so that it lines up with a
290290
* WOLFSSL_WORD_SIZE boundary */
291291
while (((wc_ptr_t)b) % WOLFSSL_WORD_SIZE != 0 && count > 0) {
292-
*(o++) = *(b++) ^ *(m++);
292+
*(o++) = (byte)(*(b++) ^ *(m++));
293293
count--;
294294
}
295295
XorWordsOut( (wolfssl_word**)&o, (const wolfssl_word**)&b,
@@ -298,7 +298,7 @@ WC_MISC_STATIC WC_INLINE void xorbufout(void* out, const void* buf,
298298
}
299299

300300
for (i = 0; i < count; i++)
301-
o[i] = b[i] ^ m[i];
301+
o[i] = (byte)(b[i] ^ m[i]);
302302
}
303303

304304
/* This routine performs a bitwise XOR operation of <*r> and <*a> for <n> number
@@ -505,8 +505,8 @@ WC_MISC_STATIC WC_INLINE int ByteToHexStr(byte in, char* out)
505505
if (out == NULL)
506506
return -1;
507507

508-
out[0] = ByteToHex(in >> 4);
509-
out[1] = ByteToHex(in & 0xf);
508+
out[0] = ByteToHex((byte)(in >> 4));
509+
out[1] = ByteToHex((byte)(in & 0xf));
510510
return 0;
511511
}
512512

@@ -544,7 +544,7 @@ WC_MISC_STATIC WC_INLINE byte ctMaskLTE(int a, int b)
544544
/* Constant time - mask set when a == b. */
545545
WC_MISC_STATIC WC_INLINE byte ctMaskEq(int a, int b)
546546
{
547-
return (byte)(~ctMaskGT(a, b)) & (byte)(~ctMaskLT(a, b));
547+
return (byte)((byte)(~ctMaskGT(a, b)) & (byte)(~ctMaskLT(a, b)));
548548
}
549549

550550
/* Constant time - sets 16 bit integer mask when a > b */
@@ -574,13 +574,13 @@ WC_MISC_STATIC WC_INLINE word16 ctMask16LTE(int a, int b)
574574
/* Constant time - sets 16 bit integer mask when a == b. */
575575
WC_MISC_STATIC WC_INLINE word16 ctMask16Eq(int a, int b)
576576
{
577-
return (word16)(~ctMask16GT(a, b)) & (word16)(~ctMask16LT(a, b));
577+
return (word16)((word16)(~ctMask16GT(a, b)) & (word16)(~ctMask16LT(a, b)));
578578
}
579579

580580
/* Constant time - mask set when a != b. */
581581
WC_MISC_STATIC WC_INLINE byte ctMaskNotEq(int a, int b)
582582
{
583-
return (byte)ctMaskGT(a, b) | (byte)ctMaskLT(a, b);
583+
return (byte)((byte)ctMaskGT(a, b) | (byte)ctMaskLT(a, b));
584584
}
585585

586586
/* Constant time - select a when mask is set and b otherwise. */

0 commit comments

Comments
 (0)