Commit 16f5c2cf8775b8257fd531ce60f44d39a1999641

  • avatar
  • root <root @geremy-…ktop.(none)>
  • Mon Jan 25 22:59:40 CET 2010
BUGFIX: fixed an annoyance in the makefile that committed unwanted
changes, fixed the comparison operators for elements, and fixed
the tests to reflect that. PyPBC is now x86_64 clean.
Makefile
(1 / 0)
  
2626
2727commit:
2828 $(MAKE) $(TEST)
29 rm *~ 2> /dev/null
2930 git add .
3031 git commit
3132 git push origin master
pypbc.c
(0 / 1)
  
10111011
10121012 // cast b to element
10131013 Element *e2 = (Element*)b;
1014
10151014 // perform the comparison
10161015 if(!element_cmp(e1->pbc_element, e2->pbc_element)) {
10171016 return Py_True;
test.py
(3 / 3)
  
172172 def test_cmp(self):
173173 self.e1 = Element.random(self.pairing, G1)
174174 self.e2 = Element.random(self.pairing, G1)
175 self.failIfEqual(self.e1, self.e2)
175 self.failUnlessEqual(self.e1 == self.e2, False)
176176 self.e3 = Element(self.pairing, Zr, value=36)
177177 self.e4 = Element(self.pairing, Zr, value=36)
178178 self.failUnlessEqual(self.e3, self.e4)
250250 temp1 = pairing.apply(signature, g)
251251
252252 # compare
253 self.failUnlessEqual(temp1, temp2)
253 self.failUnlessEqual(temp1 == temp2, True)
254254
255255 # compare to random signature
256256 rnd = Element.random(pairing, G1)
257257 temp1 = pairing.apply(rnd, g)
258258
259259 # compare
260 self.failIfEqual(temp1, temp2)
260 self.failUnlessEqual(temp1 == temp2, False)
261261
262262 def test_auth(self):
263263 # taken from paul miller's PBC::Crypt module tutorial