On Thursday, March 14, 2019 at 5:13:51 PM UTC-5, Jaime Hablutzel wrote:
> > 64bits_entropy = GetRandom64Bits() //This returns 64 random bits from a
> > CSPRNG with at least one bit in the highest byte set to 1
> > 
> > is, strictly speaking, not true. The best possible implementation for
> > GetRandom64Bits(), as described, only returns 63.994353 bits of entropy,
> > not 64.
> > 
> 
> Can you share how did you get the previous 63.994353?.
> 
> I'm trying the following and I'm getting a different value:
> 
> a = 2^64 = 18446744073709551616
> b = 0x80000000000000 = 36028797018963968
> 
> (a - b) / a * 64 = 63.875
> 
> Maybe I'm misunderstanding something.

Maths were wrong, sorry. I got your same calculation:

min = 0100000000000000 = 72057594037927936
max = 00FFFFFFFFFFFFFFFF = 18446744073709551615
log2(max - min + 1) = 63.99435343685886

_______________________________________________
dev-security-policy mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-security-policy

Reply via email to