Skip to content

Instantly share code, notes, and snippets.

@benjamingeiger
Created November 25, 2012 20:57
Show Gist options
  • Save benjamingeiger/4145298 to your computer and use it in GitHub Desktop.
Save benjamingeiger/4145298 to your computer and use it in GitHub Desktop.
How do I parallelize this?
for (round = 1; round <= 9; round++) {
temp.x =
key[round].x
^ Te0[(ciphertext.x >> 24) & 0xFF]
^ Te1[(ciphertext.y >> 16) & 0xFF]
^ Te2[(ciphertext.z >> 8) & 0xFF]
^ Te3[(ciphertext.w >> 0) & 0xFF];
temp.y =
key[round].y
^ Te0[(ciphertext.y >> 24) & 0xFF]
^ Te1[(ciphertext.z >> 16) & 0xFF]
^ Te2[(ciphertext.w >> 8) & 0xFF]
^ Te3[(ciphertext.x >> 0) & 0xFF];
temp.z =
key[round].z
^ Te0[(ciphertext.z >> 24) & 0xFF]
^ Te1[(ciphertext.w >> 16) & 0xFF]
^ Te2[(ciphertext.x >> 8) & 0xFF]
^ Te3[(ciphertext.y >> 0) & 0xFF];
temp.w =
key[round].w
^ Te0[(ciphertext.w >> 24) & 0xFF]
^ Te1[(ciphertext.x >> 16) & 0xFF]
^ Te2[(ciphertext.y >> 8) & 0xFF]
^ Te3[(ciphertext.z >> 0) & 0xFF];
ciphertext = temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment