Formatting

This commit is contained in:
Henry Case 2019-01-31 15:48:44 +00:00
parent 16f0f5b588
commit f143e36c59

View File

@ -13,6 +13,7 @@ import (
// Possible values for "Status"
const (
Valid = iota // Indicates that shared secret must be agreed correctly
ValidPublicKey2 // Public key 2 must succeed validation
InvalidSharedSecret // Calculated shared secret must be different than test vector
InvalidPublicKey1 // Public key 1 generated from private key must be different than test vector
InvalidPublicKey2 // Public key 2 must fail validation
@ -20,6 +21,7 @@ const (
var StatusValues = map[int]string{
Valid: "valid",
ValidPublicKey2: "valid_public_key2",
InvalidSharedSecret: "invalid_shared_secret",
InvalidPublicKey1: "invalid_public_key1",
InvalidPublicKey2: "invalid_public_key2",
@ -32,6 +34,7 @@ type TestVector struct {
Pk2 string `json:"Pk2"`
Ss string `json:"Ss"`
Status string `json:"status"`
Comment string `json:"comment"`
}
type TestVectors struct {
@ -164,6 +167,9 @@ func createNegativePrivateKey(vectors *TestVectors, num int) {
}
}
// TODO: Produce test case for a Pk2 with all zeros and status valid_public_key2.
// comment should be "Zero key should validate correctly"
func main() {
var vectors TestVectors