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

“AND” stand for what “&”or “&&” in Substitution.cpp #153

Open
ChenforCode opened this issue Jul 15, 2020 · 0 comments
Open

“AND” stand for what “&”or “&&” in Substitution.cpp #153

ChenforCode opened this issue Jul 15, 2020 · 0 comments

Comments

@ChenforCode
Copy link

ChenforCode commented Jul 15, 2020

In Substitution.cpp have a code block like this:

case Instruction::And: (this->* funcAnd[llvm::cryptoutils->get_range(2)])(cast<BinaryOperator>(inst)); ++And; break; case Instruction::Or: (this->* funcOr[llvm::cryptoutils->get_range(2)])(cast<BinaryOperator>(inst)); ++Or; break;
We know that this is used to handle the "and" instruction. I want to know whether the "and" here refers to the bitwise operator "&"or the logical operator "&&"。
// Implementation of a = b & c => a = (b^~c)& b void Substitution::andSubstitution(BinaryOperator *bo)
// Implementation of a = a && b <=> !(!a | !b) && (r | !r) void Substitution::andSubstitutionRand(BinaryOperator *bo)
funcAnd[0] = &Substitution::andSubstitution; funcAnd[1] = &Substitution::andSubstitutionRand;
These two functions are "&"and "&&"processed separately. Why can you call them in "case AND"? Why don't you process "&"and&&"separately

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

No branches or pull requests

1 participant