Created
April 22, 2012 16:00
-
-
Save bricef/2464895 to your computer and use it in GitHub Desktop.
Generating an IV in C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int genIV( | |
void* buffer, | |
int buffer_len | |
){ | |
/* | |
* Note that we propagate the return code from the library called. | |
*/ | |
#ifndef _WIN32 | |
return RAND_bytes(buffer, buffer_len); | |
#else | |
return RtlGenRandom(buffer, buffer_len); | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment