diff --git a/Cargo.toml b/Cargo.toml index 15cc596..083e3c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosey" -version = "0.2.0" +version = "0.3.0" authors = ["Nicolas Stalder "] license = "Apache-2.0 OR MIT" description = "Data types and serde for public COSE_Keys" @@ -11,7 +11,7 @@ readme = "README.md" edition = "2018" [dependencies] -heapless-bytes = "0.2.0" +heapless-bytes = "0.3.0" serde_repr = "0.1" [dependencies.serde] diff --git a/src/lib.rs b/src/lib.rs index c0ba6be..4707caf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,7 +43,7 @@ } */ -pub use heapless_bytes::{consts, Bytes as ByteBuf}; +pub use heapless_bytes::Bytes; use serde::Serialize; use serde_repr::{Deserialize_repr, Serialize_repr}; @@ -142,8 +142,8 @@ trait PublicKeyConstants { #[derive(Clone, Debug, Eq, PartialEq)] pub struct P256PublicKey { - pub x: ByteBuf, - pub y: ByteBuf, + pub x: Bytes<32>, + pub y: Bytes<32>, } impl PublicKeyConstants for P256PublicKey { @@ -154,8 +154,8 @@ impl PublicKeyConstants for P256PublicKey { #[derive(Clone, Debug, Eq, PartialEq)] pub struct EcdhEsHkdf256PublicKey { - pub x: ByteBuf, - pub y: ByteBuf, + pub x: Bytes<32>, + pub y: Bytes<32>, } impl PublicKeyConstants for EcdhEsHkdf256PublicKey { @@ -166,7 +166,7 @@ impl PublicKeyConstants for EcdhEsHkdf256PublicKey { #[derive(Clone, Debug, Eq, PartialEq)] pub struct Ed25519PublicKey { - pub x: ByteBuf, + pub x: Bytes<32>, } impl PublicKeyConstants for Ed25519PublicKey { @@ -186,7 +186,7 @@ impl PublicKeyConstants for TotpPublicKey { #[derive(Clone, Debug, Eq, PartialEq)] pub struct X25519PublicKey { - pub pub_key: ByteBuf, + pub pub_key: Bytes<32>, } // impl serde::Serialize for PublicKey {