File tree 1 file changed +12
-3
lines changed 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,22 @@ use crate::{
11
11
verifier:: { DigestVerifier , Verifier } ,
12
12
} ;
13
13
14
- /// Trait impl'd by concrete types that represent digital signatures
14
+ /// Trait impl'd by concrete types that represent digital signatures.
15
+ ///
16
+ /// Signature types *must* (as mandated by the `AsRef<[u8]>` bound) be a thin
17
+ /// wrapper around the "bag-of-bytes" serialized form of a signature which can
18
+ /// be directly parsed from or written to the "wire".
19
+ ///
20
+ /// For signature systems which require a more advanced internal representation
21
+ /// (e.g. involving decoded scalars or decompressed elliptic curve points) it's
22
+ /// recommended that "provider" libraries maintain their own internal signature
23
+ /// type and use `From` bounds to provide automatic conversions.
15
24
pub trait Signature : AsRef < [ u8 ] > + Debug + Sized {
16
25
/// Parse a signature from its byte representation
17
26
fn from_bytes ( bytes : & [ u8 ] ) -> Result < Self , Error > ;
18
27
19
- /// Borrow this signature as serialized bytes
20
- fn as_slice ( & self ) -> & [ u8 ] {
28
+ /// Borrow a byte slice representing the serialized form of this signature
29
+ fn as_bytes ( & self ) -> & [ u8 ] {
21
30
self . as_ref ( )
22
31
}
23
32
}
You can’t perform that action at this time.
0 commit comments