new CoseKey data format

This commit is contained in:
Fabian Kaczmarczyck
2021-01-12 15:11:20 +01:00
parent 688d11c6b6
commit 2776bd9b8e
6 changed files with 196 additions and 99 deletions

View File

@@ -85,7 +85,7 @@ impl PubKey {
self.p.to_bytes_uncompressed(bytes);
}
/// Creates a new PubKey from their coordinates.
/// Creates a new PubKey from its coordinates on the elliptic curve.
pub fn from_coordinates(x: &[u8; NBYTES], y: &[u8; NBYTES]) -> Option<PubKey> {
PointP256::new_checked_vartime(Int256::from_bin(x), Int256::from_bin(y))
.map(|p| PubKey { p })

View File

@@ -220,7 +220,6 @@ impl Signature {
}
impl PubKey {
pub const ES256_ALGORITHM: i64 = -7;
#[cfg(feature = "with_ctap1")]
const UNCOMPRESSED_LENGTH: usize = 1 + 2 * int256::NBYTES;