INNER CODE UNIT · Go
TestBadCurve
schollz/pake · pake_test.go:44
func TestBadCurve(t *testing.T) {
_, err := InitCurve([]byte{1, 2, 3}, 0, "bad")
if err == nil {
t.Errorf("curve should not exist!")
}
}
func TestInvalidInputs(t *testing.T) {
tests := []struct {
name string
pw []byte
role int
curve string
wantErr bool
}{
{"nil password", nil, 0, "p256", false},
{"empty password", []byte{}, 0, "p256", false},
{"invalid role negative", []byte{1, 2, 3}, -1, "p256", false},