History

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

See 651ee9346105b9d492e01172ab447c04d03fa32e fcc4ed1efa1a7575dc45fe57ce552af331941469

James Almer committed 8 years ago

Commit 8a8d0b31 parent 75027067 files · +32 −0Browse files

Unified · Split

7 files
  1. doc/APIchanges +4 −0
  2. libavutil/hash.c +4 −0
  3. libavutil/hash.h +6 −0
  4. libavutil/murmur3.c +4 −0
  5. libavutil/murmur3.h +6 −0
  6. libavutil/ripemd.c +4 −0
  7. libavutil/ripemd.h +4 −0
doc/APIchanges+4−0
@@ -15,6 +15,10 @@ libavutil: 2017-10-21 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182018-02-xx - xxxxxxx
19 Change av_ripemd_update(), av_murmur3_update() and av_hash_update() length
20 parameter type to size_t at next major bump.
21
182018-02-xx - xxxxxxx - lavfi 7.12.100 - avfilter.h222018-02-xx - xxxxxxx - lavfi 7.12.100 - avfilter.h
19 Add AVFilterContext.extra_hw_frames.23 Add AVFilterContext.extra_hw_frames.
20 24
libavutil/hash.c+4−0
@@ -155,7 +155,11 @@ void av_hash_init(AVHashContext *ctx) · 154 unmodified lines
155 }155 }
156}156}
157 157
158#if FF_API_CRYPTO_SIZE_T
158void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len)159void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len)
160#else
161void av_hash_update(AVHashContext *ctx, const uint8_t *src, size_t len)
162#endif
159{163{
160 switch (ctx->type) {164 switch (ctx->type) {
161 case MD5: av_md5_update(ctx->ctx, src, len); break;165 case MD5: av_md5_update(ctx->ctx, src, len); break;
libavutil/hash.h+6−0
@@ -29,6 +29,8 @@ · 28 unmodified lines
29 29
30#include <stdint.h>30#include <stdint.h>
31 31
32#include "version.h"
33
32/**34/**
33 * @defgroup lavu_hash Hash Functions35 * @defgroup lavu_hash Hash Functions
34 * @ingroup lavu_crypto36 * @ingroup lavu_crypto
@@ -179,7 +181,11 @@ void av_hash_init(struct AVHashContext *ctx); · 144 unmodified lines
179 * @param[in] src Data to be added to the hash context181 * @param[in] src Data to be added to the hash context
180 * @param[in] len Size of the additional data182 * @param[in] len Size of the additional data
181 */183 */
184#if FF_API_CRYPTO_SIZE_T
182void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);185void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
186#else
187void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
188#endif
183 189
184/**190/**
185 * Finalize a hash context and compute the actual hash value.191 * Finalize a hash context and compute the actual hash value.
libavutil/murmur3.c+4−0
@@ -89,7 +89,11 @@ static inline uint64_t update_h2(uint64_t k, uint64_t h1, uint64_t h2) · 88 unmodified lines
89 return k;89 return k;
90}90}
91 91
92#if FF_API_CRYPTO_SIZE_T
92void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, int len)93void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, int len)
94#else
95void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, size_t len)
96#endif
93{97{
94 const uint8_t *end;98 const uint8_t *end;
95 uint64_t h1 = c->h1, h2 = c->h2;99 uint64_t h1 = c->h1, h2 = c->h2;
libavutil/murmur3.h+6−0
@@ -29,6 +29,8 @@ · 28 unmodified lines
29 29
30#include <stdint.h>30#include <stdint.h>
31 31
32#include "version.h"
33
32/**34/**
33 * @defgroup lavu_murmur3 Murmur335 * @defgroup lavu_murmur3 Murmur3
34 * @ingroup lavu_hash36 * @ingroup lavu_hash
@@ -97,7 +99,11 @@ void av_murmur3_init(struct AVMurMur3 *c); · 62 unmodified lines
97 * @param[in] src Input data to update hash with99 * @param[in] src Input data to update hash with
98 * @param[in] len Number of bytes to read from `src`100 * @param[in] len Number of bytes to read from `src`
99 */101 */
102#if FF_API_CRYPTO_SIZE_T
100void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len);103void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len);
104#else
105void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, size_t len);
106#endif
101 107
102/**108/**
103 * Finish hashing and output digest value.109 * Finish hashing and output digest value.
libavutil/ripemd.c+4−0
@@ -510,7 +510,11 @@ av_cold int av_ripemd_init(AVRIPEMD *ctx, int bits) · 509 unmodified lines
510 return 0;510 return 0;
511}511}
512 512
513#if FF_API_CRYPTO_SIZE_T
513void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, unsigned int len)514void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, unsigned int len)
515#else
516void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, size_t len)
517#endif
514{518{
515 unsigned int i, j;519 unsigned int i, j;
516 520
libavutil/ripemd.h+4−0
@@ -66,7 +66,11 @@ int av_ripemd_init(struct AVRIPEMD* context, int bits); · 65 unmodified lines
66 * @param data input data to update hash with66 * @param data input data to update hash with
67 * @param len input data length67 * @param len input data length
68 */68 */
69#if FF_API_CRYPTO_SIZE_T
69void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len);70void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len);
71#else
72void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
73#endif
70 74
71/**75/**
72 * Finish hashing and output digest value.76 * Finish hashing and output digest value.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t