()
| 33 | ) |
| 34 | |
| 35 | func entropy() io.Reader { |
| 36 | if flag.Lookup("test.v") != nil { |
| 37 | // This helps speed along our tests, esp. in CI where entropy is |
| 38 | // sparse. |
| 39 | //nolint:gosec |
| 40 | return insecurerand.New(insecurerand.NewSource(time.Now().UnixNano())) |
| 41 | } |
| 42 | // Buffering to reduce the number of system calls |
| 43 | // doubles performance without any loss of security. |
| 44 | return bufio.NewReader(rand.Reader) |
| 45 | } |
| 46 | |
| 47 | // ParseAlgorithm returns a valid Algorithm or error if input is not a valid. |
| 48 | func ParseAlgorithm(t string) (Algorithm, error) { |
no test coverage detected