changeset 220:01a6d95bf029

secret_ifs: use the new ranges
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 23 Dec 2009 14:34:38 +0100
parents 1683fdd52828
children 1727a6ce0442
files pysmcl/secret_ifs.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/secret_ifs.py	Wed Dec 23 14:34:07 2009 +0100
+++ b/pysmcl/secret_ifs.py	Wed Dec 23 14:34:38 2009 +0100
@@ -8,7 +8,7 @@
 import pysmcl.ast_wrapper as ast
 import pysmcl.secret_annotator
 import pysmcl.setup
-from pysmcl.range_analysis import RangeVisitor, interval_within
+from pysmcl.range_analysis import RangeVisitor
 
 from pysmcl.util import error
 
@@ -106,7 +106,7 @@
         self.generic_visit(node)
         if(pysmcl.secret_annotator.expr_secret(node.test)):
             range_visitor = RangeVisitor(pysmcl.setup.Zp.modulus, node.in_values["range"])
-            if not interval_within(range_visitor.visit(node.test), (0,1)):
+            if not range_visitor.visit(node.test).within(0,1):
                 error("The condition cannot be proven to be in the range (0, 1)", node.test)
             self.changed = True
             replacement = []