summaryrefslogtreecommitdiffstats
path: root/libavutil/random_seed.c
Commit message (Collapse)AuthorAgeFilesLines
* avutil/random_seed: use bcrypt instead of the old wincrypt APISteve Lhomme2018-04-141-9/+10
| | | | | | | | Remove the wincrypt API calls since we don't support XP anymore and bcrypt is available since Vista, even on Windows Store builds. Reviewed-by: Michael Niedermayer <[email protected]> Signed-off-by: James Almer <[email protected]>
* Merge commit '7ac092d05de487d088bc96ab4a7bd6207fbfa98c'James Almer2017-11-111-2/+2
|\ | | | | | | | | | | | | * commit '7ac092d05de487d088bc96ab4a7bd6207fbfa98c': build: CryptGenRandom --> wincrypt, it is a better name Merged-by: James Almer <[email protected]>
| * build: CryptGenRandom --> wincrypt, it is a better nameDiego Biurrun2017-10-121-2/+2
| |
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <[email protected]>
* | libavutil/random_seed: Ensure that get_generic_seed() spends at least 1/32 ↵Michael Niedermayer2016-12-311-2/+6
| | | | | | | | | | | | | | | | sec gathering entropy This may fix the failures on windows Signed-off-by: Michael Niedermayer <[email protected]>
* | avutil/random_seed: Reduce the time needed on systems with very low ↵Michael Niedermayer2016-12-241-1/+1
| | | | | | | | | | | | | | | | | | precission clock() This should fix issues on BSD CLOCKS_PER_SEC is 128 on BSD while SUSv2 requires it to be a million Signed-off-by: Michael Niedermayer <[email protected]>
* | avutil/random_seed: Improve get_generic_seed() with higher precission clock()Michael Niedermayer2016-12-221-4/+6
| | | | | | | | | | Tested-by: Thomas Turner <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* | avutil/random_seed: Use uint64 instead of uint8 for struct to avoid ↵Michael Niedermayer2016-12-211-1/+1
| | | | | | | | | | | | potential alignment issues Signed-off-by: Michael Niedermayer <[email protected]>
* | Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-111-26/+0
|\| | | | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <[email protected]> Merged-by: Derek Buitenhuis <[email protected]>
* | avutil/random_seed: Add the runtime in cycles of the main loop to the ↵Michael Niedermayer2016-03-101-1/+6
| | | | | | | | | | | | | | | | entropy pool This should theoretically improve the randomness slightly Signed-off-by: Michael Niedermayer <[email protected]>
* | lavu/random_seed: use arc4random() when availableGanesh Ajjanagadde2015-12-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arc4random() was designed as a superior interface for system random number generation, designed for OpenBSD and subsequently incorporated by other BSD's, Mac OS X, and some non-standard libc's. It is thus an improvement to use it whenever available. As a side note, this may or may not get included in glibc, and there is a proposal to create a posix_random family based on these ideas: http://austingroupbugs.net/view.php?id=859. Tested on Mac OS X. Signed-off-by: Ganesh Ajjanagadde <[email protected]>
* | msvc: fix implicitly declared read/close.Matthew Oliver2014-08-021-0/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <[email protected]>
* | Merge commit '01d245ef4392152dbdc78a6ba4dfa0a6e8b08e6f'Michael Niedermayer2014-01-061-9/+9
|\| | | | | | | | | | | | | | | | | | | | | * commit '01d245ef4392152dbdc78a6ba4dfa0a6e8b08e6f': random_seed: Rewrite the generic clock() based seed code Conflicts: libavutil/random_seed.c See: 66531c75d3bfd8a013acd8bd3c04a131dae2a1a0 Merged-by: Michael Niedermayer <[email protected]>
| * random_seed: Rewrite the generic clock() based seed codeMichael Niedermayer2014-01-061-21/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new code is faster and reuses the previous state in case of multiple calls. The previous code could easily end up in near-infinite loops, if the difference between two clock() calls never was larger than 1. This makes fate-parseutils finish in finite time when run in wine, if CryptGenRandom isn't available (which e.g. isn't available if targeting Windows RT/metro). Patch originally by Michael Niedermayer but with some modifications by Martin Storsjö. Signed-off-by: Martin Storsjö <[email protected]>
* | Merge commit '880391ed2d2faf796ca3a16f63cec69767546a21'Michael Niedermayer2013-08-081-1/+2
|\| | | | | | | | | | | | | | | | | | | * commit '880391ed2d2faf796ca3a16f63cec69767546a21': libavutil: use avpriv_open() Conflicts: libavutil/random_seed.c Merged-by: Michael Niedermayer <[email protected]>
| * libavutil: use avpriv_open()Rémi Denis-Courmont2013-08-071-1/+2
| | | | | | | | Signed-off-by: Anton Khirnov <[email protected]>
* | Merge commit '0a75d1da23b8659ec49391469bb592da12760077'Michael Niedermayer2012-10-121-0/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '0a75d1da23b8659ec49391469bb592da12760077': options_table: refs option is not snow-only random_seed: Support using CryptGenRandom on windows doc: update the faq entry about custom I/O Conflicts: doc/faq.texi libavcodec/options_table.h Merged-by: Michael Niedermayer <[email protected]>
| * random_seed: Support using CryptGenRandom on windowsMartin Storsjö2012-10-111-0/+15
| | | | | | | | Signed-off-by: Martin Storsjö <[email protected]>
| * random_seed: Only read /dev/*random if we have unistd.hRonald S. Bultje2012-06-291-0/+8
| | | | | | | | | | | | | | | | unistd.h is used for open/read/close, but if this header does not exist, there's probably no use in trying to open /dev/*random at all. Signed-off-by: Martin Storsjö <[email protected]>
* | random_seed: fix digest sizeMichael Niedermayer2012-10-111-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <[email protected]>
* | random_seed: fix out of array readMichael Niedermayer2012-10-111-1/+1
| | | | | | | | | | Fixes CID733787 Signed-off-by: Michael Niedermayer <[email protected]>
* | random_seed: Replace a VLA with a normal arrayDerek Buitenhuis2012-09-081-1/+4
| | | | | | | | | | Signed-off-by: Derek Buitenhuis <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* | random_seed: Only read /dev/*random if we have unistd.hRonald S. Bultje2012-09-071-0/+8
| | | | | | | | | | | | | | | | | | unistd.h is used for open/read/close, but if this header does not exist, there's probably no use in trying to open /dev/*random at all. Signed-off-by: Martin Storsjö <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* | random_seed: rewrite generic code.Michael Niedermayer2012-06-111-21/+38
| | | | | | | | | | | | | | | | | | The new code is faster and reuses the previous state in case of multiple calls. For testing the iterations are reduced and several entropy sources are disabled. Its based on SHA-1 Signed-off-by: Michael Niedermayer <[email protected]>
* | random_seed: add selftestMichael Niedermayer2012-02-231-0/+26
| | | | | | | | | | Reviewed-by: Nicolas George <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-051-14/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: adpcmenc: cosmetics: pretty-printing ac3dec: cosmetics: pretty-printing yuv4mpeg: cosmetics: pretty-printing shorten: remove dead initialization roqvideodec: set AVFrame reference before reget_buffer. bmp: fix some 1bit samples. latmdec: add fate test for audio config change oma: PCM support oma: better format detection with small probe buffer oma: clearify ambiguous if condition wavpack: Properly clip samples during lossy decode Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c. Cleaned pixdesc.c file in libavutil zmbv.c: coding style clean-up. xan.c: coding style clean-up. mpegvideo.c: code cleanup - first 500 lines. Conflicts: Changelog libavcodec/adpcmenc.c libavcodec/bmp.c libavcodec/zmbv.c libavutil/log.c libavutil/pixdesc.c Merged-by: Michael Niedermayer <[email protected]>
| * Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c.Yordan Makariev2011-12-031-14/+14
| | | | | | | | Signed-off-by: Ronald S. Bultje <[email protected]>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-181-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | * qatar/master: vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h dsputil: remove disabled code tta: remove disabled code gxfenc: place variable declarations before statements x86: Use LOCAL_ALIGNED in mpegvideo_mmx_template random_seed: use proper #includes Merged-by: Michael Niedermayer <[email protected]>
| * random_seed: use proper #includesMans Rullgard2011-07-171-2/+2
| | | | | | | | | | | | Use <> for system headers, add needed math.h, drop unnecessary avutil.h. Signed-off-by: Mans Rullgard <[email protected]>
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-04-211-8/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Makefile: Include dependencies for test tools, too Remove a version check in av_log made unnecessary by the big bump. update last major version increase dates in APIchanges Reduce picture size for yadif. oggdec: use av_freep() instead of av_free() avio: Fix sanity checks in ffurl_read* libavformat: Free AVFormatContext->streams libavformat: Make protocols pass URLContext as log context where available asf: remove commented out code in asf_read_seek not pulled: libpostproc: Remove crufty code disabled by the big bump. Reflect 0.7_beta1 release in the Changelog not pulled: sws: remove disabled cruft. lavu: remove disabled ff_random_get_seed cruft. lavu: remove disabled sha1 cruft. Conflicts: Changelog libavutil/sha1.h Merged-by: Michael Niedermayer <[email protected]>
| * lavu: remove disabled ff_random_get_seed cruft.Anton Khirnov2011-04-191-8/+0
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
|/ | | | Signed-off-by: Mans Rullgard <[email protected]>
* Fix infinite loop with clock() returning (clock_t)-1.Michael Niedermayer2010-07-081-6/+6
| | | | Originally committed as revision 24116 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change i to unsigned in get_generic_seed().Michael Niedermayer2010-07-081-2/+2
| | | | | | | This is clearer than comparing against an unsigned number to force an unsigned comparison that we need. Originally committed as revision 24114 to svn://svn.ffmpeg.org/ffmpeg/trunk
* get_generic_seed() for the cases without /dev/random and AV_READ_TIMEMichael Niedermayer2010-07-071-6/+34
| | | | Originally committed as revision 24102 to svn://svn.ffmpeg.org/ffmpeg/trunk
* random_seed: simplifyMåns Rullgård2010-07-011-5/+3
| | | | Originally committed as revision 23932 to svn://svn.ffmpeg.org/ffmpeg/trunk
* ReindentMåns Rullgård2010-07-011-1/+1
| | | | Originally committed as revision 23931 to svn://svn.ffmpeg.org/ffmpeg/trunk
* random_seed: allow to block on /dev/randomMåns Rullgård2010-07-011-3/+0
| | | | | | | | | | If both /dev/random and /dev/urandom failed to return data, an uninitialised value might be returned. Since most systems have a non-blocking /dev/urandom or have /dev/random with similar properties, the chance of blocking is minimal, and the alternative of returning non-random data is worse. Originally committed as revision 23930 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make av_get_random_seed() non-blockingMåns Rullgård2010-06-301-10/+24
| | | | | | | Attempt to read from /dev/urandom and /dev/random with O_NONBLOCK set. If neither succeeds, proceed with fallbacks. Originally committed as revision 23903 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make ff_random_get_seed public, rename to av_get_random_seed, export the headerMartin Storsjö2010-05-231-1/+10
| | | | | | | Keep an old ff_ named function for binary compatibility until the next major bump. Originally committed as revision 23254 to svn://svn.ffmpeg.org/ffmpeg/trunk
* indentMåns Rullgård2010-03-111-1/+1
| | | | Originally committed as revision 22451 to svn://svn.ffmpeg.org/ffmpeg/trunk
* random_seed: try other alternatives if reading /dev/random failsMåns Rullgård2010-03-111-1/+2
| | | | Originally committed as revision 22450 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add ff_random_get_seed to be used in conjunction with random functionsBaptiste Coudurier2009-03-081-0/+43
Originally committed as revision 17868 to svn://svn.ffmpeg.org/ffmpeg/trunk