Describe the bug
When having a property
'not_A = !A'
and A is a PUBLIC the resulting not_A is always equal to NC-1
To Reproduce
import numpy as np
import scalib.attacks
nc = 2
fg = scalib.attacks.FactorGraph(f'''
NC {nc}
PUB SINGLE A
VAR SINGLE NOT_A
PROPERTY NOT_A = !A
''')
A = 1
bp = scalib.attacks.BPState(fg,1,public_values={'A':A})
bp.bp_acyclic('NOT_A')
result = bp.get_distribution('NOT_A')
print(result)
assert(np.argmax(result) == ~A)
Observed behavior
[0. 1.]
and AssertionError as the result is wrong
Expected behavior
[1. 0.] is the correct negation of 1 if Pbulics are respected
Environment (please complete the following information):
OS: GNU/Linux 11 (bullseye)
Python version: 3.8
numpy version: 1.23.5
SCALib version: 0.5.7.dev18+g5305549
How did you install SCALib? build from Xource
What CPU do you use? 2x Intel(R) Xeon(R) Gold 5317
Describe the bug When having a property 'not_A = !A' and A is a PUBLIC the resulting not_A is always equal to NC-1
To Reproduce
Observed behavior
and AssertionError as the result is wrong
Expected behavior [1. 0.] is the correct negation of 1 if Pbulics are respected
Environment (please complete the following information):
Additional context Applys for any choice of NC