aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/md5.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-03-06 21:56:20 +0100
committerJames Almer <jamrial@gmail.com>2021-04-27 10:43:13 -0300
commita240097ecd4fb1639db99e7becb888ae478405cd (patch)
tree26a70d86c81463ced96d1123bb0d06621668dffd /libavutil/md5.c
parent6e30b35b85b81c802e52a1078ec7a3097e353c6d (diff)
downloadffmpeg-a240097ecd4fb1639db99e7becb888ae478405cd.tar.gz
avutil: Switch crypto APIs to size_t
Announced in e435beb1ea5380a90774dbf51fdc8c941e486551. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/md5.c')
-rw-r--r--libavutil/md5.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libavutil/md5.c b/libavutil/md5.c
index 31e69925ae..88596203c1 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -98,14 +98,13 @@ static const uint32_t T[64] = { // T[i]= fabs(sin(i+1)<<32)
a = b + (a << t | a >> (32 - t)); \
} while (0)
-static void body(uint32_t ABCD[4], const uint8_t *src, int nblocks)
+static void body(uint32_t ABCD[4], const uint8_t *src, size_t nblocks)
{
int i av_unused;
- int n;
const uint32_t *X;
uint32_t a, b, c, d, t;
- for (n = 0; n < nblocks; n++) {
+ for (size_t n = 0; n < nblocks; n++) {
a = ABCD[3];
b = ABCD[2];
c = ABCD[1];
@@ -150,11 +149,7 @@ void av_md5_init(AVMD5 *ctx)
ctx->ABCD[3] = 0x67452301;
}
-#if FF_API_CRYPTO_SIZE_T
-void av_md5_update(AVMD5 *ctx, const uint8_t *src, int len)
-#else
void av_md5_update(AVMD5 *ctx, const uint8_t *src, size_t len)
-#endif
{
const uint8_t *end;
int j;
@@ -180,7 +175,7 @@ void av_md5_update(AVMD5 *ctx, const uint8_t *src, size_t len)
src += 64;
}
} else {
- int nblocks = len / 64;
+ size_t nblocks = len / 64;
body(ctx->ABCD, src, nblocks);
src = end;
}
@@ -204,11 +199,7 @@ void av_md5_final(AVMD5 *ctx, uint8_t *dst)
AV_WL32(dst + 4 * i, ctx->ABCD[3 - i]);
}
-#if FF_API_CRYPTO_SIZE_T
-void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len)
-#else
void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len)
-#endif
{
AVMD5 ctx;