summaryrefslogtreecommitdiff
path: root/tests/test_ec_curves.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2015-11-19 14:42:15 +0100
committerMatěj Cepl <mcepl@cepl.eu>2015-11-19 14:42:15 +0100
commitef45a18ebcb2d1d1f53410defff8b0713aad6598 (patch)
tree1d47f83bb24f65f59dceafc25a80f149ad0ccdbe /tests/test_ec_curves.py
parent18d9ffea4222dadf2fa61171ec8fdc19f94a1880 (diff)
downloadm2crypto-ef45a18ebcb2d1d1f53410defff8b0713aad6598.tar.gz
Strip trailinig spaces and expand tabs.
Just run $ find . -name \*.py -exec sed -r -i -e "s/\t/ /g" '{}' \; $ find . -name \*.py -exec sed -r -i -e "s/[ ]+$//" '{}' \;
Diffstat (limited to 'tests/test_ec_curves.py')
-rw-r--r--tests/test_ec_curves.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/test_ec_curves.py b/tests/test_ec_curves.py
index 29022f8..b0b3f41 100644
--- a/tests/test_ec_curves.py
+++ b/tests/test_ec_curves.py
@@ -2,20 +2,20 @@
# XXX memory leaks
"""
Unit tests for M2Crypto.EC, the curves
-
+
There are several ways one could unittest elliptical curves
- but we are going to only validate that we are using the
+ but we are going to only validate that we are using the
OpenSSL curve and that it works with ECDSA. We will assume
- OpenSSL has validated the curves themselves.
-
- Also, some curves are shorter than a SHA-1 digest of 160
+ OpenSSL has validated the curves themselves.
+
+ Also, some curves are shorter than a SHA-1 digest of 160
bits. To keep the testing simple, we will take advantage
- of ECDSA's ability to sign any digest length and create a
+ of ECDSA's ability to sign any digest length and create a
digset string of only 48 bits. Remember we are testing our
ability to access the curve, not ECDSA itself.
-
+
Copyright (c) 2006 Larry Bugbee. All rights reserved.
-
+
"""
#import sha
@@ -42,7 +42,7 @@ curves = [
('secp256k1', 256),
('secp384r1', 384),
('secp521r1', 521),
-
+
('sect113r1', 113),
('sect113r2', 113),
('sect131r1', 131),
@@ -61,7 +61,7 @@ curves = [
('sect409r1', 409),
('sect571k1', 571),
('sect571r1', 571),
-
+
('X9_62_prime192v1', 192),
('X9_62_prime192v2', 192),
('X9_62_prime192v3', 192),
@@ -69,7 +69,7 @@ curves = [
('X9_62_prime239v2', 239),
('X9_62_prime239v3', 239),
('X9_62_prime256v1', 256),
-
+
('X9_62_c2pnb163v1', 163),
('X9_62_c2pnb163v2', 163),
('X9_62_c2pnb163v3', 163),
@@ -86,7 +86,7 @@ curves = [
('X9_62_c2tnb359v1', 359),
('X9_62_c2pnb368w1', 368),
('X9_62_c2tnb431r1', 431),
-
+
('wap_wsg_idm_ecid_wtls1', 113),
('wap_wsg_idm_ecid_wtls3', 163),
('wap_wsg_idm_ecid_wtls4', 113),
@@ -100,11 +100,11 @@ curves = [
('wap_wsg_idm_ecid_wtls12', 224),
]
-# The following two curves, according to OpenSSL, have a
-# "Questionable extension field!" and are not supported by
+# The following two curves, according to OpenSSL, have a
+# "Questionable extension field!" and are not supported by
# the OpenSSL inverse function. ECError: no inverse.
-# As such they cannot be used for signing. They might,
-# however, be usable for encryption but that has not
+# As such they cannot be used for signing. They might,
+# however, be usable for encryption but that has not
# been tested. Until thir usefulness can be established,
# they are not supported at this time.
#curves2 = [
@@ -114,8 +114,8 @@ curves = [
class ECCurveTests(unittest.TestCase):
#data = sha.sha('Kilroy was here!').digest() # 160 bits
- data = "digest" # keep short (48 bits) so lesser curves
- # will work... ECDSA requires curve be
+ data = "digest" # keep short (48 bits) so lesser curves
+ # will work... ECDSA requires curve be
# equal or longer than digest
def genkey(self, curveName, curveLen):
@@ -127,11 +127,11 @@ class ECCurveTests(unittest.TestCase):
'check_key() failure for "%s"' % curveName)
return ec
-# def check_ec_curves_genkey(self):
+# def check_ec_curves_genkey(self):
# for curveName, curveLen in curves2:
# self.genkey(curveName, curveLen)
#
-# self.assertRaises(AttributeError, self.genkey,
+# self.assertRaises(AttributeError, self.genkey,
# 'nosuchcurve', 1)
def sign_verify_ecdsa(self, curveName, curveLen):
@@ -158,6 +158,6 @@ def suite():
if __name__ == '__main__':
- Rand.load_file('randpool.dat', -1)
+ Rand.load_file('randpool.dat', -1)
unittest.TextTestRunner().run(suite())
Rand.save_file('randpool.dat')