non linearity
This commit is contained in:
1 parent
84fda8757c
commit
c0e275c734
3 files changed
+31
-1
No files matched your search
@@ -0,0 +1,13 @@
|
||||
from walsh.walsh import nonlinearity
|
||||
|
||||
|
||||
def test_nonlinearity_linear_function():
|
||||
assert nonlinearity("x1 XOR x2") == 0
|
||||
|
||||
|
||||
def test_nonlinearity_or():
|
||||
assert nonlinearity("x1 OR x2") == 1
|
||||
|
||||
|
||||
def test_nonlinearity_majority():
|
||||
assert nonlinearity("x1*x2 XOR x1*x3 XOR x2*x3") == 2
|
||||
Reference in new issue
Block a user