reenable some features
This commit is contained in:
parent
9abc7519d4
commit
81d8d7bfcc
4 changed files with 11 additions and 10 deletions
|
@ -15,9 +15,8 @@ base64 = "0.13"
|
|||
hex = "0.4"
|
||||
err-derive = "0.3"
|
||||
|
||||
dryoc = { version = "0.4", optional = true }
|
||||
serde = { version = "1.0", optional = true, default-features = false, features = ["derive"] }
|
||||
dryoc = { version = "0.5", optional = true }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
|
||||
[features]
|
||||
#default = [ "dryoc", "serde" ]
|
||||
#default = [ "serde" ]
|
||||
default = [ "dryoc", "serde" ]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
pub mod decode;
|
||||
mod decode;
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
|
@ -6,9 +6,9 @@ use crate::is_string_char;
|
|||
|
||||
pub use decode::*;
|
||||
|
||||
pub const STR_INLINE_MAX: usize = 18;
|
||||
pub(crate) const STR_INLINE_MAX: usize = 18;
|
||||
|
||||
pub type Pos = u32;
|
||||
pub(crate) type Pos = u32;
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct ITerm(Pos);
|
||||
|
|
|
@ -38,8 +38,8 @@ pub fn compute_signature(message: &[u8], secret_key: &sign::SecretKey) -> sign::
|
|||
|
||||
/// Verify the ed25519 signature of a message using a public key
|
||||
pub fn verify_signature(
|
||||
signature: &sign::Signature,
|
||||
message: &[u8],
|
||||
signature: sign::Signature,
|
||||
message: Vec<u8>,
|
||||
public_key: &sign::PublicKey,
|
||||
) -> bool {
|
||||
sign::SignedMessage::from_parts(signature.clone(), message)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//! A text-based data format for cryptographic network protocols.
|
||||
//!
|
||||
//! ```
|
||||
//! #[cfg(feature = "dryoc")] {
|
||||
//! use nettext::enc::*;
|
||||
//! use nettext::dec::*;
|
||||
//! use nettext::crypto::*;
|
||||
|
@ -46,10 +47,11 @@
|
|||
//!
|
||||
//! let [verb, arg1, arg2, pubkey] = object2.seq_of().unwrap();
|
||||
//! let pubkey = pubkey.public_key().unwrap();
|
||||
//! assert!(verify_signature(&signature, payload.raw(), &pubkey));
|
||||
//! assert!(verify_signature(signature, payload.raw().to_vec(), &pubkey));
|
||||
//!
|
||||
//! assert_eq!(verb.string().unwrap(), "CALL");
|
||||
//! assert_eq!(arg1.string().unwrap(), "myfunction");
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! The value of `signed_payload` would be as follows:
|
||||
|
|
Loading…
Reference in a new issue