Skip to content

Commit fb72bfe

Browse files
authored
mlkem: use clear built-in
1 parent 5591ee6 commit fb72bfe

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mlkem/field.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ func sliceForAppend(in []byte, n int) (head, tail []byte) {
206206
// followed by ByteEncode₁, according to FIPS 203, Algorithm 5.
207207
func ringCompressAndEncode1(s []byte, f ringElement) []byte {
208208
s, b := sliceForAppend(s, encodingSize1)
209-
for i := range b {
210-
b[i] = 0
211-
}
209+
clear(b)
212210
for i := range f {
213211
b[i/8] |= uint8(compress(f[i], 1) << (i % 8))
214212
}

0 commit comments

Comments
 (0)