def test_generate_g2_key_with_seed(self): seed = 'just a seed' key_pair = BlsKeyPair.generate_g2(seed) self.assertIsNotNone(key_pair, "Key pair should not be None") self.assertIsNotNone(key_pair.public_key, "Key pair should have public key") self.assertIsNotNone(key_pair.secret_key, "Key pair should have secret key") self.assertTrue(key_pair.is_g2, "Key should be G2 key") self.assertFalse(key_pair.is_g1, "Key should NOT be G1 key") self.assertEqual(BlsKeyPair.secret_key_size(), len(key_pair.secret_key)) self.assertEqual(BlsKeyPair.public_g2_key_size(), len(key_pair.public_key))
def test_get_public_g2_key_size(self): self.assertEqual(BlsKeyPair.public_g2_key_size(), 96, "G2 key should be of length 96")