non linearity
This commit is contained in:
@@ -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