On Sun, Jul 01, 2012 at 03:16:22PM +0100, Måns Rullgård wrote: > Kostya Shishkov <[email protected]> writes: > > > On Sun, Jul 01, 2012 at 04:03:00PM +0200, Samuel Pitoiset wrote: > >> +void av_xtea_encrypt(AVXTEA *x, uint8_t *dst, const uint8_t *src, int > >> count) > >> +{ > >> + uint32_t v0, v1, sum = 0, delta = 0x9E3779B9; > >> + int i; > >> + > >> + while (count-- > 0) { > >> + v0 = AV_RB32(src); > >> + v1 = AV_RB32(src + 4); > >> + > >> + for (i = 0; i < 32; i++) { > >> + v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + x->key[sum & > >> 3]); > >> + sum += delta; > >> + v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + x->key[(sum >> > >> 11) & 3]); > >> + } > >> + > >> + AV_WB32(dst, v0); > >> + AV_WB32(dst + 4, v1); > >> + > >> + src++; > >> + dst++; > > > > it should be incremented by 8 > > And 'count' should be decremented by 8. It also needs to handle input > not a multiple of 8 bytes in length. Is zero-padding the proper thing > to do?
Maybe, but because block bytes are permuted, output length should be multiple of eight in any case. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
