Public Key plain byte encoding (#540)

* public key is encoded in bytes

* ECDSA pubkey in uncompressed format
This commit is contained in:
kaczmarczyck
2022-08-31 15:51:40 +02:00
committed by GitHub
parent 598c21071e
commit 1b360662ee
6 changed files with 18 additions and 50 deletions

View File

@@ -231,13 +231,12 @@ impl PubKey {
.map(|p| PubKey { p })
}
#[cfg(feature = "std")]
pub fn from_bytes_uncompressed(bytes: &[u8]) -> Option<PubKey> {
PointP256::from_bytes_uncompressed_vartime(bytes).map(|p| PubKey { p })
}
#[cfg(test)]
fn to_bytes_uncompressed(&self, bytes: &mut [u8; 65]) {
#[cfg(feature = "std")]
pub fn to_bytes_uncompressed(&self, bytes: &mut [u8; 65]) {
self.p.to_bytes_uncompressed(bytes);
}