removed some unnecessary code; this should bring current test coverage up to 100%
This commit is contained in:
@@ -80,8 +80,6 @@ class EllipticCurveOID(Enum):
|
||||
if self.curve is not None:
|
||||
return self.curve.key_size
|
||||
|
||||
return None
|
||||
|
||||
@property
|
||||
def kdf_halg(self):
|
||||
# return the hash algorithm to specify in the KDF fields when generating a key
|
||||
|
||||
@@ -1319,18 +1319,8 @@ class ECDHPriv(ECDSAPriv, ECDHPub):
|
||||
|
||||
def _generate(self, oid):
|
||||
ECDSAPriv._generate(self, oid)
|
||||
# set the KDF hash and symmetric encryption algorithms
|
||||
|
||||
_halgs = {EllipticCurveOID.NIST_P256: HashAlgorithm.SHA256,
|
||||
EllipticCurveOID.NIST_P384: HashAlgorithm.SHA384,
|
||||
EllipticCurveOID.NIST_P521: HashAlgorithm.SHA512}
|
||||
|
||||
_kalgs = {EllipticCurveOID.NIST_P256: SymmetricKeyAlgorithm.AES128,
|
||||
EllipticCurveOID.NIST_P384: SymmetricKeyAlgorithm.AES192,
|
||||
EllipticCurveOID.NIST_P521: SymmetricKeyAlgorithm.AES256}
|
||||
|
||||
self.kdf.halg = _halgs[self.oid]
|
||||
self.kdf.encalg = _kalgs[self.oid]
|
||||
self.kdf.halg = self.oid.kdf_halg
|
||||
self.kdf.encalg = self.oid.kek_alg
|
||||
|
||||
def publen(self):
|
||||
return ECDHPub.__len__(self)
|
||||
|
||||
Reference in New Issue
Block a user