mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-12 14:09:25 +00:00
Explicitly ban the identity point as an Ethereum Schnorr public key (002)
This doesn't have a well-defined affine representation. k256's behavior, mapping it to (0, 0), means this would've been rejected anyways (so this isn't a change of any current behavior), but it's best not to rely on such an implementation detail.
This commit is contained in:
@@ -27,6 +27,11 @@ pub(crate) fn test_key() -> (Scalar, PublicKey) {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_identity_key() {
|
||||
assert!(PublicKey::new(ProjectivePoint::IDENTITY).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_odd_key() {
|
||||
// We generate a valid key to ensure there's not some distinct reason this key is invalid
|
||||
|
||||
Reference in New Issue
Block a user