It can be but I wondered if it could be done on several say words at once.
– BipmanApr 28 '17 at 15:56
1
With XOR, trivially. I still don't get where the modular arithmetic comes in though.
– haroldApr 28 '17 at 16:00
For what I am doing, mod arithmetic on several words at once would be good, if not then I'll do it conventionally.
– BipmanApr 28 '17 at 19:16
OK then the question is still, do you have more details - not a high level purpose, but specifically what operation are you executing. A general modulo operation is annoying, so it's important to know whether you're in any of the special cases.
– haroldApr 28 '17 at 19:33
Forget mod arithmetic, I meant xor as per your message. x is the byte in the key (same length as file) and y is the byte from the message so x xor y produces z the encrypted byte. If several xor processes could be done at once it would save time with large files.
– BipmanApr 29 '17 at 06:32
1
In GCC and Clang you can just write a normal loop with byte-by-byte XORs and it will be vectorized automatically
– haroldApr 29 '17 at 11:23
Ok well use `pxor` or `vpxor`, do you know how to do the rest? It's basically like [this](http://stackoverflow.com/a/9603039/555045) but XOR instead of ADD.
– haroldApr 29 '17 at 11:44