Exemplo n.º 1
0
 def test_secret_expand_ed448(self):
     curve = CurveDB().instantiate(name="ed448")
     (scalar, Q) = curve.expand_secret(
         bytes.fromhex(
             "6c82a562cb808d10d632be89c8513ebf6c929f34ddfa8c9f63c9960ef6e348a3528c8a3fcc2f044e39a3fc5b94492f8f032e7549a20098f95b"
         ))
     self.assertEqual(
         scalar,
         521658399617511624509929819094270498323007786671637499019582168374758478770958028340603419308639592898868374490003595203618871291427304
     )
     self.assertEqual(
         Q.encode(),
         bytes.fromhex(
             "5fd7449b59b461fd2ce787ec616ad46a1da1342485a70e1f8a0ea75d80e96778edf124769b46c7061bd6783df1e50f6cd1fa1abeafe8256180"
         ))
Exemplo n.º 2
0
 def test_secret_expand_ed25519(self):
     curve = CurveDB().instantiate(name="ed25519")
     (scalar, Q) = curve.expand_secret(
         bytes.fromhex(
             "9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60"
         ))
     self.assertEqual(
         scalar,
         36144925721603087658594284515452164870581325872720374094707712194495455132720
     )
     self.assertEqual(
         Q.encode(),
         bytes.fromhex(
             "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a"
         ))