Home
last modified time | relevance | path

Searched refs:digest (Results 1 – 25 of 112) sorted by relevance

12345

/frameworks/base/apct-tests/perftests/core/src/android/libcore/regression/
DMessageDigestPerfTest.java102 MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider); in time() local
103 digest.update(DATA, 0, DATA_SIZE); in time()
104 digest.digest(); in time()
113 MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider); in timeLargeArray() local
114 digest.update(LARGE_DATA, 0, LARGE_DATA_SIZE); in timeLargeArray()
115 digest.digest(); in timeLargeArray()
124 MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider); in timeSmallChunkOfLargeArray() local
125 digest.update(LARGE_DATA, LARGE_DATA_SIZE / 2, DATA_SIZE); in timeSmallChunkOfLargeArray()
126 digest.digest(); in timeSmallChunkOfLargeArray()
135 MessageDigest digest = MessageDigest.getInstance(algorithm.toString(), mProvider); in timeSmallByteBuffer() local
[all …]
/frameworks/base/apex/blobstore/framework/java/android/app/blob/
DBlobHandle.java69 @NonNull public final byte[] digest; field in BlobHandle
92 private BlobHandle(String algorithm, byte[] digest, CharSequence label, long expiryTimeMillis, in BlobHandle() argument
95 this.digest = digest; in BlobHandle()
103 this.digest = in.createByteArray(); in BlobHandle()
110 public static @NonNull BlobHandle create(@NonNull String algorithm, @NonNull byte[] digest, in create() argument
113 final BlobHandle handle = new BlobHandle(algorithm, digest, label, expiryTimeMillis, tag); in create()
144 public static @NonNull BlobHandle createWithSha256(@NonNull byte[] digest, in createWithSha256() argument
147 return create(ALGO_SHA_256, digest, label, expiryTimeMillis, tag); in createWithSha256()
156 return digest; in getSha256Digest()
195 dest.writeByteArray(digest); in writeToParcel()
[all …]
/frameworks/base/core/java/android/security/net/config/
DPin.java26 public final byte[] digest; field in Pin
30 public Pin(String digestAlgorithm, byte[] digest) { in Pin() argument
32 this.digest = digest; in Pin()
33 mHashCode = Arrays.hashCode(digest) ^ digestAlgorithm.hashCode(); in Pin()
72 if (!Arrays.equals(digest, other.digest)) { in equals()
DDirectoryCertificateSource.java215 byte[] digest = MessageDigest.getInstance("MD5").digest(principal.getEncoded());
217 return (((digest[offset++] & 0xff) << 0) | ((digest[offset++] & 0xff) << 8)
218 | ((digest[offset++] & 0xff) << 16) | ((digest[offset] & 0xff) << 24));
/frameworks/base/core/java/android/content/pm/
DInstantAppResolveInfo.java86 public InstantAppResolveInfo(@NonNull InstantAppDigest digest, @Nullable String packageName, in InstantAppResolveInfo() argument
88 this(digest, packageName, filters, (long) versionCode, null /* extras */); in InstantAppResolveInfo()
92 public InstantAppResolveInfo(@NonNull InstantAppDigest digest, @Nullable String packageName, in InstantAppResolveInfo() argument
95 this(digest, packageName, filters, versionCode, extras, false); in InstantAppResolveInfo()
113 private InstantAppResolveInfo(@NonNull InstantAppDigest digest, @Nullable String packageName, in InstantAppResolveInfo() argument
121 mDigest = digest; in InstantAppResolveInfo()
289 final MessageDigest digest = MessageDigest.getInstance(SHA_ALGORITHM); in generateDigest() local
292 digests.add(digest.digest(hostBytes)); in generateDigest()
298 digests.add(digest.digest(hostName.getBytes())); in generateDigest()
302 digests.add(digest.digest(hostBytes)); in generateDigest()
[all …]
/frameworks/base/identity/java/android/security/identity/
DUtil.java148 byte[] digest = new byte[0]; in computeHkdf()
150 mac.update(digest); in computeHkdf()
153 digest = mac.doFinal(); in computeHkdf()
154 if (pos + digest.length < size) { in computeHkdf()
155 System.arraycopy(digest, 0, result, pos, digest.length); in computeHkdf()
156 pos += digest.length; in computeHkdf()
159 System.arraycopy(digest, 0, result, pos, size - pos); in computeHkdf()
/frameworks/base/services/core/java/com/android/server/net/watchlist/
DHarmfulDigests.java45 public boolean contains(byte[] digest) { in contains() argument
46 return mDigestSet.contains(HexDump.toHexString(digest)); in contains()
50 for (String digest : mDigestSet) { in dump()
51 pw.println(digest); in dump()
DWatchlistLoggingHandler.java244 final byte[] digest = getDigestFromUid(uid); in insertRecord()
245 if (digest == null) { in insertRecord()
248 if (mDbHelper.insertNewRecord(digest, cncHost, timestamp)) { in insertRecord()
317 byte[] digest = getDigestFromUid(apps.get(i).uid); in getAllDigestsForReport()
318 if (digest != null) { in getAllDigestsForReport()
319 result.add(HexDump.toHexString(digest)); in getAllDigestsForReport()
/frameworks/base/core/java/com/android/internal/security/
DVerityUtils.java132 @NonNull byte[] digest, @NonNull InputStream derCertInputStream) { in verifyPkcs7DetachedSignature() argument
133 if (digest.length != 32) { in verifyPkcs7DetachedSignature()
140 new CMSProcessableByteArray(toFormattedDigest(digest)), in verifyPkcs7DetachedSignature()
239 return MessageDigest.getInstance("SHA-256").digest(buffer.array()); in generateFsVerityDigest()
244 public static byte[] toFormattedDigest(byte[] digest) { in toFormattedDigest() argument
246 ByteBuffer buffer = ByteBuffer.allocate(12 + digest.length); // struct size + sha256 size in toFormattedDigest()
250 buffer.putShort((short) digest.length); in toFormattedDigest()
251 buffer.put(digest); in toFormattedDigest()
258 @NonNull byte[] digest); in measureFsverityNative() argument
/frameworks/base/core/jni/
Dcom_android_internal_security_VerityUtils.cpp113 int measureFsverity(JNIEnv *env, jobject /* clazz */, jstring filePath, jbyteArray digest) { in measureFsverity() argument
134 if (digest != nullptr && data->digest_size > 0) { in measureFsverity()
135 auto digestSize = env->GetArrayLength(digest); in measureFsverity()
139 env->SetByteArrayRegion(digest, 0, data->digest_size, (const jbyte *)data->digest); in measureFsverity()
/frameworks/base/core/tests/privacytests/src/android/privacy/
DRapporEncoderTest.java202 byte[] digest = md5.digest(testingSecret.getBytes(StandardCharsets.UTF_8)); in makeTestingUserSecret()
203 assertEquals(16, digest.length); in makeTestingUserSecret()
204 return ByteBuffer.allocate(48).put(digest).put(digest).put(digest).array(); in makeTestingUserSecret()
DLongitudinalReportingEncoderTest.java413 byte[] digest = md5.digest(testingSecret.getBytes(StandardCharsets.UTF_8)); in makeTestingUserSecret()
414 assertEquals(16, digest.length); in makeTestingUserSecret()
415 return ByteBuffer.allocate(48).put(digest).put(digest).put(digest).array(); in makeTestingUserSecret()
/frameworks/base/keystore/java/android/security/keystore/
DKeyProperties.java644 public static int toKeymaster(@NonNull @DigestEnum String digest) { in toKeymaster() argument
645 switch (digest.toUpperCase(Locale.US)) { in toKeymaster()
661 throw new IllegalArgumentException("Unsupported digest algorithm: " + digest); in toKeymaster()
666 public static @DigestEnum String fromKeymaster(int digest) { in fromKeymaster() argument
667 switch (digest) { in fromKeymaster()
683 throw new IllegalArgumentException("Unsupported digest algorithm: " + digest); in fromKeymaster()
691 AlgorithmParameterSpec fromKeymasterToMGF1ParameterSpec(int digest) { in fromKeymasterToMGF1ParameterSpec() argument
692 switch (digest) { in fromKeymasterToMGF1ParameterSpec()
708 public static @DigestEnum String fromKeymasterToSignatureAlgorithmDigest(int digest) { in fromKeymasterToSignatureAlgorithmDigest() argument
709 switch (digest) { in fromKeymasterToSignatureAlgorithmDigest()
[all …]
/frameworks/base/services/core/java/com/android/server/am/
DActivityManagerUtils.java92 final MessageDigest digest = MessageDigest.getInstance("SHA-1"); in getUnsignedHashUnCached() local
93 digest.update(s.getBytes()); in getUnsignedHashUnCached()
94 return unsignedIntFromBytes(digest.digest()); in getUnsignedHashUnCached()
/frameworks/base/services/core/java/com/android/server/backup/
DBackupUtils.java108 MessageDigest digest = MessageDigest.getInstance("SHA-256"); in hashSignature() local
109 digest.update(signature); in hashSignature()
110 return digest.digest(); in hashSignature()
/frameworks/base/tests/BlobStoreTestUtils/src/com/android/utils/blob/
DFakeBlobData.java129 mFileDigest = FileUtils.digest(mFile, "SHA-256"); in prepare()
223 actualDigest = FileUtils.digest(in, "SHA-256"); in verifyBlob()
230 final MessageDigest digest = MessageDigest.getInstance("SHA-256"); in createSha256Digest() local
238 digest.update(buffer, 0, toRead); in createSha256Digest()
241 return digest.digest(); in createSha256Digest()
/frameworks/base/core/java/android/util/jar/
DStrictJarVerifier.java109 private final MessageDigest digest; field in StrictJarVerifier.VerifierEntry
117 VerifierEntry(String name, MessageDigest digest, byte[] hash, in VerifierEntry() argument
120 this.digest = digest; in VerifierEntry()
131 digest.update((byte) value); in write()
139 digest.update(buf, off, nbytes); in write()
154 byte[] d = digest.digest(); in verify()
522 byte[] b = md.digest(); in verify()
/frameworks/base/telephony/java/android/telephony/mbms/
DDownloadRequest.java364 MessageDigest digest; in getHash() local
366 digest = MessageDigest.getInstance("SHA-256"); in getHash()
372 digest.update(sourceUri.toString().getBytes(StandardCharsets.UTF_8)); in getHash()
373 digest.update(destinationUri.toString().getBytes(StandardCharsets.UTF_8)); in getHash()
375 digest.update(serializedResultIntentForApp.getBytes(StandardCharsets.UTF_8)); in getHash()
379 return Base64.encodeToString(digest.digest(), Base64.URL_SAFE | Base64.NO_WRAP); in getHash()
/frameworks/base/core/java/android/privacy/internal/rappor/
DRapporEncoder.java84 MessageDigest digest = MessageDigest.getInstance("SHA-256"); in getInsecureSeed() local
85 byte[] bytes = digest.digest(input.getBytes(StandardCharsets.UTF_8)); in getInsecureSeed()
/frameworks/base/core/java/com/android/internal/os/
DIBinaryTransparencyService.aidl36 byte[] digest;
48 byte[] digest;
/frameworks/base/services/core/java/com/android/server/
DEntropyMixer.java208 byte[] digest = sha256.digest(); in updateSeedFile()
209 System.arraycopy(digest, 0, newSeed, newSeed.length - digest.length, digest.length); in updateSeedFile()
/frameworks/base/services/core/java/com/android/server/accounts/
DAccountManagerBackupHelper.java188 final String digest = PackageUtils.computeSignaturesSha256Digest( in backupAccountAccessPermissions() local
190 if (digest != null) { in backupAccountAccessPermissions()
195 serializer.attribute(null, ATTR_DIGEST, digest); in backupAccountAccessPermissions()
237 String digest = parser.getAttributeValue(null, ATTR_DIGEST); in restoreAccountAccessPermissions() local
238 if (TextUtils.isEmpty(digest)) { in restoreAccountAccessPermissions()
243 accountDigest, packageName, digest, userId); in restoreAccountAccessPermissions()
/frameworks/base/tests/BinaryTransparencyHostTest/test-app/src/android/transparency/test/app/
DBinaryTransparencyTest.java89 assertThat(apex.digest).isNotNull(); in testCollectAllApexInfo()
90 String digestHex = hexFormatter.formatHex(apex.digest); in testCollectAllApexInfo()
114 assertThat(updatedPreload.digest).isNotEmpty(); in testCollectAllUpdatedPreloadInfo()
143 assertThat(appInfo.digest).isNotEmpty(); in testCollectAllSilentInstalledMbaInfo()
/frameworks/base/services/core/java/com/android/server/locksettings/
DSyntheticPasswordCrypto.java257 MessageDigest digest = MessageDigest.getInstance("SHA-512"); in personalizedHash() local
264 digest.update(personalization); in personalizedHash()
266 digest.update(data); in personalizedHash()
268 return digest.digest(); in personalizedHash()
/frameworks/base/apex/blobstore/service/java/com/android/server/blob/
DBlobStoreManagerShellCommand.java153 args.digest = Base64.getDecoder().decode(getNextArgRequired()); in parseOptions()
182 public byte[] digest; field in BlobStoreManagerShellCommand.ParsedArgs
189 return BlobHandle.create(algorithm, digest, label, expiryTimeMillis, tag); in getBlobHandle()

12345