(&self, bytes: &[u8])
| 42 | } |
| 43 | |
| 44 | pub fn sign(&self, bytes: &[u8]) -> Signature { |
| 45 | let mut signature = Signature::default(); |
| 46 | let ret = unsafe { |
| 47 | crypto_sign_detached( |
| 48 | signature.0.as_mut_ptr(), |
| 49 | ptr::null_mut(), |
| 50 | bytes.as_ptr(), |
| 51 | bytes.len() as _, |
| 52 | self.as_bytes().as_ptr(), |
| 53 | ) |
| 54 | }; |
| 55 | assert_eq!(ret, 0); |
| 56 | signature |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | #[derive(Debug, Serialize, Deserialize, Default, Clone)] |