INNER CODE UNIT · Go

TestInvalidInputs

schollz/pake · pake_test.go:51

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},
		{"invalid role large", []byte{1, 2, 3}, 999, "p256", false},
		{"empty curve", []byte{1, 2, 3}, 0, "", true},
		{"invalid curve", []byte{1, 2, 3}, 0, "invalid", true},
		{"very long password", make([]byte, 1000), 0, "p256", false},
	}

	for _, tt := range tests {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…