Commit 16838859dc6b4ae1e48c642f6f5e2a9502c2ad10

Authored by KMG
1 parent c4ab254b
Exists in master and in 1 other branch v2

Added code to not use gf-complete mult_by_one if region size is small (less than 16 bytes).

Showing 1 changed file with 10 additions and 1 deletions   Show diff stats
src/galois.c
... ... @@ -326,7 +326,16 @@ void galois_w32_region_xor(void *src, void *dest, int nbytes)
326 326  
327 327 void galois_region_xor(char *src, char *dest, int nbytes)
328 328 {
329   - galois_w32_region_xor(src, dest, nbytes);
  329 + if (nbytes >= 16) {
  330 + galois_w32_region_xor(src, dest, nbytes);
  331 + } else {
  332 + int i = 0;
  333 + for (i = 0; i < nbytes; i++) {
  334 + *dest ^= *src;
  335 + dest++;
  336 + src++;
  337 + }
  338 + }
330 339 }
331 340  
332 341 int galois_inverse(int y, int w)
... ...