Browse Source

avutil/crypto: change length parameter to size_t on the remaining modules

See 651ee93461
fcc4ed1efa

Signed-off-by: James Almer <jamrial@gmail.com>
tags/n4.0
James Almer 8 years ago
parent
commit
8a8d0b319a
7 changed files with 32 additions and 0 deletions
  1. +4
    -0
      doc/APIchanges
  2. +4
    -0
      libavutil/hash.c
  3. +6
    -0
      libavutil/hash.h
  4. +4
    -0
      libavutil/murmur3.c
  5. +6
    -0
      libavutil/murmur3.h
  6. +4
    -0
      libavutil/ripemd.c
  7. +4
    -0
      libavutil/ripemd.h

+ 4
- 0
doc/APIchanges View File

@@ -15,6 +15,10 @@ libavutil: 2017-10-21

API changes, most recent first:

2018-02-xx - xxxxxxx
Change av_ripemd_update(), av_murmur3_update() and av_hash_update() length
parameter type to size_t at next major bump.

2018-02-xx - xxxxxxx - lavfi 7.12.100 - avfilter.h
Add AVFilterContext.extra_hw_frames.



+ 4
- 0
libavutil/hash.c View File

@@ -155,7 +155,11 @@ void av_hash_init(AVHashContext *ctx)
}
}

#if FF_API_CRYPTO_SIZE_T
void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len)
#else
void av_hash_update(AVHashContext *ctx, const uint8_t *src, size_t len)
#endif
{
switch (ctx->type) {
case MD5: av_md5_update(ctx->ctx, src, len); break;


+ 6
- 0
libavutil/hash.h View File

@@ -29,6 +29,8 @@

#include <stdint.h>

#include "version.h"

/**
* @defgroup lavu_hash Hash Functions
* @ingroup lavu_crypto
@@ -179,7 +181,11 @@ void av_hash_init(struct AVHashContext *ctx);
* @param[in] src Data to be added to the hash context
* @param[in] len Size of the additional data
*/
#if FF_API_CRYPTO_SIZE_T
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
#else
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
#endif

/**
* Finalize a hash context and compute the actual hash value.


+ 4
- 0
libavutil/murmur3.c View File

@@ -89,7 +89,11 @@ static inline uint64_t update_h2(uint64_t k, uint64_t h1, uint64_t h2)
return k;
}

#if FF_API_CRYPTO_SIZE_T
void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, int len)
#else
void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, size_t len)
#endif
{
const uint8_t *end;
uint64_t h1 = c->h1, h2 = c->h2;


+ 6
- 0
libavutil/murmur3.h View File

@@ -29,6 +29,8 @@

#include <stdint.h>

#include "version.h"

/**
* @defgroup lavu_murmur3 Murmur3
* @ingroup lavu_hash
@@ -97,7 +99,11 @@ void av_murmur3_init(struct AVMurMur3 *c);
* @param[in] src Input data to update hash with
* @param[in] len Number of bytes to read from `src`
*/
#if FF_API_CRYPTO_SIZE_T
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len);
#else
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, size_t len);
#endif

/**
* Finish hashing and output digest value.


+ 4
- 0
libavutil/ripemd.c View File

@@ -510,7 +510,11 @@ av_cold int av_ripemd_init(AVRIPEMD *ctx, int bits)
return 0;
}

#if FF_API_CRYPTO_SIZE_T
void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, unsigned int len)
#else
void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, size_t len)
#endif
{
unsigned int i, j;



+ 4
- 0
libavutil/ripemd.h View File

@@ -66,7 +66,11 @@ int av_ripemd_init(struct AVRIPEMD* context, int bits);
* @param data input data to update hash with
* @param len input data length
*/
#if FF_API_CRYPTO_SIZE_T
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len);
#else
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
#endif

/**
* Finish hashing and output digest value.


Loading…
Cancel
Save