Skip to content
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

ZIR-182: Jacob/add examples #42

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jacobdweightman
Copy link
Contributor

Adding two examples to the repository:

  1. The binary adder used for the Zirgen talk at zkSummit 12
  2. A basic implementation of addition and multiplication for matrices over the native field

@github-actions github-actions bot changed the title Jacob/add examples ZIR-182: Jacob/add examples Oct 2, 2024
@@ -37,6 +37,8 @@ std::string mangledTypeName(StringRef componentName, llvm::ArrayRef<Attribute> t
llvm::interleaveComma(typeArgs, stream, [&](Attribute typeArg) {
if (auto strAttr = typeArg.dyn_cast<StringAttr>()) {
stream << strAttr.getValue();
} else if (auto intAttr = typeArg.dyn_cast<IntegerAttr>()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances are we generating an IntegerAttr? Aren't we coercing everything into field elements?

}

component FullAdder(x: BitReg, y: BitReg, c: BitReg) {
sum := Xor(Xor(x, y), c);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like either this line should use Xor3 defined above, or the otherwise-unused Xor3 component ought to be dropped from the example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants