From 9fe9959c76c96ec3284f43c692cbb099230dcb73 Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Wed, 28 May 2014 04:22:36 +0000 Subject: Change the weighted distribution algorithm be uniform. The old way was biasted towards the earlier values. Thanks to asn for pointing this out and suggesting an alternative. As an additional tweak, do not reuse the drbg seed when calculating the IAT distribution, but instead run the seed through SHA256 first, for extra tinfoil goodness. --- framing/framing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'framing/framing.go') diff --git a/framing/framing.go b/framing/framing.go index 66eeff5..48d12c3 100644 --- a/framing/framing.go +++ b/framing/framing.go @@ -287,7 +287,7 @@ func (decoder *Decoder) Decode(data []byte, frames *bytes.Buffer) (int, error) { } out, ok := secretbox.Open(data[:0], box[:n], &decoder.nextNonce, &decoder.key) if !ok || decoder.nextLengthInvalid { - // When a random lenght is used (on length error) the tag should always + // When a random length is used (on length error) the tag should always // mismatch, but be paranoid. return 0, ErrTagMismatch } -- cgit v1.2.3