summaryrefslogtreecommitdiffstats
path: root/lib/isc/entropy.c
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2011-02-05 03:14:55 +0000
committerdougb <dougb@FreeBSD.org>2011-02-05 03:14:55 +0000
commit8287cb3f73a2d36684fdf69f4009f28e17dd3800 (patch)
tree601b0776df11a070020ab894b76fd90e36393936 /lib/isc/entropy.c
parentd2262df647cb68b7a55a79623696e646c546774e (diff)
downloadFreeBSD-src-8287cb3f73a2d36684fdf69f4009f28e17dd3800.zip
FreeBSD-src-8287cb3f73a2d36684fdf69f4009f28e17dd3800.tar.gz
Vendor import of BIND 9.6.3
Diffstat (limited to 'lib/isc/entropy.c')
-rw-r--r--lib/isc/entropy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/isc/entropy.c b/lib/isc/entropy.c
index 25ab002..af8757f 100644
--- a/lib/isc/entropy.c
+++ b/lib/isc/entropy.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: entropy.c,v 1.18.332.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: entropy.c,v 1.18.332.4 2010-08-10 23:46:54 tbox Exp $ */
/*! \file
* \brief
@@ -283,8 +283,11 @@ entropypool_add_word(isc_entropypool_t *rp, isc_uint32_t val) {
val ^= rp->pool[(rp->cursor + TAP3) & (RND_POOLWORDS - 1)];
val ^= rp->pool[(rp->cursor + TAP4) & (RND_POOLWORDS - 1)];
val ^= rp->pool[(rp->cursor + TAP5) & (RND_POOLWORDS - 1)];
- rp->pool[rp->cursor++] ^=
- ((val << rp->rotate) | (val >> (32 - rp->rotate)));
+ if (rp->rotate == 0)
+ rp->pool[rp->cursor++] ^= val;
+ else
+ rp->pool[rp->cursor++] ^=
+ ((val << rp->rotate) | (val >> (32 - rp->rotate)));
/*
* If we have looped around the pool, increment the rotate
OpenPOWER on IntegriCloud