/* * Copyright (c) 2009 Baptiste Coudurier <[email protected]> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #if HAVE_UNISTD_H #include <unistd.h> #endif #if HAVE_IO_H #include <io.h> #endif #if HAVE_BCRYPT #include <windows.h> #include <bcrypt.h> #endif #if CONFIG_GCRYPT #include <gcrypt.h> #elif CONFIG_OPENSSL #include <openssl/rand.h> #endif #include <fcntl.h> #include <math.h> #include <time.h> #include <string.h> #include "avassert.h" #include "file_open.h" #include "internal.h" #include "intreadwrite.h" #include "timer.h" #include "random_seed.h" #include "sha.h" #ifndef TEST #define TEST … #endif static int read_random(uint8_t *dst, size_t len, const char *file) { … } static uint32_t get_generic_seed(void) { … } int av_random_bytes(uint8_t* buf, size_t len) { … } uint32_t av_get_random_seed(void) { … }