Commit af4c5ab
Wycheproof: Check K value and reject unrecognized vector fields
Previous versions of the `semi_expanded_keys` Wycheproof test type
did not include a `K` output. Accordingly, the Wycheproof client
would only check if the test driver produced `K` upon a successful
run, but not compare it to anything from the Wycheproof test data.
A recent commit 782238d4 added the expected `K` to the `semi_expanded_keys`
test schema. This commit modifies the Wycheproof client for this test
to check the calculated `K` against this expected `K`.
The above commit also added `ek`, but this is merely the PK embedded in the
SK, and not returned from mlkem-native's API. We therefore ignore the value.
To avoid a similar extension of the test schema go unnoticed in the future,
we explicitly list the keys of each schema that we know about and handle,
and error when new field are added.
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>1 parent 0a09499 commit af4c5ab
1 file changed
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
48 | 67 | | |
49 | 68 | | |
50 | 69 | | |
| |||
79 | 98 | | |
80 | 99 | | |
81 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
82 | 109 | | |
83 | 110 | | |
84 | 111 | | |
| |||
108 | 135 | | |
109 | 136 | | |
110 | 137 | | |
| 138 | + | |
111 | 139 | | |
112 | 140 | | |
113 | 141 | | |
| |||
137 | 165 | | |
138 | 166 | | |
139 | 167 | | |
| 168 | + | |
140 | 169 | | |
141 | 170 | | |
142 | 171 | | |
| |||
171 | 200 | | |
172 | 201 | | |
173 | 202 | | |
| 203 | + | |
174 | 204 | | |
175 | 205 | | |
176 | 206 | | |
| |||
179 | 209 | | |
180 | 210 | | |
181 | 211 | | |
182 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
183 | 216 | | |
184 | 217 | | |
185 | 218 | | |
| |||
200 | 233 | | |
201 | 234 | | |
202 | 235 | | |
| 236 | + | |
203 | 237 | | |
204 | 238 | | |
205 | 239 | | |
| |||
0 commit comments