comparison dbrandom.c @ 1757:517fb7b62438

Add some more variation to fuzzer random number generation
author Matt Johnston <matt@ucc.asn.au>
date Fri, 23 Oct 2020 23:32:44 +0800
parents 6e5037ae2c1c
children c3ca130d193a
comparison
equal deleted inserted replaced
1756:d5680e12ac33 1757:517fb7b62438
148 fclose(f); 148 fclose(f);
149 #endif 149 #endif
150 } 150 }
151 151
152 #if DROPBEAR_FUZZ 152 #if DROPBEAR_FUZZ
153 void fuzz_seed(void) { 153 void fuzz_seed(const unsigned char* dat, unsigned int len) {
154 hash_state hs; 154 hash_state hs;
155 sha1_init(&hs); 155 sha1_init(&hs);
156 sha1_process(&hs, "fuzzfuzzfuzz", strlen("fuzzfuzzfuzz")); 156 sha1_process(&hs, "fuzzfuzzfuzz", strlen("fuzzfuzzfuzz"));
157 sha1_process(&hs, dat, len);
157 sha1_done(&hs, hashpool); 158 sha1_done(&hs, hashpool);
158 159
159 counter = 0; 160 counter = 0;
160 donerandinit = 1; 161 donerandinit = 1;
161 } 162 }