Home
last modified time | relevance | path

Searched refs:signature (Results 1 – 25 of 162) sorted by relevance

1234567

/packages/modules/Virtualization/compos/compos_key_helper/
Dcompos_key_test.cpp58 auto signature = sign(key_pair.private_key, data.data(), data.size()); in TEST_F() local
59 ASSERT_TRUE(signature.ok()) << signature.error(); in TEST_F()
61 bool verified = verify(key_pair.public_key, *signature, data.data(), data.size()); in TEST_F()
66 auto signature = sign(key_pair.private_key, data.data(), data.size()); in TEST_F() local
67 ASSERT_TRUE(signature.ok()) << signature.error(); in TEST_F()
69 (*signature)[0] ^= 1; in TEST_F()
71 bool verified = verify(key_pair.public_key, *signature, data.data(), data.size()); in TEST_F()
76 auto signature = sign(key_pair.private_key, data.data(), data.size()); in TEST_F() local
77 ASSERT_TRUE(signature.ok()) << signature.error(); in TEST_F()
82 bool verified = verify(key_pair.public_key, *signature, other_data.data(), other_data.size()); in TEST_F()
[all …]
Dcompos_key_main.cpp85 auto signature = in sign_input() local
88 if (!signature.ok()) { in sign_input()
89 LOG(ERROR) << signature.error(); in sign_input()
93 if (!WriteFully(STDOUT_FILENO, signature->data(), signature->size())) { in sign_input()
/packages/modules/Virtualization/libs/bssl/src/
Dec_key.rs150 pub fn ecdsa_verify_der(&self, signature: &[u8], digest: &[u8]) -> Result<()> { in ecdsa_verify_der()
161 signature.as_ptr(), in ecdsa_verify_der()
162 signature.len(), in ecdsa_verify_der()
173 pub fn ecdsa_verify_cose(&self, signature: &[u8], digest: &[u8]) -> Result<()> { in ecdsa_verify_cose()
174 let signature = ec_cose_signature_to_der(signature)?; in ecdsa_verify_cose() localVariable
175 self.ecdsa_verify_der(&signature, digest) in ecdsa_verify_cose()
185 let mut signature = vec![0u8; self.ecdsa_size()?]; in ecdsa_sign_der() localVariable
194 signature.as_mut_ptr(), in ecdsa_sign_der()
200 if signature.len() < (signature_len as usize) { in ecdsa_sign_der()
203 signature.truncate(signature_len as usize); in ecdsa_sign_der()
[all …]
/packages/modules/Virtualization/libs/bssl/tests/
Deckey_test.rs90 let signature = ec_key.ecdsa_sign_der(&digest)?; in ecdsa_p256_signing_and_verification_succeed() localVariable
91 ec_key.ecdsa_verify_der(&signature, &digest)?; in ecdsa_p256_signing_and_verification_succeed()
95 pkey.verify(&signature, MESSAGE1, Some(digester)) in ecdsa_p256_signing_and_verification_succeed()
105 let signature = ec_key.ecdsa_sign_der(&digest)?; in ecdsa_p384_signing_and_verification_succeed() localVariable
106 ec_key.ecdsa_verify_der(&signature, &digest)?; in ecdsa_p384_signing_and_verification_succeed()
108 pkey.verify(&signature, MESSAGE1, Some(digester)) in ecdsa_p384_signing_and_verification_succeed()
116 let signature = ec_key1.ecdsa_sign_der(&digest)?; in verifying_ecdsa_p256_signed_with_a_different_key_fails() localVariable
120 let err = ec_key2.ecdsa_verify_der(&signature, &digest).unwrap_err(); in verifying_ecdsa_p256_signed_with_a_different_key_fails()
125 let err = pkey.verify(&signature, MESSAGE1, Some(Digester::sha256())).unwrap_err(); in verifying_ecdsa_p256_signed_with_a_different_key_fails()
137 let signature = ec_key.ecdsa_sign_der(&digest1)?; in verifying_ecdsa_p256_signed_with_a_different_message_fails() localVariable
[all …]
/packages/modules/adb/fastdeploy/deployagent/src/com/android/fastdeploy/
DApkArchive.java49 final byte[] signature; field in ApkArchive.Dump
51 Dump(byte[] cd, byte[] signature) { in Dump() argument
53 this.signature = signature; in Dump()
84 byte[] signature = null; in extractMetadata()
87 signature = readMetadata(sigLoc); in extractMetadata()
88 long size = ByteBuffer.wrap(signature).order(ByteOrder.LITTLE_ENDIAN).getLong(); in extractMetadata()
91 signature = null; in extractMetadata()
95 return new Dump(cd, signature); in extractMetadata()
107 int signature = buffer.getInt(); // Read 4 bytes. in findEndOfCDRecord() local
108 if (signature == EOCD_SIGNATURE) { in findEndOfCDRecord()
[all …]
/packages/modules/adb/client/
Dincremental.cpp58 auto [signature, tree_size] = read_id_sig_headers(fd); in read_signature()
61 if (signature.empty()) { in read_signature()
67 if (signature.size() > kMaxSignatureSize) { in read_signature()
70 (long long)signature.size(), kMaxSignatureSize); in read_signature()
84 return {std::move(fd), std::move(signature)}; in read_signature()
93 auto [fd, signature] = read_signature(file_size, std::move(signature_file), silent); in read_and_encode_signature()
94 if (!fd.ok() || signature.empty()) { in read_and_encode_signature()
99 if (!EVP_EncodedLength(&base64_len, signature.size())) { in read_and_encode_signature()
108 (const uint8_t*)signature.data(), signature.size())); in read_and_encode_signature()
130 auto [signature_fd, signature] = read_and_encode_signature(st.st_size, file, silent); in start_install()
[all …]
/packages/modules/Wifi/service/java/com/android/server/wifi/
DRunnerHandler.java106 String signature = getSignature(new Throwable("RunnerHandler:").getStackTrace(), in sendMessageAtTime() local
108 bundle.putString(KEY_SIGNATURE, signature); in sendMessageAtTime()
116 final String signature = bundle.getString(KEY_SIGNATURE); in dispatchMessage() local
117 if (signature != null) { in dispatchMessage()
118 Trace.traceBegin(Trace.TRACE_TAG_NETWORK, signature); in dispatchMessage()
125 if (signature != null) { in dispatchMessage()
129 final String signatureToLog = signature != null ? signature : "unknown"; in dispatchMessage()
154 String signature = getSignature(new Throwable("RunnerHandler:").getStackTrace(), in postToFront() local
157 bundle.putString(KEY_SIGNATURE, signature); in postToFront()
/packages/modules/Virtualization/service_vm/client_vm_csr/src/
Dlib.rs127 fn ecdsa_sig_to_cose(signature: &EcdsaSig) -> Result<Vec<u8>> { in ecdsa_sig_to_cose()
128 let mut result = signature.r().to_vec_padded(ATTESTATION_KEY_AFFINE_COORDINATE_SIZE)?; in ecdsa_sig_to_cose()
129 result.extend_from_slice(&signature.s().to_vec_padded(ATTESTATION_KEY_AFFINE_COORDINATE_SIZE)?); in ecdsa_sig_to_cose()
187 .verify_signature(0, aad, |signature, message| public_key.verify(signature, message)) in csr_and_private_key_have_correct_format()
194 .verify_signature(1, aad, |signature, message| { in csr_and_private_key_have_correct_format()
195 ecdsa_verify_cose(signature, message, &ec_public_key) in csr_and_private_key_have_correct_format()
201 let signature = ecdsa_sign_cose(message, &ec_private_key)?; in csr_and_private_key_have_correct_format() localVariable
202 ecdsa_verify_cose(&signature, message, &ec_public_key) in csr_and_private_key_have_correct_format()
209 signature: &[u8], in ecdsa_verify_cose()
213 let coord_bytes = signature.len() / 2; in ecdsa_verify_cose()
[all …]
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/adselection/signature/
DECDSASignatureVerifierTest.java17 package com.android.adservices.service.adselection.signature;
19 import static com.android.adservices.service.adselection.signature.ECDSASignatureVerifier.ECDSA_WIT…
20 import static com.android.adservices.service.adselection.signature.ECDSASignatureVerifier.EC_KEY_AL…
67 Signature signature = Signature.getInstance(ECDSA_WITH_SHA256_SIGNING_ALGORITHM); in setup() local
68 signature.initSign(pair.getPrivate()); in setup()
69 signature.update(mDataBytes); in setup()
70 mSignatureBytes = signature.sign(); in setup()
/packages/modules/Virtualization/libs/dice/open_dice/tests/
Dapi_test.rs101 let mut signature = sign(b"MyMessage", priv_key.as_array()).unwrap(); in hash_derive_sign_verify() localVariable
102 assert_eq!(&signature, EXPECTED_SIGNATURE); in hash_derive_sign_verify()
103 assert!(verify(b"MyMessage", &signature, &pub_key).is_ok()); in hash_derive_sign_verify()
104 assert!(verify(b"MyMessage_fail", &signature, &pub_key).is_err()); in hash_derive_sign_verify()
105 signature[0] += 1; in hash_derive_sign_verify()
106 assert!(verify(b"MyMessage", &signature, &pub_key).is_err()); in hash_derive_sign_verify()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/message/
DIkeAuthPskPayload.java42 public final byte[] signature; field in IkeAuthPskPayload
50 signature = authData; in IkeAuthPskPayload()
76 signature = in IkeAuthPskPayload()
123 if (!Arrays.equals(signature, calculatedSignature)) { in verifyInboundSignature()
130 byteBuffer.put(signature); in encodeAuthDataToByteBuffer()
135 return signature.length; in getAuthDataLength()
DIkeAuthDigitalSignPayload.java140 public final byte[] signature; field in IkeAuthDigitalSignPayload
149 signature = authData; in IkeAuthDigitalSignPayload()
161 signature = new byte[authData.length - SIGNATURE_ALGO_ASN1_LEN_LEN - signAlgoLen]; in IkeAuthDigitalSignPayload()
162 inputBuffer.get(signature); in IkeAuthDigitalSignPayload()
219 signature = signGen.sign(); in IkeAuthDigitalSignPayload()
314 if (!signValidator.verify(signature)) { in verifyInboundSignature()
331 byteBuffer.put(signature); in encodeAuthDataToByteBuffer()
339 + signature.length; in getAuthDataLength()
341 return signature.length; in getAuthDataLength()
/packages/modules/Virtualization/service_vm/test_apk/src/native/
Dmain.rs111 return Ok(SigningResult { certificateChain: vec![], signature: vec![], status }); in signWithAttestationKey()
117 let signature = res.sign(message).with_log().or_service_specific_exception(-1)?; in signWithAttestationKey() localVariable
118 Ok(SigningResult { certificateChain: certificate_chain, signature, status }) in signWithAttestationKey()
215 let signature = self.sign(message)?; in log() localVariable
216 info!("Signature: {:?}", signature); in log()
296 let mut signature = vec![0u8; size]; in sign_with_attested_key() localVariable
305 signature.as_mut_ptr() as *mut c_void, in sign_with_attested_key()
306 signature.len(), in sign_with_attested_key()
309 ensure!(size <= signature.len()); in sign_with_attested_key()
310 signature.truncate(size); in sign_with_attested_key()
[all …]
/packages/modules/Virtualization/service_vm/demo_apk/src/
Dmain.rs82 let signature = res.sign(message)?; in try_main() localVariable
83 info!("Signature: {:?}", signature); in try_main()
205 let mut signature = vec![0u8; size]; in sign_with_attested_key() localVariable
214 signature.as_mut_ptr() as *mut c_void, in sign_with_attested_key()
215 signature.len(), in sign_with_attested_key()
218 ensure!(size == signature.len()); in sign_with_attested_key()
219 Ok(signature.into_boxed_slice()) in sign_with_attested_key()
/packages/modules/Virtualization/libs/dice/open_dice/src/
Dops.rs110 let mut signature = [0u8; SIGNATURE_SIZE]; localVariable
121 signature.as_mut_ptr(),
124 signature.len(),
126 Ok(signature)
130 pub fn verify(message: &[u8], signature: &Signature, public_key: &PublicKey) -> Result<()> { in verify()
139 signature.as_ptr(), in verify()
/packages/modules/Virtualization/service_vm/requests/src/
Dcert.rs117 signature: &[u8], in build_certificate()
120 signature_algorithm: tbs_cert.signature.clone(), in build_certificate()
122 signature: BitString::new(0, signature)?, in build_certificate()
153 let signature = AlgorithmIdentifier { oid: ECDSA_WITH_SHA_256, parameters: None }; in build_tbs_certificate() localVariable
163 signature, in build_tbs_certificate()
Dclient_vm.rs62 cose_sign.verify_signature(DICE_CDI_LEAF_SIGNATURE_INDEX, aad, |signature, message| { in request_attestation()
63 client_vm_dice_chain.microdroid_payload().subject_public_key.verify(signature, message) in request_attestation()
68 cose_sign.verify_signature(ATTESTATION_KEY_SIGNATURE_INDEX, aad, |signature, message| { in request_attestation()
69 ecdsa_verify_cose(&ec_public_key, signature, message) in request_attestation()
113 let signature = ecdsa_sign_der(&ec_private_key, &tbs_cert.to_der()?)?; in request_attestation() localVariable
114 let certificate = cert::build_certificate(tbs_cert, &signature)?; in request_attestation()
118 fn ecdsa_verify_cose(key: &EcKey, signature: &[u8], message: &[u8]) -> bssl_avf::Result<()> { in ecdsa_verify_cose()
121 key.ecdsa_verify_cose(signature, &digest) in ecdsa_verify_cose()
Ddice.rs235 pub(crate) fn verify(&self, signature: &[u8], message: &[u8]) -> Result<()> { in verify()
252 Ok(public_key.ecdsa_verify_cose(signature, &digest)?) in verify()
269 let signature = signature.try_into().map_err(|_| { in verify() localVariable
270 error!("Invalid ED25519 signature size: {}", signature.len()); in verify()
273 Ok(ed25519_verify(message, signature, public_key)?) in verify()
305 cose_sign1.verify_signature(aad, |signature, message| { in validate_cose_signature_and_extract_payload()
306 authority_public_key.verify(signature, message) in validate_cose_signature_and_extract_payload()
/packages/modules/Virtualization/compos/verify/native/
Dverify_native.cpp23 bool verify(Slice<const uint8_t> public_key, Slice<const uint8_t> signature, in verify() argument
29 signature.size() != signature_array.size()) { in verify()
34 std::copy(signature.begin(), signature.end(), signature_array.begin()); in verify()
/packages/modules/AdServices/adservices/framework/java/android/adservices/adselection/
DSignedContextualAds.java90 @NonNull byte[] signature) { in SignedContextualAds() argument
94 this.mSignature = signature; in SignedContextualAds()
247 public SignedContextualAds.Builder setSignature(@NonNull byte[] signature) { in setSignature() argument
248 Objects.requireNonNull(signature, SIGNATURE_CANNOT_BE_NULL); in setSignature()
250 this.mSignature = Arrays.copyOf(signature, signature.length); in setSignature()
/packages/providers/MediaProvider/src/com/android/providers/media/photopicker/data/glide/
DPickerPreloadModelProvider.java37 import com.bumptech.glide.signature.ObjectKey;
96 final ObjectKey signature = loadable.getLoadableSignature(/* prefix= */ mMediaStoreVersion); in getPreloadRequestBuilder() local
98 return Glide.with(mContext).asBitmap().apply(options).signature(signature).load(loadable); in getPreloadRequestBuilder()
/packages/modules/Virtualization/libs/apkverify/src/
Dv3.rs62 signature: LengthPrefixed<Bytes>, field
134 fn verify_signature(&self, signature: &Signature) -> Result<()> { in verify_signature()
135 let mut verifier = signature in verify_signature()
140 ensure!(verifier.verify(&signature.signature)?, "Signature is invalid."); in verify_signature()
259 Ok(Signature { signature_algorithm_id: buf.read()?, signature: buf.read()? }) in read_from_bytes()
/packages/providers/MediaProvider/src/com/android/providers/media/photopicker/ui/
DImageLoader.java42 import com.bumptech.glide.signature.ObjectKey;
182 @Nullable RequestOptions requestOptions, @Nullable ObjectKey signature, in loadWithGlide() argument
196 if (signature != null) { in loadWithGlide()
197 newRequestBuilder = newRequestBuilder.signature(signature); in loadWithGlide()
/packages/modules/Virtualization/compos/verify/
Dverify.rs108 let signature = artifacts_dir.join("compos.info.signature"); in try_main() localVariable
111 let signature = read_small_file(&signature).context("Failed to read compos.info signature")?; in try_main() localVariable
138 if !compos_verify_native::verify(&public_key?, &signature, &info) { in try_main()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adselection/signature/
DECDSASignatureVerifier.java17 package com.android.adservices.service.adselection.signature;
75 public boolean verify(byte[] publicKey, byte[] data, byte[] signature) { in verify() argument
84 return ecdsa.verify(signature); in verify()

1234567