Skip to content

Commit

Permalink
fix setOne for finite field
Browse files Browse the repository at this point in the history
  • Loading branch information
Vindaar committed Sep 25, 2024
1 parent 3fe5617 commit 9731668
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions constantine/math_compiler/pub_fields.nim
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,15 @@ proc setOne_internal*(asy: Assembler_LLVM, fd: FieldDescriptor, r: ValueRef) {.u
{kHot}):
tagParameter(1, "sret")
let M = asy.getModulusPtr(fd)
let ri = llvmParams
let rF = asy.asField(fd, ri)

let mOne = asy.getMontyOnePtr(fd)
let mF = asy.asField(fd, mOne)

let ri = llvmParams
asy.store(ri, mOne)
# Need to call `store` for `Field`, which actually copies
# the full data!
store(rF, mF)

asy.br.retVoid()

Expand Down

0 comments on commit 9731668

Please sign in to comment.