Using Salsa20, how would one seek to a byte position (assume it’s a multiple of 64) (using the public domain C implementation at http://cr.yp.to/snuffle/salsa20/merged/salsa20.c
I’ve tried this but it doesn’t work:
void seekIV(unsigned long int pos) {
int low_32bits, high_32bits;
pos /= 64;
low_32bits = pos & 0xffffffff;
high_32bits = (pos >> 32) & 0xffffffff;
printf("\n SEEKING TO %lu\n", pos * 64);
ctx.input[8] = low_32bits;
ctx.input[9] = high_32bits;
}
D’OH… the answer is… I forgot to also fseek in the stream 😉