diff options
author | Diego Biurrun <diego@biurrun.de> | 2009-03-20 11:48:27 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2009-03-20 11:48:27 +0000 |
commit | 294eaa26437edf29d866b0bf63d7de57515a0f95 (patch) | |
tree | 605c390daa352a0400dae8422e65af9487f122c4 /libavutil/aes.c | |
parent | c7594e0764d9d41ec4fb6b14deacd3cc6eafc4b3 (diff) | |
download | ffmpeg-294eaa26437edf29d866b0bf63d7de57515a0f95.tar.gz |
Replace random() usage in test programs by av_lfg_*().
Originally committed as revision 18070 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/aes.c')
-rw-r--r-- | libavutil/aes.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavutil/aes.c b/libavutil/aes.c index 26bc43fc5d..49c23e1d46 100644 --- a/libavutil/aes.c +++ b/libavutil/aes.c @@ -192,10 +192,9 @@ int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt) { } #ifdef TEST +#include "lfg.h" #include "log.h" -#undef random - int main(void){ int i,j; AVAES ae, ad, b; @@ -209,10 +208,12 @@ int main(void){ {0x73, 0x22, 0x81, 0xc0, 0xa0, 0xaa, 0xb8, 0xf7, 0xa5, 0x4a, 0x0c, 0x67, 0xa0, 0xc4, 0x5e, 0xcf}, {0x6d, 0x25, 0x1e, 0x69, 0x44, 0xb0, 0x51, 0xe0, 0x4e, 0xaa, 0x6f, 0xb4, 0xdb, 0xf7, 0x84, 0x65}}; uint8_t temp[16]; + AVLFG prn; av_aes_init(&ae, "PI=3.141592654..", 128, 0); av_aes_init(&ad, "PI=3.141592654..", 128, 1); av_log_set_level(AV_LOG_DEBUG); + av_lfg_init(&prn, 1); for(i=0; i<2; i++){ av_aes_init(&b, rkey[i], 128, 1); @@ -224,7 +225,7 @@ int main(void){ for(i=0; i<10000; i++){ for(j=0; j<16; j++){ - pt[j]= random(); + pt[j] = av_lfg_get(&prn); } {START_TIMER av_aes_crypt(&ae, temp, pt, 1, NULL, 0); |