git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e4a7fb3
)
xtea: Make the count parameter match the documentation
author
Samuel Pitoiset
<samuel.pitoiset@gmail.com>
Thu, 5 Jul 2012 09:19:13 +0000
(11:19 +0200)
committer
Martin Storsjö
<martin@martin.st>
Thu, 5 Jul 2012 09:45:18 +0000
(12:45 +0300)
Previously it was interpreted as number of bytes, while the
documentation stated that it was the number of 8 byte blocks.
This makes it behave similarly to the existing AES code.
Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil/xtea.c
patch
|
blob
|
history
diff --git
a/libavutil/xtea.c
b/libavutil/xtea.c
index
07a66e5
..
7c3a14c
100644
(file)
--- a/
libavutil/xtea.c
+++ b/
libavutil/xtea.c
@@
-72,7
+72,7
@@
void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
int i;
if (decrypt) {
int i;
if (decrypt) {
- while (count
> 0
) {
+ while (count
--
) {
xtea_crypt_ecb(ctx, dst, src, decrypt);
if (iv) {
xtea_crypt_ecb(ctx, dst, src, decrypt);
if (iv) {
@@
-83,10
+83,9
@@
void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
src += 8;
dst += 8;
src += 8;
dst += 8;
- count -= 8;
}
} else {
}
} else {
- while (count
> 0
) {
+ while (count
--
) {
if (iv) {
for (i = 0; i < 8; i++)
dst[i] = src[i] ^ iv[i];
if (iv) {
for (i = 0; i < 8; i++)
dst[i] = src[i] ^ iv[i];
@@
-97,7
+96,6
@@
void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
}
src += 8;
dst += 8;
}
src += 8;
dst += 8;
- count -= 8;
}
}
}
}
}
}