mlkem: use clear built-in

This commit is contained in:
Sun Yimin 2025-09-25 11:16:47 +08:00 committed by GitHub
parent 5591ee6602
commit fb72bfe828
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -206,9 +206,7 @@ func sliceForAppend(in []byte, n int) (head, tail []byte) {
// followed by ByteEncode₁, according to FIPS 203, Algorithm 5.
func ringCompressAndEncode1(s []byte, f ringElement) []byte {
s, b := sliceForAppend(s, encodingSize1)
for i := range b {
b[i] = 0
}
clear(b)
for i := range f {
b[i/8] |= uint8(compress(f[i], 1) << (i % 8))
}