Skip to content

Commit

Permalink
keystore: aptos: Update report hashing format
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Aug 9, 2024
1 parent 86397c2 commit 58538d9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/services/keystore/keys/ocr2key/aptos_keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package ocr2key

import (
"crypto/ed25519"
"encoding/binary"
"io"

"github.com/hdevalence/ed25519consensus"
Expand Down Expand Up @@ -41,13 +40,11 @@ func (akr *aptosKeyring) reportToSigData(reportCtx ocrtypes.ReportContext, repor
if err != nil {
return nil, err
}
reportLen := make([]byte, 4)
binary.BigEndian.PutUint32(reportLen[0:], uint32(len(report)))
h.Write(reportLen[:])
h.Write(report)
// blake2b_256(report_context | report)
h.Write(rawReportContext[0][:])
h.Write(rawReportContext[1][:])
h.Write(rawReportContext[2][:])
h.Write(report)
return h.Sum(nil), nil
}

Expand Down

0 comments on commit 58538d9

Please sign in to comment.