Re: Swapping is inefficient and wasteful
From: Ernst Lippe (ernstl-at-planet-dot-nl_at_ignore.this)
Date: 11/24/04
- Next message: Douglas A. Gwyn: "Re: That is not the algorithm I proposed"
- Previous message: Casper H.S. Dik: "Re: How fast computers have made ciphers unbreakable"
- In reply to: Brian Hetrick: "Re: Swapping is inefficient and wasteful"
- Next in thread: Douglas A. Gwyn: "Re: Swapping is inefficient and wasteful"
- Reply: Douglas A. Gwyn: "Re: Swapping is inefficient and wasteful"
- Reply: Brian Hetrick: "Re: Swapping is inefficient and wasteful"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 24 Nov 2004 12:38:54 +0100
On Tue, 23 Nov 2004 16:04:57 -0500, Brian Hetrick wrote:
> If one has cryptographically strong random byte source, as from an ARCFOUR
> implementation, a cryptographically strong U[0,1) rand () can be built
> trivially. Assuming arcfour () returns an integer value in [0,255], the
> expression:
>
> ((arcfour () / 256.0f + arcfour ()) / 256.0f + arcfour ()) / 256.0f
>
> gives a float uniformly distributed over [0,1).
That depends on the bitsize of your floats, in this way you
can get only 2**24 different output values, and when your
floats have a mantissa of more than 24 bits there are some
output values that your algorithm can't produce.
Ernst Lippe
- Next message: Douglas A. Gwyn: "Re: That is not the algorithm I proposed"
- Previous message: Casper H.S. Dik: "Re: How fast computers have made ciphers unbreakable"
- In reply to: Brian Hetrick: "Re: Swapping is inefficient and wasteful"
- Next in thread: Douglas A. Gwyn: "Re: Swapping is inefficient and wasteful"
- Reply: Douglas A. Gwyn: "Re: Swapping is inefficient and wasteful"
- Reply: Brian Hetrick: "Re: Swapping is inefficient and wasteful"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|