Closed MartKro closed 5 years ago
This behaviour is intentional.
Boolean shares are intended to grow up to m_nmaxbitlen
for which a default of 32 bits was chosen. This value can be manually changed by the devloper if other values are desired using set_max_bitlength()
.
If you want to add the max. bitlen as parameter to the constructor, feel free to add a constructor that also takes this value as parameter.
Let's look into the code
Unlike the expected addition AA + AA = 54 the result is 154; that means the function calculates the carry bit even though the the bitlength of the shares is 8 bit. However, if the bitlengh is defined as 32 bit, such a carry does not occur.
I looked into the share class, which has a member t m_nmaxbitlen and it seems that the value is always initalized to 32 unless somebody calls the set_max_bitlength method.
At the constructor there is also sharelen or a gate given. Why is the sharelen or the size of the gates not given to the init function. Is there a reason for that behavior?