Skip to content

Commit

Permalink
ensure hash aft tests send little endian to modulewrapper no matter t…
Browse files Browse the repository at this point in the history
…he platform
  • Loading branch information
Bill Yang committed Jun 13, 2024
1 parent e75f02f commit bd9f7f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/fipstools/acvp/acvptool/subprocess/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package subprocess

import (
// "encoding/binary"
"encoding/binary"
"encoding/hex"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -111,7 +111,9 @@ func (h *hashPrimitive) Process(vectorSet []byte, m Transactable) (interface{},
args = append(args, msg)
if test.OutputLength != nil {
outLenBytes := *test.OutputLength / 8
args = append(args, uint32le(uint32(outLenBytes)))
var outLenArr [4]byte
binary.LittleEndian.PutUint32(outLenArr[:], uint32(outLenBytes))
args = append(args, outLenArr[:])
}
result, err := m.Transact(h.algo, 1, args...)
if err != nil {
Expand Down

0 comments on commit bd9f7f9

Please sign in to comment.