Skip to content

Commit

Permalink
Forgot to hit save when restoring fastXOR
Browse files Browse the repository at this point in the history
  • Loading branch information
rapier1 committed Jun 30, 2023
1 parent 917dd1f commit d119e07
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions cipher-chachapoly-libcrypto-mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,12 @@ fastXOR(u_char *dest, const u_char *src, const u_char *keystream, u_int len)

/* XXX: this was __uint128_t but that was causing unaligned load errors.
* this works but we need to explore it more. */
// typedef __uint32_t chunk;
typedef __uint32_t chunk;
size_t i;
for (i=0; i < len; i++)
dest[i] = src[i]^keystream[i];

// for (i=0; i < (len / sizeof(chunk)); i++)
// ((chunk *)dest)[i]=((chunk *)src)[i]^((chunk *)keystream)[i];
// for (i=i*(sizeof(chunk) / sizeof(char)); i < len; i++)
// dest[i]=src[i]^keystream[i];
for (i=0; i < (len / sizeof(chunk)); i++)
((chunk *)dest)[i]=((chunk *)src)[i]^((chunk *)keystream)[i];
for (i=i*(sizeof(chunk) / sizeof(char)); i < len; i++)
dest[i]=src[i]^keystream[i];
}

void
Expand Down

0 comments on commit d119e07

Please sign in to comment.