Skip to content

Commit

Permalink
ed(1): simplify by using arc4random_buf().
Browse files Browse the repository at this point in the history
Suggested by:	ed
  • Loading branch information
pgiffuni committed May 21, 2016
1 parent ca492fd commit c98ef29
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bin/ed/cbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,13 @@ void
init_des_cipher(void)
{
#ifdef DES
int i;

des_ct = des_n = 0;

/* initialize the initialization vector */
MEMZERO(ivec, 8);

/* initialize the padding vector */
for (i = 0; i < 8; i++)
pvec[i] = (char)arc4random_uniform(256);
arc4random_buf(pvec, sizeof(pvec));
#endif
}

Expand Down

0 comments on commit c98ef29

Please sign in to comment.