mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
fix(manp): Use the active bits to square a the constant in the 2-norm computation to allow more program to be analyzed
This commit is contained in:
@@ -170,9 +170,9 @@ static llvm::APInt APIntWidthExtendUnsignedSq(const llvm::APInt &i) {
|
||||
static llvm::APInt APIntWidthExtendSqForConstant(const llvm::APInt &i) {
|
||||
// Make sure the required number of bits can be represented by the
|
||||
// `unsigned` argument of `zext`.
|
||||
assert(i.getBitWidth() < 32 &&
|
||||
assert(i.getActiveBits() < 32 &&
|
||||
"Square of the constant cannot be represented on 64 bits");
|
||||
return llvm::APInt(2 * i.getBitWidth(),
|
||||
return llvm::APInt(2 * i.getActiveBits(),
|
||||
i.abs().getZExtValue() * i.abs().getZExtValue());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user