7 static HCRYPTPROV prov;
9 void random_init(void) {
10 if(!CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
11 fprintf(stderr, "CryptAcquireContext() failed!\n");
16 void random_exit(void) {
17 CryptReleaseContext(prov, 0);
20 void randomize(void *vout, size_t outlen) {
21 if(!CryptGenRandom(prov, outlen, vout)) {
22 fprintf(stderr, "CryptGenRandom() failed\n");