-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
distinct borrow of generics + template in type section + macro type inference issue #23971
Labels
Comments
🐧 Linux bisect by @juancarlospaco (collaborator)devel 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("macros")
)
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("bitops")
)
),
nnkProcDef.newTree(
newIdentNode("replaceNodes"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("ast"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("what"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("by"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("inspect"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("node"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCaseStmt.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
nnkOfBranch.newTree(
nnkCurly.newTree(
newIdentNode("nnkIdent"),
newIdentNode("nnkSym")
),
nnkStmtList.newTree(
nnkIfStmt.newTree(
nnkElifBranch.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("eqIdent")
),
newIdentNode("what")
),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("by")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkEmpty"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkLiterals"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("rTree"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
newIdentNode("newTree")
)
)
)
),
nnkForStmt.newTree(
newIdentNode("child"),
newIdentNode("node"),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("rTree"),
newIdentNode("add")
),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("child")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("rTree")
)
)
)
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("ast")
)
)
)
),
nnkMacroDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("staticFor")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("idx"),
nnkCurlyExpr.newTree(
newIdentNode("untyped"),
newIdentNode("nkIdent")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("start"),
newIdentNode("stopEx"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("body"),
newIdentNode("untyped"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("newStmtList")
)
),
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newIdentNode("start"),
newIdentNode("stopEx")
),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("result"),
newIdentNode("add")
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("nnkBlockStmt"),
newIdentNode("newTree")
),
nnkCall.newTree(
newIdentNode("ident"),
nnkInfix.newTree(
newIdentNode("&"),
nnkInfix.newTree(
newIdentNode("&"),
newLit("unrolledIter_"),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("idx")
)
),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("i")
)
)
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("body"),
newIdentNode("replaceNodes")
),
newIdentNode("idx"),
nnkCommand.newTree(
newIdentNode("newLit"),
newIdentNode("i")
)
)
)
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Curve"),
newEmptyNode(),
nnkEnumTy.newTree(
newEmptyNode(),
newIdentNode("BLS12_381")
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("WordBitWidth")
),
newEmptyNode(),
nnkInfix.newTree(
newIdentNode("*"),
nnkCall.newTree(
newIdentNode("sizeof"),
newIdentNode("uint64")
),
newLit(8)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("wordsRequired")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("bits"),
newIdentNode("int"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("inline")
),
newEmptyNode(),
nnkStmtList.newTree(
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("divShiftor"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("fastLog2"),
newIdentNode("WordBitWidth")
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkInfix.newTree(
newIdentNode("shr"),
nnkPar.newTree(
nnkInfix.newTree(
newIdentNode("-"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("bits"),
newIdentNode("WordBitWidth")
),
newLit(1)
)
),
newIdentNode("divShiftor")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("BigInt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("bits"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("limbs")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
nnkDotExpr.newTree(
newIdentNode("bits"),
newIdentNode("wordsRequired")
),
newIdentNode("uint64")
),
newEmptyNode()
)
)
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("CurveBitWidth"),
newEmptyNode(),
nnkBracket.newTree(
nnkExprColonExpr.newTree(
newIdentNode("BLS12_381"),
newLit(381)
)
)
)
),
nnkTemplateDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("matchingBigInt")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("Name"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("BigInt type necessary to store the prime field Fp"),
nnkBracketExpr.newTree(
newIdentNode("BigInt"),
nnkBracketExpr.newTree(
newIdentNode("CurveBitWidth"),
newIdentNode("Name")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Fp"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("residue"),
nnkCall.newTree(
newIdentNode("matchingBigInt"),
newIdentNode("C")
),
newEmptyNode()
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("CubicExt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("F"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("coords")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newLit(3),
newIdentNode("F")
),
newEmptyNode()
)
)
)
),
nnkTypeDef.newTree(
newIdentNode("Fp3"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("CubicExt"),
nnkBracketExpr.newTree(
newIdentNode("Fp"),
newIdentNode("C")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPragmaExpr.newTree(
newIdentNode("Fp3prj"),
nnkPragma.newTree(
nnkExprColonExpr.newTree(
newIdentNode("borrow"),
nnkAccQuoted.newTree(
newIdentNode(".")
)
)
)
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkDistinctTy.newTree(
nnkBracketExpr.newTree(
newIdentNode("Fp3"),
newIdentNode("C")
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("limbs")
),
newIdentNode("i")
)
)
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("CubicExt")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("CubicExt"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("Addition in the extension field"),
nnkCommand.newTree(
newIdentNode("staticFor"),
newIdentNode("i"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("coords")
),
newIdentNode("i")
)
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkBracketExpr.newTree(
newIdentNode("Fp3prj"),
newIdentNode("BLS12_381")
),
newEmptyNode()
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newLit(0)
),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp3prj")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp3prj"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("borrow")
),
newEmptyNode(),
newEmptyNode()
)
) stable 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("macros")
)
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("bitops")
)
),
nnkProcDef.newTree(
newIdentNode("replaceNodes"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("ast"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("what"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("by"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("inspect"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("node"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCaseStmt.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
nnkOfBranch.newTree(
nnkCurly.newTree(
newIdentNode("nnkIdent"),
newIdentNode("nnkSym")
),
nnkStmtList.newTree(
nnkIfStmt.newTree(
nnkElifBranch.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("eqIdent")
),
newIdentNode("what")
),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("by")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkEmpty"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkLiterals"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("rTree"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
newIdentNode("newTree")
)
)
)
),
nnkForStmt.newTree(
newIdentNode("child"),
newIdentNode("node"),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("rTree"),
newIdentNode("add")
),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("child")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("rTree")
)
)
)
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("ast")
)
)
)
),
nnkMacroDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("staticFor")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("idx"),
nnkCurlyExpr.newTree(
newIdentNode("untyped"),
newIdentNode("nkIdent")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("start"),
newIdentNode("stopEx"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("body"),
newIdentNode("untyped"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("newStmtList")
)
),
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newIdentNode("start"),
newIdentNode("stopEx")
),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("result"),
newIdentNode("add")
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("nnkBlockStmt"),
newIdentNode("newTree")
),
nnkCall.newTree(
newIdentNode("ident"),
nnkInfix.newTree(
newIdentNode("&"),
nnkInfix.newTree(
newIdentNode("&"),
newLit("unrolledIter_"),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("idx")
)
),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("i")
)
)
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("body"),
newIdentNode("replaceNodes")
),
newIdentNode("idx"),
nnkCommand.newTree(
newIdentNode("newLit"),
newIdentNode("i")
)
)
)
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Curve"),
newEmptyNode(),
nnkEnumTy.newTree(
newEmptyNode(),
newIdentNode("BLS12_381")
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("WordBitWidth")
),
newEmptyNode(),
nnkInfix.newTree(
newIdentNode("*"),
nnkCall.newTree(
newIdentNode("sizeof"),
newIdentNode("uint64")
),
newLit(8)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("wordsRequired")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("bits"),
newIdentNode("int"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("inline")
),
newEmptyNode(),
nnkStmtList.newTree(
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("divShiftor"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("fastLog2"),
newIdentNode("WordBitWidth")
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkInfix.newTree(
newIdentNode("shr"),
nnkPar.newTree(
nnkInfix.newTree(
newIdentNode("-"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("bits"),
newIdentNode("WordBitWidth")
),
newLit(1)
)
),
newIdentNode("divShiftor")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("BigInt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("bits"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("limbs")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
nnkDotExpr.newTree(
newIdentNode("bits"),
newIdentNode("wordsRequired")
),
newIdentNode("uint64")
),
newEmptyNode()
)
)
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("CurveBitWidth"),
newEmptyNode(),
nnkBracket.newTree(
nnkExprColonExpr.newTree(
newIdentNode("BLS12_381"),
newLit(381)
)
)
)
),
nnkTemplateDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("matchingBigInt")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("Name"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("BigInt type necessary to store the prime field Fp"),
nnkBracketExpr.newTree(
newIdentNode("BigInt"),
nnkBracketExpr.newTree(
newIdentNode("CurveBitWidth"),
newIdentNode("Name")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Fp"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("residue"),
nnkCall.newTree(
newIdentNode("matchingBigInt"),
newIdentNode("C")
),
newEmptyNode()
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("CubicExt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("F"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("coords")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newLit(3),
newIdentNode("F")
),
newEmptyNode()
)
)
)
),
nnkTypeDef.newTree(
newIdentNode("Fp3"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("CubicExt"),
nnkBracketExpr.newTree(
newIdentNode("Fp"),
newIdentNode("C")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPragmaExpr.newTree(
newIdentNode("Fp3prj"),
nnkPragma.newTree(
nnkExprColonExpr.newTree(
newIdentNode("borrow"),
nnkAccQuoted.newTree(
newIdentNode(".")
)
)
)
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkDistinctTy.newTree(
nnkBracketExpr.newTree(
newIdentNode("Fp3"),
newIdentNode("C")
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("limbs")
),
newIdentNode("i")
)
)
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("CubicExt")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("CubicExt"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("Addition in the extension field"),
nnkCommand.newTree(
newIdentNode("staticFor"),
newIdentNode("i"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("coords")
),
newIdentNode("i")
)
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkBracketExpr.newTree(
newIdentNode("Fp3prj"),
newIdentNode("BLS12_381")
),
newEmptyNode()
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newLit(0)
),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp3prj")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp3prj"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("borrow")
),
newEmptyNode(),
newEmptyNode()
)
) 2.0.4 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("macros")
)
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("bitops")
)
),
nnkProcDef.newTree(
newIdentNode("replaceNodes"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("ast"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("what"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("by"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("inspect"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("node"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCaseStmt.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
nnkOfBranch.newTree(
nnkCurly.newTree(
newIdentNode("nnkIdent"),
newIdentNode("nnkSym")
),
nnkStmtList.newTree(
nnkIfStmt.newTree(
nnkElifBranch.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("eqIdent")
),
newIdentNode("what")
),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("by")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkEmpty"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkLiterals"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("rTree"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
newIdentNode("newTree")
)
)
)
),
nnkForStmt.newTree(
newIdentNode("child"),
newIdentNode("node"),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("rTree"),
newIdentNode("add")
),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("child")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("rTree")
)
)
)
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("ast")
)
)
)
),
nnkMacroDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("staticFor")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("idx"),
nnkCurlyExpr.newTree(
newIdentNode("untyped"),
newIdentNode("nkIdent")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("start"),
newIdentNode("stopEx"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("body"),
newIdentNode("untyped"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("newStmtList")
)
),
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newIdentNode("start"),
newIdentNode("stopEx")
),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("result"),
newIdentNode("add")
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("nnkBlockStmt"),
newIdentNode("newTree")
),
nnkCall.newTree(
newIdentNode("ident"),
nnkInfix.newTree(
newIdentNode("&"),
nnkInfix.newTree(
newIdentNode("&"),
newLit("unrolledIter_"),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("idx")
)
),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("i")
)
)
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("body"),
newIdentNode("replaceNodes")
),
newIdentNode("idx"),
nnkCommand.newTree(
newIdentNode("newLit"),
newIdentNode("i")
)
)
)
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Curve"),
newEmptyNode(),
nnkEnumTy.newTree(
newEmptyNode(),
newIdentNode("BLS12_381")
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("WordBitWidth")
),
newEmptyNode(),
nnkInfix.newTree(
newIdentNode("*"),
nnkCall.newTree(
newIdentNode("sizeof"),
newIdentNode("uint64")
),
newLit(8)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("wordsRequired")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("bits"),
newIdentNode("int"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("inline")
),
newEmptyNode(),
nnkStmtList.newTree(
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("divShiftor"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("fastLog2"),
newIdentNode("WordBitWidth")
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkInfix.newTree(
newIdentNode("shr"),
nnkPar.newTree(
nnkInfix.newTree(
newIdentNode("-"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("bits"),
newIdentNode("WordBitWidth")
),
newLit(1)
)
),
newIdentNode("divShiftor")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("BigInt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("bits"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("limbs")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
nnkDotExpr.newTree(
newIdentNode("bits"),
newIdentNode("wordsRequired")
),
newIdentNode("uint64")
),
newEmptyNode()
)
)
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("CurveBitWidth"),
newEmptyNode(),
nnkBracket.newTree(
nnkExprColonExpr.newTree(
newIdentNode("BLS12_381"),
newLit(381)
)
)
)
),
nnkTemplateDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("matchingBigInt")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("Name"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("BigInt type necessary to store the prime field Fp"),
nnkBracketExpr.newTree(
newIdentNode("BigInt"),
nnkBracketExpr.newTree(
newIdentNode("CurveBitWidth"),
newIdentNode("Name")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Fp"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("residue"),
nnkCall.newTree(
newIdentNode("matchingBigInt"),
newIdentNode("C")
),
newEmptyNode()
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("CubicExt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("F"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("coords")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newLit(3),
newIdentNode("F")
),
newEmptyNode()
)
)
)
),
nnkTypeDef.newTree(
newIdentNode("Fp3"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("CubicExt"),
nnkBracketExpr.newTree(
newIdentNode("Fp"),
newIdentNode("C")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPragmaExpr.newTree(
newIdentNode("Fp3prj"),
nnkPragma.newTree(
nnkExprColonExpr.newTree(
newIdentNode("borrow"),
nnkAccQuoted.newTree(
newIdentNode(".")
)
)
)
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkDistinctTy.newTree(
nnkBracketExpr.newTree(
newIdentNode("Fp3"),
newIdentNode("C")
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("limbs")
),
newIdentNode("i")
)
)
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("CubicExt")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("CubicExt"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("Addition in the extension field"),
nnkCommand.newTree(
newIdentNode("staticFor"),
newIdentNode("i"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("coords")
),
newIdentNode("i")
)
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkBracketExpr.newTree(
newIdentNode("Fp3prj"),
newIdentNode("BLS12_381")
),
newEmptyNode()
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newLit(0)
),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp3prj")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp3prj"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("borrow")
),
newEmptyNode(),
newEmptyNode()
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("macros")
)
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("bitops")
)
),
nnkProcDef.newTree(
newIdentNode("replaceNodes"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("ast"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("what"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("by"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("inspect"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("node"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCaseStmt.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
nnkOfBranch.newTree(
nnkCurly.newTree(
newIdentNode("nnkIdent"),
newIdentNode("nnkSym")
),
nnkStmtList.newTree(
nnkIfStmt.newTree(
nnkElifBranch.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("eqIdent")
),
newIdentNode("what")
),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("by")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkEmpty"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkLiterals"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("rTree"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
newIdentNode("newTree")
)
)
)
),
nnkForStmt.newTree(
newIdentNode("child"),
newIdentNode("node"),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("rTree"),
newIdentNode("add")
),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("child")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("rTree")
)
)
)
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("ast")
)
)
)
),
nnkMacroDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("staticFor")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("idx"),
nnkCurlyExpr.newTree(
newIdentNode("untyped"),
newIdentNode("nkIdent")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("start"),
newIdentNode("stopEx"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("body"),
newIdentNode("untyped"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("newStmtList")
)
),
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newIdentNode("start"),
newIdentNode("stopEx")
),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("result"),
newIdentNode("add")
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("nnkBlockStmt"),
newIdentNode("newTree")
),
nnkCall.newTree(
newIdentNode("ident"),
nnkInfix.newTree(
newIdentNode("&"),
nnkInfix.newTree(
newIdentNode("&"),
newLit("unrolledIter_"),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("idx")
)
),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("i")
)
)
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("body"),
newIdentNode("replaceNodes")
),
newIdentNode("idx"),
nnkCommand.newTree(
newIdentNode("newLit"),
newIdentNode("i")
)
)
)
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Curve"),
newEmptyNode(),
nnkEnumTy.newTree(
newEmptyNode(),
newIdentNode("BLS12_381")
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("WordBitWidth")
),
newEmptyNode(),
nnkInfix.newTree(
newIdentNode("*"),
nnkCall.newTree(
newIdentNode("sizeof"),
newIdentNode("uint64")
),
newLit(8)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("wordsRequired")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("bits"),
newIdentNode("int"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("inline")
),
newEmptyNode(),
nnkStmtList.newTree(
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("divShiftor"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("fastLog2"),
newIdentNode("WordBitWidth")
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkInfix.newTree(
newIdentNode("shr"),
nnkPar.newTree(
nnkInfix.newTree(
newIdentNode("-"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("bits"),
newIdentNode("WordBitWidth")
),
newLit(1)
)
),
newIdentNode("divShiftor")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("BigInt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("bits"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("limbs")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
nnkDotExpr.newTree(
newIdentNode("bits"),
newIdentNode("wordsRequired")
),
newIdentNode("uint64")
),
newEmptyNode()
)
)
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("CurveBitWidth"),
newEmptyNode(),
nnkBracket.newTree(
nnkExprColonExpr.newTree(
newIdentNode("BLS12_381"),
newLit(381)
)
)
)
),
nnkTemplateDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("matchingBigInt")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("Name"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("BigInt type necessary to store the prime field Fp"),
nnkBracketExpr.newTree(
newIdentNode("BigInt"),
nnkBracketExpr.newTree(
newIdentNode("CurveBitWidth"),
newIdentNode("Name")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Fp"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("residue"),
nnkCall.newTree(
newIdentNode("matchingBigInt"),
newIdentNode("C")
),
newEmptyNode()
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("CubicExt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("F"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("coords")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newLit(3),
newIdentNode("F")
),
newEmptyNode()
)
)
)
),
nnkTypeDef.newTree(
newIdentNode("Fp3"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("CubicExt"),
nnkBracketExpr.newTree(
newIdentNode("Fp"),
newIdentNode("C")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPragmaExpr.newTree(
newIdentNode("Fp3prj"),
nnkPragma.newTree(
nnkExprColonExpr.newTree(
newIdentNode("borrow"),
nnkAccQuoted.newTree(
newIdentNode(".")
)
)
)
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkDistinctTy.newTree(
nnkBracketExpr.newTree(
newIdentNode("Fp3"),
newIdentNode("C")
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("limbs")
),
newIdentNode("i")
)
)
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("CubicExt")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("CubicExt"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("Addition in the extension field"),
nnkCommand.newTree(
newIdentNode("staticFor"),
newIdentNode("i"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("coords")
),
newIdentNode("i")
)
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkBracketExpr.newTree(
newIdentNode("Fp3prj"),
newIdentNode("BLS12_381")
),
newEmptyNode()
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newLit(0)
),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp3prj")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp3prj"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("borrow")
),
newEmptyNode(),
newEmptyNode()
)
) 1.6.20 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("macros")
)
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("bitops")
)
),
nnkProcDef.newTree(
newIdentNode("replaceNodes"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("ast"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("what"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("by"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("inspect"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("node"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCaseStmt.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
nnkOfBranch.newTree(
nnkCurly.newTree(
newIdentNode("nnkIdent"),
newIdentNode("nnkSym")
),
nnkStmtList.newTree(
nnkIfStmt.newTree(
nnkElifBranch.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("eqIdent")
),
newIdentNode("what")
),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("by")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkEmpty"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkLiterals"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("rTree"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
newIdentNode("newTree")
)
)
)
),
nnkForStmt.newTree(
newIdentNode("child"),
newIdentNode("node"),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("rTree"),
newIdentNode("add")
),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("child")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("rTree")
)
)
)
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("ast")
)
)
)
),
nnkMacroDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("staticFor")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("idx"),
nnkCurlyExpr.newTree(
newIdentNode("untyped"),
newIdentNode("nkIdent")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("start"),
newIdentNode("stopEx"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("body"),
newIdentNode("untyped"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("newStmtList")
)
),
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newIdentNode("start"),
newIdentNode("stopEx")
),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("result"),
newIdentNode("add")
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("nnkBlockStmt"),
newIdentNode("newTree")
),
nnkCall.newTree(
newIdentNode("ident"),
nnkInfix.newTree(
newIdentNode("&"),
nnkInfix.newTree(
newIdentNode("&"),
newLit("unrolledIter_"),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("idx")
)
),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("i")
)
)
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("body"),
newIdentNode("replaceNodes")
),
newIdentNode("idx"),
nnkCommand.newTree(
newIdentNode("newLit"),
newIdentNode("i")
)
)
)
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Curve"),
newEmptyNode(),
nnkEnumTy.newTree(
newEmptyNode(),
newIdentNode("BLS12_381")
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("WordBitWidth")
),
newEmptyNode(),
nnkInfix.newTree(
newIdentNode("*"),
nnkCall.newTree(
newIdentNode("sizeof"),
newIdentNode("uint64")
),
newLit(8)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("wordsRequired")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("bits"),
newIdentNode("int"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("inline")
),
newEmptyNode(),
nnkStmtList.newTree(
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("divShiftor"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("fastLog2"),
newIdentNode("WordBitWidth")
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkInfix.newTree(
newIdentNode("shr"),
nnkPar.newTree(
nnkInfix.newTree(
newIdentNode("-"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("bits"),
newIdentNode("WordBitWidth")
),
newLit(1)
)
),
newIdentNode("divShiftor")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("BigInt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("bits"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("limbs")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
nnkDotExpr.newTree(
newIdentNode("bits"),
newIdentNode("wordsRequired")
),
newIdentNode("uint64")
),
newEmptyNode()
)
)
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("CurveBitWidth"),
newEmptyNode(),
nnkBracket.newTree(
nnkExprColonExpr.newTree(
newIdentNode("BLS12_381"),
newLit(381)
)
)
)
),
nnkTemplateDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("matchingBigInt")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("Name"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("BigInt type necessary to store the prime field Fp"),
nnkBracketExpr.newTree(
newIdentNode("BigInt"),
nnkBracketExpr.newTree(
newIdentNode("CurveBitWidth"),
newIdentNode("Name")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Fp"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("residue"),
nnkCall.newTree(
newIdentNode("matchingBigInt"),
newIdentNode("C")
),
newEmptyNode()
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("CubicExt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("F"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("coords")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newLit(3),
newIdentNode("F")
),
newEmptyNode()
)
)
)
),
nnkTypeDef.newTree(
newIdentNode("Fp3"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("CubicExt"),
nnkBracketExpr.newTree(
newIdentNode("Fp"),
newIdentNode("C")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPragmaExpr.newTree(
newIdentNode("Fp3prj"),
nnkPragma.newTree(
nnkExprColonExpr.newTree(
newIdentNode("borrow"),
nnkAccQuoted.newTree(
newIdentNode(".")
)
)
)
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkDistinctTy.newTree(
nnkBracketExpr.newTree(
newIdentNode("Fp3"),
newIdentNode("C")
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("limbs")
),
newIdentNode("i")
)
)
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("CubicExt")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("CubicExt"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("Addition in the extension field"),
nnkCommand.newTree(
newIdentNode("staticFor"),
newIdentNode("i"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("coords")
),
newIdentNode("i")
)
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkBracketExpr.newTree(
newIdentNode("Fp3prj"),
newIdentNode("BLS12_381")
),
newEmptyNode()
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newLit(0)
),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp3prj")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp3prj"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("borrow")
),
newEmptyNode(),
newEmptyNode()
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("macros")
)
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("bitops")
)
),
nnkProcDef.newTree(
newIdentNode("replaceNodes"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("ast"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("what"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("by"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("inspect"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("node"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCaseStmt.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
nnkOfBranch.newTree(
nnkCurly.newTree(
newIdentNode("nnkIdent"),
newIdentNode("nnkSym")
),
nnkStmtList.newTree(
nnkIfStmt.newTree(
nnkElifBranch.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("eqIdent")
),
newIdentNode("what")
),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("by")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkEmpty"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkLiterals"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("rTree"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
newIdentNode("newTree")
)
)
)
),
nnkForStmt.newTree(
newIdentNode("child"),
newIdentNode("node"),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("rTree"),
newIdentNode("add")
),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("child")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("rTree")
)
)
)
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("ast")
)
)
)
),
nnkMacroDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("staticFor")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("idx"),
nnkCurlyExpr.newTree(
newIdentNode("untyped"),
newIdentNode("nkIdent")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("start"),
newIdentNode("stopEx"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("body"),
newIdentNode("untyped"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("newStmtList")
)
),
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newIdentNode("start"),
newIdentNode("stopEx")
),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("result"),
newIdentNode("add")
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("nnkBlockStmt"),
newIdentNode("newTree")
),
nnkCall.newTree(
newIdentNode("ident"),
nnkInfix.newTree(
newIdentNode("&"),
nnkInfix.newTree(
newIdentNode("&"),
newLit("unrolledIter_"),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("idx")
)
),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("i")
)
)
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("body"),
newIdentNode("replaceNodes")
),
newIdentNode("idx"),
nnkCommand.newTree(
newIdentNode("newLit"),
newIdentNode("i")
)
)
)
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Curve"),
newEmptyNode(),
nnkEnumTy.newTree(
newEmptyNode(),
newIdentNode("BLS12_381")
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("WordBitWidth")
),
newEmptyNode(),
nnkInfix.newTree(
newIdentNode("*"),
nnkCall.newTree(
newIdentNode("sizeof"),
newIdentNode("uint64")
),
newLit(8)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("wordsRequired")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("bits"),
newIdentNode("int"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("inline")
),
newEmptyNode(),
nnkStmtList.newTree(
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("divShiftor"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("fastLog2"),
newIdentNode("WordBitWidth")
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkInfix.newTree(
newIdentNode("shr"),
nnkPar.newTree(
nnkInfix.newTree(
newIdentNode("-"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("bits"),
newIdentNode("WordBitWidth")
),
newLit(1)
)
),
newIdentNode("divShiftor")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("BigInt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("bits"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("limbs")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
nnkDotExpr.newTree(
newIdentNode("bits"),
newIdentNode("wordsRequired")
),
newIdentNode("uint64")
),
newEmptyNode()
)
)
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("CurveBitWidth"),
newEmptyNode(),
nnkBracket.newTree(
nnkExprColonExpr.newTree(
newIdentNode("BLS12_381"),
newLit(381)
)
)
)
),
nnkTemplateDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("matchingBigInt")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("Name"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("BigInt type necessary to store the prime field Fp"),
nnkBracketExpr.newTree(
newIdentNode("BigInt"),
nnkBracketExpr.newTree(
newIdentNode("CurveBitWidth"),
newIdentNode("Name")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Fp"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("residue"),
nnkCall.newTree(
newIdentNode("matchingBigInt"),
newIdentNode("C")
),
newEmptyNode()
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("CubicExt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("F"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("coords")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newLit(3),
newIdentNode("F")
),
newEmptyNode()
)
)
)
),
nnkTypeDef.newTree(
newIdentNode("Fp3"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("CubicExt"),
nnkBracketExpr.newTree(
newIdentNode("Fp"),
newIdentNode("C")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPragmaExpr.newTree(
newIdentNode("Fp3prj"),
nnkPragma.newTree(
nnkExprColonExpr.newTree(
newIdentNode("borrow"),
nnkAccQuoted.newTree(
newIdentNode(".")
)
)
)
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkDistinctTy.newTree(
nnkBracketExpr.newTree(
newIdentNode("Fp3"),
newIdentNode("C")
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("limbs")
),
newIdentNode("i")
)
)
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("CubicExt")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("CubicExt"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("Addition in the extension field"),
nnkCommand.newTree(
newIdentNode("staticFor"),
newIdentNode("i"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("coords")
),
newIdentNode("i")
)
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkBracketExpr.newTree(
newIdentNode("Fp3prj"),
newIdentNode("BLS12_381")
),
newEmptyNode()
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newLit(0)
),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp3prj")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp3prj"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("borrow")
),
newEmptyNode(),
newEmptyNode()
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("macros")
)
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("bitops")
)
),
nnkProcDef.newTree(
newIdentNode("replaceNodes"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("ast"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("what"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("by"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("inspect"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("node"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCaseStmt.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
nnkOfBranch.newTree(
nnkCurly.newTree(
newIdentNode("nnkIdent"),
newIdentNode("nnkSym")
),
nnkStmtList.newTree(
nnkIfStmt.newTree(
nnkElifBranch.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("eqIdent")
),
newIdentNode("what")
),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("by")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkEmpty"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkLiterals"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("rTree"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
newIdentNode("newTree")
)
)
)
),
nnkForStmt.newTree(
newIdentNode("child"),
newIdentNode("node"),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("rTree"),
newIdentNode("add")
),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("child")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("rTree")
)
)
)
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("ast")
)
)
)
),
nnkMacroDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("staticFor")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("idx"),
nnkCurlyExpr.newTree(
newIdentNode("untyped"),
newIdentNode("nkIdent")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("start"),
newIdentNode("stopEx"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("body"),
newIdentNode("untyped"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("newStmtList")
)
),
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newIdentNode("start"),
newIdentNode("stopEx")
),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("result"),
newIdentNode("add")
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("nnkBlockStmt"),
newIdentNode("newTree")
),
nnkCall.newTree(
newIdentNode("ident"),
nnkInfix.newTree(
newIdentNode("&"),
nnkInfix.newTree(
newIdentNode("&"),
newLit("unrolledIter_"),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("idx")
)
),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("i")
)
)
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("body"),
newIdentNode("replaceNodes")
),
newIdentNode("idx"),
nnkCommand.newTree(
newIdentNode("newLit"),
newIdentNode("i")
)
)
)
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Curve"),
newEmptyNode(),
nnkEnumTy.newTree(
newEmptyNode(),
newIdentNode("BLS12_381")
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("WordBitWidth")
),
newEmptyNode(),
nnkInfix.newTree(
newIdentNode("*"),
nnkCall.newTree(
newIdentNode("sizeof"),
newIdentNode("uint64")
),
newLit(8)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("wordsRequired")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("bits"),
newIdentNode("int"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("inline")
),
newEmptyNode(),
nnkStmtList.newTree(
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("divShiftor"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("fastLog2"),
newIdentNode("WordBitWidth")
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkInfix.newTree(
newIdentNode("shr"),
nnkPar.newTree(
nnkInfix.newTree(
newIdentNode("-"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("bits"),
newIdentNode("WordBitWidth")
),
newLit(1)
)
),
newIdentNode("divShiftor")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("BigInt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("bits"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("limbs")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
nnkDotExpr.newTree(
newIdentNode("bits"),
newIdentNode("wordsRequired")
),
newIdentNode("uint64")
),
newEmptyNode()
)
)
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("CurveBitWidth"),
newEmptyNode(),
nnkBracket.newTree(
nnkExprColonExpr.newTree(
newIdentNode("BLS12_381"),
newLit(381)
)
)
)
),
nnkTemplateDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("matchingBigInt")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("Name"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("BigInt type necessary to store the prime field Fp"),
nnkBracketExpr.newTree(
newIdentNode("BigInt"),
nnkBracketExpr.newTree(
newIdentNode("CurveBitWidth"),
newIdentNode("Name")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Fp"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("residue"),
nnkCall.newTree(
newIdentNode("matchingBigInt"),
newIdentNode("C")
),
newEmptyNode()
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("CubicExt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("F"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("coords")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newLit(3),
newIdentNode("F")
),
newEmptyNode()
)
)
)
),
nnkTypeDef.newTree(
newIdentNode("Fp3"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("CubicExt"),
nnkBracketExpr.newTree(
newIdentNode("Fp"),
newIdentNode("C")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPragmaExpr.newTree(
newIdentNode("Fp3prj"),
nnkPragma.newTree(
nnkExprColonExpr.newTree(
newIdentNode("borrow"),
nnkAccQuoted.newTree(
newIdentNode(".")
)
)
)
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkDistinctTy.newTree(
nnkBracketExpr.newTree(
newIdentNode("Fp3"),
newIdentNode("C")
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("limbs")
),
newIdentNode("i")
)
)
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("CubicExt")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("CubicExt"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("Addition in the extension field"),
nnkCommand.newTree(
newIdentNode("staticFor"),
newIdentNode("i"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("coords")
),
newIdentNode("i")
)
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkBracketExpr.newTree(
newIdentNode("Fp3prj"),
newIdentNode("BLS12_381")
),
newEmptyNode()
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newLit(0)
),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp3prj")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp3prj"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("borrow")
),
newEmptyNode(),
newEmptyNode()
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("macros")
)
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("bitops")
)
),
nnkProcDef.newTree(
newIdentNode("replaceNodes"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("ast"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("what"),
newIdentNode("NimNode"),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("by"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("inspect"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("NimNode"),
nnkIdentDefs.newTree(
newIdentNode("node"),
newIdentNode("NimNode"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCaseStmt.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
nnkOfBranch.newTree(
nnkCurly.newTree(
newIdentNode("nnkIdent"),
newIdentNode("nnkSym")
),
nnkStmtList.newTree(
nnkIfStmt.newTree(
nnkElifBranch.newTree(
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("eqIdent")
),
newIdentNode("what")
),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("by")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkEmpty"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkOfBranch.newTree(
newIdentNode("nnkLiterals"),
nnkStmtList.newTree(
nnkReturnStmt.newTree(
newIdentNode("node")
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("rTree"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("node"),
newIdentNode("kind")
),
newIdentNode("newTree")
)
)
)
),
nnkForStmt.newTree(
newIdentNode("child"),
newIdentNode("node"),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("rTree"),
newIdentNode("add")
),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("child")
)
)
)
),
nnkReturnStmt.newTree(
newIdentNode("rTree")
)
)
)
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("inspect"),
newIdentNode("ast")
)
)
)
),
nnkMacroDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("staticFor")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("idx"),
nnkCurlyExpr.newTree(
newIdentNode("untyped"),
newIdentNode("nkIdent")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("start"),
newIdentNode("stopEx"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("body"),
newIdentNode("untyped"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkAsgn.newTree(
newIdentNode("result"),
nnkCall.newTree(
newIdentNode("newStmtList")
)
),
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newIdentNode("start"),
newIdentNode("stopEx")
),
nnkStmtList.newTree(
nnkCommand.newTree(
nnkDotExpr.newTree(
newIdentNode("result"),
newIdentNode("add")
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("nnkBlockStmt"),
newIdentNode("newTree")
),
nnkCall.newTree(
newIdentNode("ident"),
nnkInfix.newTree(
newIdentNode("&"),
nnkInfix.newTree(
newIdentNode("&"),
newLit("unrolledIter_"),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("idx")
)
),
nnkPrefix.newTree(
newIdentNode("$"),
newIdentNode("i")
)
)
),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode("body"),
newIdentNode("replaceNodes")
),
newIdentNode("idx"),
nnkCommand.newTree(
newIdentNode("newLit"),
newIdentNode("i")
)
)
)
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Curve"),
newEmptyNode(),
nnkEnumTy.newTree(
newEmptyNode(),
newIdentNode("BLS12_381")
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("WordBitWidth")
),
newEmptyNode(),
nnkInfix.newTree(
newIdentNode("*"),
nnkCall.newTree(
newIdentNode("sizeof"),
newIdentNode("uint64")
),
newLit(8)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("wordsRequired")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("bits"),
newIdentNode("int"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("inline")
),
newEmptyNode(),
nnkStmtList.newTree(
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("divShiftor"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("fastLog2"),
newIdentNode("WordBitWidth")
)
)
),
nnkAsgn.newTree(
newIdentNode("result"),
nnkInfix.newTree(
newIdentNode("shr"),
nnkPar.newTree(
nnkInfix.newTree(
newIdentNode("-"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("bits"),
newIdentNode("WordBitWidth")
),
newLit(1)
)
),
newIdentNode("divShiftor")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("BigInt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("bits"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("limbs")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
nnkDotExpr.newTree(
newIdentNode("bits"),
newIdentNode("wordsRequired")
),
newIdentNode("uint64")
),
newEmptyNode()
)
)
)
)
),
nnkConstSection.newTree(
nnkConstDef.newTree(
newIdentNode("CurveBitWidth"),
newEmptyNode(),
nnkBracket.newTree(
nnkExprColonExpr.newTree(
newIdentNode("BLS12_381"),
newLit(381)
)
)
)
),
nnkTemplateDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("matchingBigInt")
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("untyped"),
nnkIdentDefs.newTree(
newIdentNode("Name"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("BigInt type necessary to store the prime field Fp"),
nnkBracketExpr.newTree(
newIdentNode("BigInt"),
nnkBracketExpr.newTree(
newIdentNode("CurveBitWidth"),
newIdentNode("Name")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Fp"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("residue"),
nnkCall.newTree(
newIdentNode("matchingBigInt"),
newIdentNode("C")
),
newEmptyNode()
)
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("CubicExt")
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("F"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
newIdentNode("coords")
),
nnkBracketExpr.newTree(
newIdentNode("array"),
newLit(3),
newIdentNode("F")
),
newEmptyNode()
)
)
)
),
nnkTypeDef.newTree(
newIdentNode("Fp3"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("CubicExt"),
nnkBracketExpr.newTree(
newIdentNode("Fp"),
newIdentNode("C")
)
)
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
nnkPragmaExpr.newTree(
newIdentNode("Fp3prj"),
nnkPragma.newTree(
nnkExprColonExpr.newTree(
newIdentNode("borrow"),
nnkAccQuoted.newTree(
newIdentNode(".")
)
)
)
),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("C"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("Curve")
),
newEmptyNode()
)
),
nnkDistinctTy.newTree(
nnkBracketExpr.newTree(
newIdentNode("Fp3"),
newIdentNode("C")
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkForStmt.newTree(
newIdentNode("i"),
nnkInfix.newTree(
newIdentNode("..<"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("limbs")
),
newIdentNode("i")
)
)
)
)
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("CubicExt")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("CubicExt"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newCommentStmtNode("Addition in the extension field"),
nnkCommand.newTree(
newIdentNode("staticFor"),
newIdentNode("i"),
newLit(0),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
),
nnkStmtList.newTree(
nnkInfix.newTree(
newIdentNode("+="),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("i")
),
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("b"),
newIdentNode("coords")
),
newIdentNode("i")
)
)
)
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkBracketExpr.newTree(
newIdentNode("Fp3prj"),
newIdentNode("BLS12_381")
),
newEmptyNode()
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newIdentNode("len")
)
),
nnkCommand.newTree(
newIdentNode("echo"),
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkDotExpr.newTree(
nnkBracketExpr.newTree(
nnkDotExpr.newTree(
newIdentNode("a"),
newIdentNode("coords")
),
newLit(0)
),
newIdentNode("residue")
),
newIdentNode("limbs")
),
newIdentNode("len")
)
),
nnkFuncDef.newTree(
nnkPostfix.newTree(
newIdentNode("*"),
nnkAccQuoted.newTree(
newIdentNode("+=")
)
),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
nnkVarTy.newTree(
newIdentNode("Fp3prj")
),
newEmptyNode()
),
nnkIdentDefs.newTree(
newIdentNode("b"),
newIdentNode("Fp3prj"),
newEmptyNode()
)
),
nnkPragma.newTree(
newIdentNode("borrow")
),
newEmptyNode(),
newEmptyNode()
)
) Stats
🤖 Bug found in |
It says |
Simplified (may be more issues in full test case) template matchingBigInt(Name: static int): untyped = int
type
Fp3[C: static int] = object
residue: matchingBigInt(C)
Fp3prj[C: static int] = distinct Fp3[C]
func `+=`(a: var Fp3, b: Fp3) = discard
func `+=`(a: var Fp3prj, b: Fp3prj) {.borrow.} |
@juancarlospaco before 1.6 generics didn't work at all with distinct borrows. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A similar starting point to #23784
The following confuses the type inference with the error
Line 700 of system.nim in 2.0.8 corresponds to
len
of arrayIt seems like the signature
func len*(x: (type array)|array): int
is buggy with distinct type indirection.The text was updated successfully, but these errors were encountered: