Signing a message currently requires copying the payload as an []byte into the cose.SignMessage.Payload field. For large payloads, this means copying large amounts of data. It also means the max size of a payload is limited by available memory.
Payloads are hashed and this can be done in chunks to avoid loading all that data into memory. Passing an io.Reader as Payload, perhaps as a PayloadReader variable, would allow the Sign() function to use that instead of the large []byte
Signing a message currently requires copying the payload as an
[]byte
into thecose.SignMessage.Payload
field. For large payloads, this means copying large amounts of data. It also means the max size of a payload is limited by available memory.Payloads are hashed and this can be done in chunks to avoid loading all that data into memory. Passing an
io.Reader
as Payload, perhaps as a PayloadReader variable, would allow theSign()
function to use that instead of the large[]byte