void gost_key(gost_ctx * c, const byte * k)
{
int i, j;
- RAND_bytes((unsigned char *)c->mask, sizeof(c->mask));
+ RAND_priv_bytes((unsigned char *)c->mask, sizeof(c->mask));
for (i = 0, j = 0; i < 8; ++i, j += 4) {
c->key[i] =
(k[j] | (k[j + 1] << 8) | (k[j + 2] << 16) | ((word32) k[j + 3] <<
void magma_key(gost_ctx * c, const byte * k)
{
int i, j;
- RAND_bytes((unsigned char *)c->mask, sizeof(c->mask));
+ RAND_priv_bytes((unsigned char *)c->mask, sizeof(c->mask));
for (i = 0, j = 0; i < 8; ++i, j += 4) {
c->key[i] =
(k[j + 3] | (k[j + 2] << 8) | (k[j + 1] << 16) | ((word32) k[j] <<
#endif
case EVP_CTRL_RAND_KEY:
{
- if (RAND_bytes
+ if (RAND_priv_bytes
((unsigned char *)ptr, EVP_CIPHER_CTX_key_length(ctx)) <= 0) {
GOSTerr(GOST_F_GOST_CIPHER_CTL, GOST_R_RNG_ERROR);
return -1;
{
switch (type) {
case EVP_CTRL_RAND_KEY:{
- if (RAND_bytes
+ if (RAND_priv_bytes
((unsigned char *)ptr, EVP_CIPHER_CTX_key_length(ctx)) <= 0) {
GOSTerr(GOST_F_GOST_GRASSHOPPER_CIPHER_CTL, GOST_R_RNG_ERROR);
return -1;