diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2014-05-28 04:22:36 +0000 |
---|---|---|
committer | Yawning Angel <yawning@schwanenlied.me> | 2014-05-28 04:22:36 +0000 |
commit | 9fe9959c76c96ec3284f43c692cbb099230dcb73 (patch) | |
tree | ac51a41928f56e94a51f686bcb4cba9dbe2ef7b5 /framing | |
parent | bd2bef2ead3e535d64a233fa1a772fee9041519a (diff) |
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.
Diffstat (limited to 'framing')
-rw-r--r-- | framing/framing.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |