Skip to content

Commit

Permalink
Make MBAObfuscation faster by caching used coefficients
Browse files Browse the repository at this point in the history
  • Loading branch information
bluesadi committed Dec 25, 2023
1 parent e35772d commit 5e1fbef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions llvm/lib/Transforms/Obfuscation/MBAUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ int64_t *MBAUtils::generateLinearMBA(int numExprs) {
static std::queue<int64_t *> cached_coeffs;
if (cached_coeffs.size() && cryptoutils->get_range(10) < 8) {
int64_t *coeffs = cached_coeffs.front();
outs() << "[DEBUG] Use cached coefficients:";
for (int i = 0; i < 15; i++) {
outs() << " " << coeffs[i];
}
outs() << "\n";
cached_coeffs.pop();
return coeffs;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test-json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cmake -B build \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_CXX_FLAGS="$CXX_FLAGS"
ninja -j`nproc` -C build
ninja test
ninja -C build test

0 comments on commit 5e1fbef

Please sign in to comment.