Skip to content

Commit f12962c

Browse files
aglBoringssl LUCI CQ
authored andcommitted
Update acvptool for recent server-side changes.
NIST have moved the private key from the group to the individual tests for ML-KEM. Change-Id: I4cf83a7c172a1951ee64f4c7db82644bfef980fb Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/83627 Auto-Submit: Adam Langley <agl@google.com> Reviewed-by: Lily Chen <chlily@google.com> Commit-Queue: Lily Chen <chlily@google.com>
1 parent 027492c commit f12962c

File tree

1 file changed

+8
-7
lines changed
  • util/fipstools/acvp/acvptool/subprocess

1 file changed

+8
-7
lines changed

util/fipstools/acvp/acvptool/subprocess/mlkem.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ type mlkemEncapDecapTestGroup struct {
5858
TestType string `json:"testType"`
5959
ParameterSet string `json:"parameterSet"`
6060
Function string `json:"function"`
61-
DK string `json:"dk,omitempty"`
6261
Tests []mlkemEncapDecapTest `json:"tests"`
6362
}
6463

6564
type mlkemEncapDecapTest struct {
6665
ID uint64 `json:"tcId"`
6766
EK string `json:"ek,omitempty"`
67+
DK string `json:"dk,omitempty"`
6868
M string `json:"m,omitempty"`
6969
C string `json:"c,omitempty"`
7070
}
@@ -200,15 +200,16 @@ func (m *mlkem) processEncapDecap(vectorSet []byte, t Transactable) (any, error)
200200

201201
case "decapsulation":
202202
cmdName := group.ParameterSet + "/decap"
203-
dk, err := hex.DecodeString(group.DK)
204-
if err != nil {
205-
return nil, fmt.Errorf("failed to decode dk in group %d: %s",
206-
group.ID, err)
207-
}
208203

209204
for _, test := range group.Tests {
205+
dk, err := hex.DecodeString(test.DK)
206+
if err != nil || len(dk) == 0 {
207+
return nil, fmt.Errorf("failed to decode dk in test case %d/%d: %s",
208+
group.ID, test.ID, err)
209+
}
210+
210211
c, err := hex.DecodeString(test.C)
211-
if err != nil {
212+
if err != nil || len(c) == 0 {
212213
return nil, fmt.Errorf("failed to decode c in test case %d/%d: %s",
213214
group.ID, test.ID, err)
214215
}

0 commit comments

Comments
 (0)