Skip to content

Commit

Permalink
feat(verifier-Arduino): Remove usage of Seq from constantine verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
kkirkov authored and zah committed Jan 24, 2024
1 parent f7e7613 commit c0fdb6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ proc makePairsAndVerify*(vk: VerificationKey,
let sha256ofHashes = hashHeaders(currentHeaderHash, newOptimisticHeader,
newFinalizedHeader, newExecutionStateRoot,
zerosSlotBuffer, reverseSlot, domain)
let header = headerFromSeq(@sha256ofHashes)
let header = headerFromArr(sha256ofHashes)

var preparedInputs:Input
var ic0Prj: ECP_ShortW_Prj[Fp[BN254_Snarks], G1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type
head*: Fr[BN254_Snarks]
tail*: Fr[BN254_Snarks]

proc headerFromSeq*(bigNum: seq): Header =
proc headerFromArr*(bigNum: array[32, byte]): Header =
var firstNumInBits: array[256, int]
for i in 0..2:
firstNumInBits[i] = 0
Expand Down Expand Up @@ -62,8 +62,7 @@ proc headerFromSeq*(bigNum: seq): Header =
var
head: Fr[BN254_Snarks]
tail: Fr[BN254_Snarks]
head.fromHex(toHex(firstNumInBytes))
tail.fromHex(toHex(secondNumInBytes))

head.fromBig(BigInt[254].unmarshal(firstNumInBytes, bigEndian))
tail.fromBig(BigInt[254].unmarshal(secondNumInBytes, bigEndian))

Header(head: head, tail: tail)
2 changes: 1 addition & 1 deletion libs/nim/verify-utils/verify_given_proof_constantine.nim
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ proc createHeader*(pathCurrentHeader: string, updatePath: string, domain: string
currentSlot,
domain)

headerFromSeq(@sha256ofHashes)
headerFromArr(sha256ofHashes)

proc makePairsAndVerify*(vk: VerificationKey,
prf: Proof,
Expand Down

0 comments on commit c0fdb6f

Please sign in to comment.