Lines Matching refs:msg
102 pub fn sign(&self, msg: &[u8]) -> Vec<u8> { in sign()
104 self.sign_with_context(msg, &[]) in sign()
111 pub fn sign_with_context(&self, msg: &[u8], context: &[u8]) -> Option<Vec<u8>> { in sign_with_context()
120 msg.as_ffi_ptr(), in sign_with_context()
121 msg.len(), in sign_with_context()
150 pub fn verify(&self, msg: &[u8], signature: &[u8]) -> Result<(), InvalidSignatureError> { in verify()
151 self.verify_with_context(msg, signature, &[]) in verify()
157 msg: &[u8], in verify_with_context()
167 msg.as_ffi_ptr(), in verify_with_context()
168 msg.len(), in verify_with_context()
202 let msg = b"test message"; in test_key_generation_and_signature()
203 let sig = private_key.sign(msg); in test_key_generation_and_signature()
205 assert!(public_key.verify(msg, &sig).is_ok()); in test_key_generation_and_signature()
209 assert!(public_key.verify(msg, &invalid_sig).is_err()); in test_key_generation_and_signature()
215 let msg = b"test message"; in test_sign_and_verify_with_context()
218 let sig = private_key.sign_with_context(msg, context).unwrap(); in test_sign_and_verify_with_context()
219 assert!(public_key.verify_with_context(msg, &sig, context).is_ok()); in test_sign_and_verify_with_context()
221 .verify_with_context(msg, &sig, b"wrong context") in test_sign_and_verify_with_context()
236 let msg = b""; in test_empty_message_and_context()
239 let sig = private_key.sign_with_context(msg, context).unwrap(); in test_empty_message_and_context()
240 assert!(public_key.verify_with_context(msg, &sig, context).is_ok()); in test_empty_message_and_context()
246 let msg = b"test message"; in test_max_context_length()
249 let sig = private_key.sign_with_context(msg, &context).unwrap(); in test_max_context_length()
250 assert!(public_key.verify_with_context(msg, &sig, &context).is_ok()); in test_max_context_length()
254 .sign_with_context(msg, &too_long_context) in test_max_context_length()