Lines Matching refs:signature
100 // TestTamperedSig verifies that signature verification fails when a valid
101 // signature is tampered with. |ecdsa_sig| must be a valid signature, which will
106 // Modify a single byte of the signature: to ensure we don't
107 // garble the ASN1 structure, we read the raw signature and
136 // Sanity check: Undo the modification and verify signature.
213 // Create a signature.
215 std::vector<uint8_t> signature(sig_len);
216 if (!ECDSA_sign(0, digest, 20, signature.data(), &sig_len, eckey.get())) {
220 signature.resize(sig_len);
223 // Verify the signature.
224 if (!ECDSA_verify(0, digest, 20, signature.data(), signature.size(),
231 // Verify the signature with the wrong key.
232 if (ECDSA_verify(0, digest, 20, signature.data(), signature.size(),
239 // Verify the signature using the wrong digest.
240 if (ECDSA_verify(0, wrong_digest, 20, signature.data(), signature.size(),
247 // Verify a truncated signature.
248 if (ECDSA_verify(0, digest, 20, signature.data(), signature.size() - 1,
255 // Verify a tampered signature.
257 signature.data(), signature.size()));
268 // Create a signature.
276 // Verify the signature using the correct key.
283 // Verify the signature with the wrong key.
290 // Verify the signature using the wrong digest.
297 // Verify a tampered signature.