Skip to content

Commit 5ada7a0

Browse files
authored
Merge pull request #66 from rapier1/bug-128bit-xor
Temporary bug fix for 128bit xors in AES-CTR-MT.
2 parents 2a3392d + ca7744e commit 5ada7a0

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

cipher-ctr-mt-functions.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,15 @@ int aes_mt_do_cipher(void *vevp_ctx,
608608
* may need to do it in 8 or 4 bytes chunks
609609
* worst case is doing it as a loop */
610610
#ifdef CIPHER_INT128_OK
611-
if ((align & 0xf) == 0) {
612-
destp.u128[0] = srcp.u128[0] ^ bufp.u128[0];
613-
} else
611+
/* with GCC 13 we have having consistent seg faults
612+
* in this section of code. Since this is a critical
613+
* code path we are removing this until we have a solution
614+
* in place -cjr 02/22/24
615+
* TODO: FIX THIS
616+
*/
617+
/* if ((align & 0xf) == 0) { */
618+
/* destp.u128[0] = srcp.u128[0] ^ bufp.u128[0]; */
619+
/* } else */
614620
#endif
615621
/* 64 bits */
616622
if ((align & 0x7) == 0) {

cipher-ctr-mt.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,15 @@ ssh_aes_ctr(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
461461
* may need to do it in 8 or 4 bytes chunks
462462
* worst case is doing it as a loop */
463463
#ifdef CIPHER_INT128_OK
464-
if ((align & 0xf) == 0) {
465-
destp.u128[0] = srcp.u128[0] ^ bufp.u128[0];
466-
} else
464+
/* with GCC 13 we have having consistent seg faults
465+
* in this section of code. Since this is a critical
466+
* code path we are removing this until we have a solution
467+
* in place -cjr 02/22/24
468+
* TODO: FIX THIS
469+
*/
470+
/* if ((align & 0xf) == 0) { */
471+
/* destp.u128[0] = srcp.u128[0] ^ bufp.u128[0]; */
472+
/* } else */
467473
#endif
468474
/* 64 bits */
469475
if ((align & 0x7) == 0) {

0 commit comments

Comments
 (0)