KNF anality.
This commit is contained in:
parent
93fc448539
commit
59a6c3d4e7
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rnd.c,v 1.11 1998/05/27 00:59:14 explorer Exp $ */
|
||||
/* $NetBSD: rnd.c,v 1.12 1999/01/27 10:41:00 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -250,6 +250,7 @@ void
|
|||
rndattach(num)
|
||||
int num;
|
||||
{
|
||||
|
||||
rnd_init();
|
||||
}
|
||||
|
||||
|
@ -259,6 +260,7 @@ rndopen(dev, flags, ifmt, p)
|
|||
int flags, ifmt;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
if (rnd_ready == 0)
|
||||
return (ENXIO);
|
||||
|
||||
|
@ -274,6 +276,7 @@ rndclose(dev, flags, ifmt, p)
|
|||
int flags, ifmt;
|
||||
struct proc *p;
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -938,4 +941,3 @@ rnd_extract_data(p, len, flags)
|
|||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rndpool.c,v 1.7 1998/05/27 01:29:13 explorer Exp $ */
|
||||
/* $NetBSD: rndpool.c,v 1.8 1999/01/27 10:41:01 mrg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -59,6 +59,7 @@ void
|
|||
rndpool_init(rp)
|
||||
rndpool_t *rp;
|
||||
{
|
||||
|
||||
rp->cursor = RND_POOLWORDS - 1;
|
||||
rp->entropy = 0;
|
||||
rp->rotate = 0;
|
||||
|
@ -68,6 +69,7 @@ u_int32_t
|
|||
rndpool_get_entropy_count(rp)
|
||||
rndpool_t *rp;
|
||||
{
|
||||
|
||||
return rp->entropy;
|
||||
}
|
||||
|
||||
|
@ -76,6 +78,7 @@ rndpool_set_entropy_count(rp, entropy)
|
|||
rndpool_t *rp;
|
||||
u_int32_t entropy;
|
||||
{
|
||||
|
||||
rp->entropy = entropy;
|
||||
if (rp->entropy > RND_POOLBITS)
|
||||
rp->entropy = RND_POOLBITS;
|
||||
|
@ -86,6 +89,7 @@ rndpool_increment_entropy_count(rp, entropy)
|
|||
rndpool_t *rp;
|
||||
u_int32_t entropy;
|
||||
{
|
||||
|
||||
rp->entropy += entropy;
|
||||
if (rp->entropy > RND_POOLBITS)
|
||||
rp->entropy = RND_POOLBITS;
|
||||
|
@ -95,12 +99,14 @@ u_int32_t *
|
|||
rndpool_get_pool(rp)
|
||||
rndpool_t *rp;
|
||||
{
|
||||
|
||||
return (rp->pool);
|
||||
}
|
||||
|
||||
u_int32_t
|
||||
rndpool_get_poolsize(void)
|
||||
{
|
||||
|
||||
return (RND_POOLWORDS);
|
||||
}
|
||||
|
||||
|
@ -112,6 +118,7 @@ rndpool_add_one_word(rp, val)
|
|||
rndpool_t *rp;
|
||||
u_int32_t val;
|
||||
{
|
||||
|
||||
/*
|
||||
* Steal some values out of the pool, and xor them into the
|
||||
* word we were given.
|
||||
|
|
Loading…
Reference in New Issue