• Adam Langley's avatar
    math/big: correct documentation for ProbablyPrime. · 5d5889c4
    Adam Langley authored
    As akalin points out in the bug, the comment previously claimed that the
    probability that the input is prime given that the function returned
    true is 1 - ¼ⁿ. But that's wrong: the correct statement is that the
    probability of the function returning false given a composite input is
    1 - ¼ⁿ.
    
    This is not nearly as helpful, but at least it's truthful. A number of
    other (correct) expressions are suggested on the bug, but I think that
    the simplier one is preferable.
    
    This change also notes that the function is not suitable for
    adversarial inputs since it's deterministic.
    
    Fixes #12274.
    
    Change-Id: I6a0871d103b126ee5a5a922a8c6993055cb7b1ed
    Reviewed-on: https://go-review.googlesource.com/14052Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    5d5889c4
nat.go 26 KB