Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ license = "Apache-2.0"

[workspace.dependencies]
akd = { version = "0.11", default-features = false }
bincode = "2.0.0-rc.3"
bincode = "2"
anyhow = "1.0"
clap = { version = "4.5", features = ["derive"] }
clap-verbosity-flag = "2.2.0"
Expand Down
15 changes: 9 additions & 6 deletions plexi_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ impl Encode for Ciphersuite {
}

#[cfg(feature = "bincode")]
impl Decode for Ciphersuite {
fn decode<D: bincode::de::Decoder>(
impl<Context> Decode<Context> for Ciphersuite {
fn decode<D: bincode::de::Decoder<Context = Context>>(
decoder: &mut D,
) -> Result<Self, bincode::error::DecodeError> {
let value: u32 = bincode::Decode::decode(decoder)?;
Expand All @@ -115,8 +115,8 @@ impl Decode for Ciphersuite {
}

#[cfg(feature = "bincode")]
impl<'de> BorrowDecode<'de> for Ciphersuite {
fn borrow_decode<B: bincode::de::BorrowDecoder<'de>>(
impl<'de, Context> BorrowDecode<'de, Context> for Ciphersuite {
fn borrow_decode<B: bincode::de::BorrowDecoder<'de, Context = Context>>(
buffer: &mut B,
) -> Result<Self, bincode::error::DecodeError> {
let value = u32::borrow_decode(buffer)?;
Expand Down Expand Up @@ -485,8 +485,11 @@ impl SignatureResponse {
pub fn verify(&self, verifying_key: &[u8]) -> anyhow::Result<()> {
// at the time of writing, all versions use ed25519 keys. This simplifies parsing of the verifying key.
match self.version {
#[cfg(feature = "bincode")]
Ciphersuite::BincodeEd25519 => (),
Ciphersuite::BincodeEd25519 => {
if !cfg!(feature = "bincode") {
return Err(anyhow!("Verification is not supported for bincode."));
}
}
Ciphersuite::ProtobufEd25519 => (),
Ciphersuite::Unknown(_) => {
return Err(anyhow!(
Expand Down
Loading