/* Encryption and decryption are symmetric */#define stream_decrypt stream_encryptstatic void stream_encrypt(stream_state *self, unsigned char *block, int len){ int i, j = self->last_pos; for(i=0; i<len; i++, j=(j+1) % self->keylen) { block[i] ^= self->key[j]; } self->last_pos = j;}