keybase / saltpack

a modern crypto messaging format
https://saltpack.org/
BSD 3-Clause "New" or "Revised" License
989 stars 62 forks source link

Implement a better shuffle #57

Closed akalin-keybase closed 6 years ago

akalin-keybase commented 6 years ago

Copy the shuffle code from go 1.10's math/rand.Shuffle, which is unbiased. Reasons for copying:

Also make as much as possible use csprngRead utility function.

Also handle unlikely overflow in receiver count when signcrypting.

Run go vet, golint, and GOARCH=386 tests in CI.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.2%) to 84.439% when pulling d1ebc1e917a0eba44f64bc4f1ba4ee3d3e6339b3 on akalin/better-shuffle into 0c8b960f9a0d60e5f4e6c43b8169553692aa21b9 on master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.2%) to 84.502% when pulling 5cc4032d5bfd98b62201052603111cd58d4b893e on akalin/better-shuffle into 0c8b960f9a0d60e5f4e6c43b8169553692aa21b9 on master.

akalin-keybase commented 6 years ago

Okay, addressed all comments! PTAL