summaryrefslogtreecommitdiff
path: root/libavutil/md5.c
Commit message (Collapse)AuthorAge
* avutil/md5: Avoid av_unused variableAndreas Rheinhardt2021-10-02
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil: Switch crypto APIs to size_tAndreas Rheinhardt2021-04-27
| | | | | | | Announced in e435beb1ea5380a90774dbf51fdc8c941e486551. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit 'e435beb1ea5380a90774dbf51fdc8c941e486551'Clément Bœsch2017-05-05
|\ | | | | | | | | | | | | * commit 'e435beb1ea5380a90774dbf51fdc8c941e486551': crypto: consistently use size_t as type for length parameters Merged-by: Clément Bœsch <cboesch@gopro.com>
| * crypto: consistently use size_t as type for length parametersDiego Biurrun2017-01-09
| | | | | | | | size_t is the correct type to use for sizes.
* | avutil/md5: stop discarding the const qualifier for the src pointerJames Almer2017-03-03
| | | | | | | | | | | | | | The code modifying the buffer on big endian systems was removed. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/md5: fix misaligned readsJames Almer2017-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes ubsan happy and also considerably increases performance on big endian systems. Tested on an IBM POWER7 3.55 GHz Before: 2.24user 0.14system 0:02.39elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 2.26user 0.11system 0:02.38elapsed 99%CPU (0avgtext+0avgdata 2688maxresident)k 2.23user 0.15system 0:02.38elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 2.25user 0.12system 0:02.38elapsed 100%CPU (0avgtext+0avgdata 2624maxresident)k 2.20user 0.15system 0:02.36elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k After: 1.86user 0.13system 0:02.00elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 1.89user 0.11system 0:02.01elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 1.85user 0.14system 0:02.00elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 1.84user 0.15system 0:01.99elapsed 99%CPU (0avgtext+0avgdata 2624maxresident)k 1.89user 0.13system 0:02.02elapsed 99%CPU (0avgtext+0avgdata 2688maxresident)k Tested-by: Nicolas George <george@nsup.org> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-11
|\| | | | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <jamrial@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * build: Split test programs off into separate filesDiego Biurrun2016-04-07
| | | | | | | | | | This avoids spurious library rebuilds when only the test program code is changed and simplifies the build system.
* | Merge commit '3b08d9d932eef09403074d5af31e10d8011e840b'Derek Buitenhuis2016-04-21
|\| | | | | | | | | | | | | * commit '3b08d9d932eef09403074d5af31e10d8011e840b': testprogs: K&R formatting cosmetics Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * testprogs: K&R formatting cosmeticsDiego Biurrun2016-03-24
| |
| * lavu: Drop deprecated context size variablesVittorio Giovara2015-08-28
| | | | | | | | Deprecated in 10/2012.
* | avutil/md5: workaround clang 3.5 #20849Michael Niedermayer2014-09-05
| | | | | | | | | | | | | | | | This avoids several failures on fate.ffmpeg.org, and thus makes real bugs easier to spot Reviewed-by: James Darnley <james.darnley@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/md5: reindent after previous commitsGiorgio Vazzana2013-05-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/md5: move loop inside inner functionGiorgio Vazzana2013-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AMD Athlon(tm) II X3 450 Processor size: 1048576 runs: 1024 time: 5.660 +- 0.023 size: 1048576 runs: 1024 time: 5.661 +- 0.030 size: 1048576 runs: 1024 time: 5.656 +- 0.022 size: 1048576 runs: 1024 time: 5.647 +- 0.026 size: 1048576 runs: 1024 time: 5.428 +- 0.037 size: 1048576 runs: 1024 time: 5.426 +- 0.034 size: 1048576 runs: 1024 time: 5.426 +- 0.034 size: 1048576 runs: 1024 time: 5.428 +- 0.038 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | md5: optimize second round by using 4-operation form of G()Giorgio Vazzana2013-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4-operation form is preferred over 3-operation because it breaks a long dependency chain, thus allowing a superscalar processor to execute more operations in parallel. The idea was taken from: http://www.zorinaq.com/papers/md5-amd64.html AMD Athlon(tm) II X3 450 Processor, x86_64 $ for i in $(seq 1 4); do ./avutil_md5_test2; done size: 1048576 runs: 1024 time: 5.821 +- 0.019 size: 1048576 runs: 1024 time: 5.822 +- 0.019 size: 1048576 runs: 1024 time: 5.841 +- 0.018 size: 1048576 runs: 1024 time: 5.821 +- 0.018 $ for i in $(seq 1 4); do ./avutil_md5_test2; done size: 1048576 runs: 1024 time: 5.646 +- 0.019 size: 1048576 runs: 1024 time: 5.646 +- 0.018 size: 1048576 runs: 1024 time: 5.642 +- 0.019 size: 1048576 runs: 1024 time: 5.641 +- 0.019 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | md5: avoid unnecessary copying.Reimar Döffinger2013-05-17
| | | | | | | | | | | | | | | | | | Where necessary use memcpy instead. Thanks to Giorgio Vazzana [mywing81 gmail] for spotting this loop as the cause for the bad performance. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967'Michael Niedermayer2012-12-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967': Remove pointless #undefs of previously forbidden functions. fate: Add dependencies for bmp, cdxl, dfa, mp3 Conflicts: doc/examples/muxing.c libavfilter/filtfmts.c libavutil/des.c libavutil/eval.c libavutil/log.c libavutil/parseutils.c tests/fate/mp3.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove pointless #undefs of previously forbidden functions.Anton Khirnov2012-12-04
| |
* | lavu: keep context size variablesMichael Niedermayer2012-10-28
| | | | | | | | | | | | | | | | They are essential to be able to use the utils without av_malloc() That is for example use with malloc(), memalign(), some other private allocation function, on the stack or others. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e002e3291e6dc7953f843abf56fc14f08f238b21'Michael Niedermayer2012-10-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e002e3291e6dc7953f843abf56fc14f08f238b21': Use the new aes/md5/sha/tree allocation functions avutil: Add functions for allocating opaque contexts for algorithms svq3: fix pointer type warning svq3: replace unsafe pointer casting with intreadwrite macros parseutils-test: various cleanups Conflicts: doc/APIchanges libavcodec/svq3.c libavutil/parseutils.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: Add functions for allocating opaque contexts for algorithmsMartin Storsjö2012-10-11
| | | | | | | | | | | | | | | | | | | | | | | | The current API where the plain size is exposed is not of much use - in most cases it is allocated dynamically anyway. If allocated e.g. on the stack via an uint8_t array, there's no guarantee that the struct's members are aligned properly (unless the array is overallocated and the opaque pointer within it manually aligned to some unspecified alignment). Signed-off-by: Martin Storsjö <martin@martin.st>
* | md5: consistently use uint32_t instead of unsigned intGiorgio Vazzana2012-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (40 commits) H.264: template left MB handling H.264: faster fill_decode_caches H.264: faster write_back_* H.264: faster fill_filter_caches H.264: make filter_mb_fast support the case of unavailable top mb Do not include log.h in avutil.h Do not include pixfmt.h in avutil.h Do not include rational.h in avutil.h Do not include mathematics.h in avutil.h Do not include intfloat_readwrite.h in avutil.h Remove return statements following infinite loops without break RTSP: Doxygen comment cleanup doxygen: Escape '\' in Doxygen documentation. md5: cosmetics md5: use AV_WL32 to write result md5: add fate test md5: include correct headers md5: fix test program doxygen: Drop array size declarations from Doxygen parameter names. doxygen: Fix parameter names to match the function prototypes. ... Conflicts: libavcodec/x86/dsputil_mmx.c libavformat/flvenc.c libavformat/oggenc.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * md5: cosmeticsMans Rullgard2011-07-03
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * md5: use AV_WL32 to write resultMans Rullgard2011-07-03
| | | | | | | | | | | | | | This is simpler, safer, and removes the undocumented requirement of aligned output buffer. Signed-off-by: Mans Rullgard <mans@mansr.com>
| * md5: include correct headersMans Rullgard2011-07-03
| | | | | | | | | | | | This file needs stdint.h but not string.h Signed-off-by: Mans Rullgard <mans@mansr.com>
| * md5: fix test programMans Rullgard2011-07-03
| | | | | | | | | | | | | | This makes the md5-test program print something meaningful and not smash the stack. Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Add av_ prefix to bswap macrosMåns Rullgård2010-07-10
| | | | Originally committed as revision 24170 to svn://svn.ffmpeg.org/ffmpeg/trunk
* bswap: change ME to NE in macro namesMåns Rullgård2010-07-10
| | | | | | | Other parts of FFmpeg use NE (native endian) rather than ME (machine). This makes it consistent. Originally committed as revision 24169 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Replace many includes of libavutil/common.h with what is actually neededMåns Rullgård2010-03-09
| | | | | | | This reduces the number of false dependencies on header files and speeds up compilation. Originally committed as revision 22407 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Replace WORDS_BIGENDIAN with HAVE_BIGENDIANMåns Rullgård2009-07-26
| | | | Originally committed as revision 19508 to svn://svn.ffmpeg.org/ffmpeg/trunk
* spelling/grammar/consistency review part IDiego Biurrun2009-01-28
| | | | Originally committed as revision 16840 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change semantic of CONFIG_*, HAVE_* and ARCH_*.Aurelien Jacobs2009-01-13
| | | | | | They are now always defined to either 0 or 1. Originally committed as revision 16590 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add necessary, remove unnecessary #includes.Diego Biurrun2009-01-11
| | | | Originally committed as revision 16547 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix generated md5, it was wrong for some input lengths.Michael Niedermayer2008-09-15
| | | | | | Fix issue634. Originally committed as revision 15335 to svn://svn.ffmpeg.org/ffmpeg/trunk
* fixing warningMichael Niedermayer2008-01-30
| | | | | | md5.c:150: warning: passing argument 2 of 'av_md5_update' from incompatible pointer type Originally committed as revision 11665 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix a couple of 'return type defaults to int' and 'control reaches end ofDiego Biurrun2008-01-10
| | | | | | non-void function' warnings in test code. Originally committed as revision 11491 to svn://svn.ffmpeg.org/ffmpeg/trunk
* main() --> main(void)Diego Biurrun2007-11-23
| | | | Originally committed as revision 11079 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Group all copyright and author notices together.Diego Biurrun2007-07-05
| | | | Originally committed as revision 9483 to svn://svn.ffmpeg.org/ffmpeg/trunk
* rename attribute_unused to av_unused and moves its declaration to common.hCarl Eugen Hoyos2007-05-30
| | | | | | | | patch by Carl Eugen Hoyos cehoyos chez ag or at original thread: [FFmpeg-devel] [PATCH] attribute_unused -> av_unused date: 05/29/2007 01:23 PM Originally committed as revision 9155 to svn://svn.ffmpeg.org/ffmpeg/trunk
* 160 bytes smaller object file, ask gcc devels whyMichael Niedermayer2007-03-14
| | | | Originally committed as revision 8407 to svn://svn.ffmpeg.org/ffmpeg/trunk
* explain where the T table comes fromMichael Niedermayer2007-03-14
| | | | Originally committed as revision 8406 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetic (order context variables like in sha1)Michael Niedermayer2007-03-13
| | | | Originally committed as revision 8386 to svn://svn.ffmpeg.org/ffmpeg/trunk
* #undef printf under #ifdef TEST (needed for testing)Michael Niedermayer2007-03-13
| | | | Originally committed as revision 8384 to svn://svn.ffmpeg.org/ffmpeg/trunk
* borrow finalization algo from sha1 (100byte smaller)Michael Niedermayer2007-03-13
| | | | Originally committed as revision 8383 to svn://svn.ffmpeg.org/ffmpeg/trunk
* get rid of b_used variable (same size with CONFIG_SMALL)Michael Niedermayer2007-03-13
| | | | Originally committed as revision 8382 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Replace most of the %lld and %llx by their (cleaner) PRI*64 counterparts.Steve L'Homme2006-11-01
| | | | | | patch by Steve Lhomme, slhomme divxcorp com Originally committed as revision 6868 to svn://svn.ffmpeg.org/ffmpeg/trunk