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

Fix typos in ALU.cpp and add missing opcodes #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jimouris
Copy link

@jimouris jimouris commented Dec 6, 2018

As stated in #15 UMOD seems to be broken.

There has been a typo in ALU.cpp and it was

components_[Opcode::UMOD] = ALU_UDIV_Gadget::create(pb_, inputVariables_, resultVariables_);

instead of

components_[Opcode::UMOD] = ALU_UMOD_Gadget::create(pb_, inputVariables_, resultVariables_);

That was probably a problem with UMOD, however it still seems to be broken.

@iddo333
Copy link
Collaborator

iddo333 commented Dec 6, 2018

There seems to be another typo in ALU.cpp: enforceBooleanity(witnessRemainder_[i], Opcode::UMOD) in ALU_UDIV_Gadget::generateConstraints()

I think that the unit test of UMOD should pass just fine, but yes it will still be broken when used in a TinyRAM program because it's absent from the switch statements of tinyram/stark-tinyram/src/TinyRAMtoBair/RamToContraintSystem/traceConsistency.cpp (it's easy to add the missing opcodes there, and then create a TinyRAM program to test it).

@jimouris jimouris changed the title Fix typo in ALU.cpp Fix typos in ALU.cpp and add missing opcodes Dec 7, 2018
@jimouris
Copy link
Author

jimouris commented Dec 7, 2018

Thanks @iddo333 , I have changed the second UMOD typo and added the missing opcodes (UDIV and others were also missing). Seems ok now.

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.

2 participants