Lines Matching refs:test
122 for _, test := range group.Tests {
123 test := test
125 if len(test.KeyHex) != keyBytes*2 {
126 …ins key %q of length %d, but expected %d-bit key", group.ID, test.ID, test.KeyHex, len(test.KeyHex…
129 key, err := hex.DecodeString(test.KeyHex)
131 return nil, fmt.Errorf("failed to decode key in test case %d/%d: %s", group.ID, test.ID, err)
134 nonce, err := hex.DecodeString(test.IVHex)
136 return nil, fmt.Errorf("failed to decode nonce in test case %d/%d: %s", group.ID, test.ID, err)
139 aad, err := hex.DecodeString(test.AADHex)
141 return nil, fmt.Errorf("failed to decode aad in test case %d/%d: %s", group.ID, test.ID, err)
146 inputHex, otherHex = test.PlaintextHex, test.CiphertextHex
148 inputHex, otherHex = test.CiphertextHex, test.PlaintextHex
152 … return nil, fmt.Errorf("test case %d/%d has unexpected plain/ciphertext input", group.ID, test.ID)
157 return nil, fmt.Errorf("failed to decode hex in test case %d/%d: %s", group.ID, test.ID, err)
162 if len(test.TagHex) != 0 {
163 …f("test case %d/%d has unexpected tag input (should be merged into ciphertext)", group.ID, test.ID)
166 …d/%d has ciphertext shorter than the tag, but the tag should be included in it", group.ID, test.ID)
170 if tag, err = hex.DecodeString(test.TagHex); err != nil {
171 return nil, fmt.Errorf("failed to decode tag in test case %d/%d: %s", group.ID, test.ID, err)
174 …rf("tag in test case %d/%d is %d bytes long, but should be %d", group.ID, test.ID, len(tag), tagBy…
176 } else if len(test.TagHex) != 0 {
177 return nil, fmt.Errorf("test case %d/%d has unexpected tag input", group.ID, test.ID)
181 testResp := aeadTestResponse{ID: test.ID}
186 …rocess for test case %d/%d is shorter than the tag (%d vs %d)", group.ID, test.ID, len(result[0]),…