ffmpeg/libavutil
Giorgio Vazzana c78cf00bd8 md5: consistently use uint32_t instead of unsigned int
Basically to make code clearer and adherent to the
standard. RFC 1321, on page 2 states

Let the symbol "+" denote addition of words (i.e., modulo-2^32
addition). Let X <<< s denote the 32-bit value obtained by circularly
shifting (rotating) X left by s bit positions.

on page 3, section 3.3 states:

A four-word buffer (A,B,C,D) is used to compute the message digest.
Here each of A, B, C, D is a 32-bit register.

so the algorithm needs to work with integers that are exactly 32bits
in length. And indeed in struct AVMD5 the MD buffer is declared as
"uint32_t ABCD[4];", while in the function that performs the block
transformation the state variables were "unsigned int"s. On
architectures where sizeof(unsigned int) != sizeof(uint32_t) this
could be a problem, although I can't name such an architecture from
the top of my head.
On a side note, both the reference implementation in RFC 1321 and the
gnulib implementation (used by md5sum program on GNU systems) use
uint32_t in the transform function.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-16 12:47:46 +02:00
..
2012-06-15 10:29:13 +02:00
2012-04-20 09:43:11 -04:00
2012-04-20 09:43:11 -04:00
2012-01-22 23:06:04 +01:00
2012-04-02 21:23:56 +02:00
2012-04-01 11:01:08 +02:00
2012-05-15 18:08:32 +02:00
2012-05-15 18:08:32 +02:00
2012-06-06 20:01:08 +02:00
2012-06-09 02:51:02 +02:00
2012-06-03 21:57:17 +02:00
2012-04-16 22:13:12 +02:00
2012-06-07 22:13:59 +02:00
2012-06-08 10:42:27 +00:00