mirror of
https://github.com/romanz/amodem.git
synced 2026-04-20 04:56:25 +08:00
gpg: add test for ECDH pubkey generation
This commit is contained in:
@@ -76,6 +76,14 @@ def test_nist256p1():
|
|||||||
assert repr(pk) == 'GPG public key nist256p1/F82361D9'
|
assert repr(pk) == 'GPG public key nist256p1/F82361D9'
|
||||||
|
|
||||||
|
|
||||||
|
def test_nist256p1_ecdh():
|
||||||
|
sk = ecdsa.SigningKey.from_secret_exponent(secexp=1, curve=ecdsa.NIST256p)
|
||||||
|
vk = sk.get_verifying_key()
|
||||||
|
pk = proto.PublicKey(curve_name=formats.CURVE_NIST256,
|
||||||
|
created=42, verifying_key=vk, ecdh=True)
|
||||||
|
assert repr(pk) == 'GPG public key nist256p1/5811DF46'
|
||||||
|
|
||||||
|
|
||||||
def test_ed25519():
|
def test_ed25519():
|
||||||
sk = ed25519.SigningKey(b'\x00' * 32)
|
sk = ed25519.SigningKey(b'\x00' * 32)
|
||||||
vk = sk.get_verifying_key()
|
vk = sk.get_verifying_key()
|
||||||
|
|||||||
Reference in New Issue
Block a user