~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t/t-algorithms.py (HashBufferTestMixin): Assemble method names dynamically.
[catacomb-python]
/
t
/
t-ec.py
diff --git
a/t/t-ec.py
b/t/t-ec.py
index
f11da7d
..
b85105d
100644
(file)
--- a/
t/t-ec.py
+++ b/
t/t-ec.py
@@
-93,7
+93,9
@@
class TestCurvelessPoints (U.TestCase):
me.assertRaises(ValueError, C.ECPt.frombuf, C.bytes("0001fe000201"))
## String conversion and parsing.
me.assertRaises(ValueError, C.ECPt.frombuf, C.bytes("0001fe000201"))
## String conversion and parsing.
+ me.assertEqual(str(P), "(254, 291)")
me.assertEqual(C.ECPt.parse("254, 291)"), (P, ")"))
me.assertEqual(C.ECPt.parse("254, 291)"), (P, ")"))
+ me.assertEqual(C.ECPt.parse("(254, 291)"), (P, ""))
me.assertRaises(ValueError, C.ECPt.parse, "(254, 291")
###--------------------------------------------------------------------------
me.assertRaises(ValueError, C.ECPt.parse, "(254, 291")
###--------------------------------------------------------------------------
@@
-240,6
+242,7
@@
class TestCurves (T.GenericTestMixin):
## Simultaneous multiplication.
Q, R, S = 5*P, 7*P, 11*P
## Simultaneous multiplication.
Q, R, S = 5*P, 7*P, 11*P
+ me.assertEqual(E.mmul(set([(Q, 9), (R, 8), (S, 5)])), 156*P)
me.assertEqual(E.mmul([Q, 9, R, 8, S, 5]), 156*P)
me.assertEqual(E.mmul(Q, 9, R, 8, S, 5), 156*P)
me.assertEqual(E.mmul([Q, 9, R, 8, S, 5]), 156*P)
me.assertEqual(E.mmul(Q, 9, R, 8, S, 5), 156*P)
@@
-249,7
+252,7
@@
class TestCurves (T.GenericTestMixin):
def test_tinycurves(me):
me._test_curve(C.ECInfo(E, 2*P, 13, 2), checkfail = True)
def test_tinycurves(me):
me._test_curve(C.ECInfo(E, 2*P, 13, 2), checkfail = True)
- ei
, _ = C.ECInfo.parse
("binpoly: 0x13; bin: 0x01, 0x08; 0x02, 0x0c: 5*4")
+ ei
= C.ECInfo.fromstring
("binpoly: 0x13; bin: 0x01, 0x08; 0x02, 0x0c: 5*4")
me._test_curve(ei, checkfail = True)
TestCurves.generate_testcases((name, C.eccurves[name]) for name in
me._test_curve(ei, checkfail = True)
TestCurves.generate_testcases((name, C.eccurves[name]) for name in