Home
last modified time | relevance | path

Searched refs:nonce (Results 1 – 25 of 39) sorted by relevance

12

/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/chunking/
DEncryptedChunk.java42 public static EncryptedChunk create(ChunkHash key, byte[] nonce, byte[] encryptedBytes) { in create() argument
44 nonce.length == NONCE_LENGTH_BYTES, "Nonce does not have the correct length."); in create()
45 return new EncryptedChunk(key, nonce, encryptedBytes); in create()
52 private EncryptedChunk(ChunkHash key, byte[] nonce, byte[] encryptedBytes) { in EncryptedChunk() argument
54 mNonce = nonce; in EncryptedChunk()
64 public byte[] nonce() { in nonce() method in EncryptedChunk
DChunkEncryptor.java62 byte[] nonce = generateNonce(); in encrypt()
69 new GCMParameterSpec(GCM_TAG_LENGTH_BYTES * 8, nonce)); in encrypt()
84 return EncryptedChunk.create(/*key=*/ plaintextHash, nonce, encryptedBytes); in encrypt()
88 byte[] nonce = new byte[GCM_NONCE_LENGTH_BYTES]; in generateNonce()
89 mSecureRandom.nextBytes(nonce); in generateNonce()
90 return nonce; in generateNonce()
DLengthlessEncryptedChunkEncoder.java38 writer.writeBytes(chunk.nonce()); in writeChunkToWriter()
44 return chunk.nonce().length + chunk.encryptedBytes().length; in getEncodedLengthOfChunk()
/frameworks/base/native/android/
Dstorage_manager.cpp45 virtual void onObbResult(const android::String16& filename, const int32_t nonce,
52 : nonce(_nonce) in ObbCallback()
57 int32_t nonce; member in ObbCallback
120 void fireCallback(const char* filename, const int32_t nonce, const int32_t state) { in fireCallback()
127 if (cb->nonce == nonce) { in fireCallback()
163 cb->nonce, obbInfo); in mountObb()
169 mMountService->unmountObb(filename16, force, mObbActionListener, cb->nonce); in unmountObb()
188 void ObbActionListener::onObbResult(const android::String16& filename, const int32_t nonce, const i… in onObbResult() argument
189 mStorageManager->fireCallback(String8(filename).string(), nonce, state); in onObbResult()
/frameworks/base/packages/BackupEncryption/proto/
Dwrapped_key.proto13 // No padding. Uses 12-byte nonce. Tag length 16 bytes.
29 // No padding. Uses 16-byte nonce (see nonce field). Tag length 16 bytes.
30 // The nonce is 16-bytes as this is wrapped with a key in AndroidKeyStore.
41 // The nonce used to initialize the Cipher in AES/256/GCM mode.
42 optional bytes nonce = 2; field
/frameworks/base/obex/javax/obex/
DClientSession.java112 if (header.nonce != null) { in connect()
114 System.arraycopy(header.nonce, 0, mChallengeDigest, 0, 16); in connect()
180 if (head.nonce != null) { in get()
182 System.arraycopy(head.nonce, 0, mChallengeDigest, 0, 16); in get()
235 if (header.nonce != null) { in disconnect()
237 System.arraycopy(header.nonce, 0, mChallengeDigest, 0, 16); in disconnect()
300 if (head.nonce != null) { in put()
302 System.arraycopy(head.nonce, 0, mChallengeDigest, 0, 16); in put()
346 if (headset.nonce != null) { in setPath()
348 System.arraycopy(headset.nonce, 0, mChallengeDigest, 0, 16); in setPath()
[all …]
DHeaderSet.java238 /*package*/ byte[] nonce; field in HeaderSet
681 nonce = new byte[16]; in createAuthenticationChallenge()
686 nonce[i] = (byte)mRandom.nextInt(); in createAuthenticationChallenge()
689 mAuthChall = ObexHelper.computeAuthenticationChallenge(nonce, realm, access, userID); in createAuthenticationChallenge()
DServerSession.java374 if (reply.nonce != null) { in handleSetPathRequest()
376 System.arraycopy(reply.nonce, 0, mChallengeDigest, 0, 16); in handleSetPathRequest()
618 if (reply.nonce != null) { in handleConnectRequest()
620 System.arraycopy(reply.nonce, 0, mChallengeDigest, 0, 16); in handleConnectRequest()
/frameworks/base/packages/BackupEncryption/test/robolectric/src/com/android/server/backup/encryption/chunking/
DChunkEncryptorTest.java125 assertThat(chunk1.nonce()).isNotEqualTo(chunk2.nonce()); in encrypt_whenInvokedAgain_generatesNewNonce()
141 byte[] nonce = encryptedChunk.nonce(); in encrypt_generates12ByteNonce()
142 assertThat(nonce).hasLength(GCM_NONCE_LENGTH_BYTES); in encrypt_generates12ByteNonce()
153 new GCMParameterSpec(GCM_TAG_LENGTH_BYTES * 8, chunk.nonce())); in encrypt_decryptedResultCorrespondsToPlaintext()
DBackupFileBuilderTest.java117 TEST_CHUNK_1.nonce(), in writeChunks_nonIncremental_writesCorrectRawData()
119 TEST_CHUNK_2.nonce(), in writeChunks_nonIncremental_writesCorrectRawData()
137 TEST_CHUNK_1.nonce(), in writeChunks_nonIncrementalWithDuplicates_writesEachChunkOnlyOnce()
139 TEST_CHUNK_2.nonce(), in writeChunks_nonIncrementalWithDuplicates_writesEachChunkOnlyOnce()
161 TEST_CHUNK_1.nonce(), in writeChunks_incremental_writesParsableDiffScript()
163 TEST_CHUNK_2.nonce(), in writeChunks_incremental_writesParsableDiffScript()
165 TEST_CHUNK_3.nonce(), in writeChunks_incremental_writesParsableDiffScript()
187 TEST_CHUNK_1.nonce(), in writeChunks_incrementalWithDuplicates_writesEachChunkOnlyOnce()
189 TEST_CHUNK_2.nonce(), in writeChunks_incrementalWithDuplicates_writesEachChunkOnlyOnce()
191 TEST_CHUNK_3.nonce(), in writeChunks_incrementalWithDuplicates_writesEachChunkOnlyOnce()
[all …]
/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/tasks/
DEncryptedBackupTask.java214 byte[] nonce = generateNonce(); in encryptChunkOrdering()
219 new GCMParameterSpec(GCM_TAG_LENGTH_BYTES * BITS_PER_BYTE, nonce)); in encryptChunkOrdering()
225 nonce, in encryptChunkOrdering()
239 byte[] nonce = new byte[GCM_NONCE_LENGTH_BYTES]; in generateNonce()
240 mSecureRandom.nextBytes(nonce); in generateNonce()
241 return nonce; in generateNonce()
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/
DSecureBox.java325 private static byte[] aesGcmEncrypt(SecretKey key, byte[] nonce, byte[] plaintext, byte[] aad) in aesGcmEncrypt() argument
328 return aesGcmInternal(AesGcmOperation.ENCRYPT, key, nonce, plaintext, aad); in aesGcmEncrypt()
335 private static byte[] aesGcmDecrypt(SecretKey key, byte[] nonce, byte[] ciphertext, byte[] aad) in aesGcmDecrypt() argument
337 return aesGcmInternal(AesGcmOperation.DECRYPT, key, nonce, ciphertext, aad); in aesGcmDecrypt()
341 AesGcmOperation operation, SecretKey key, byte[] nonce, byte[] text, byte[] aad) in aesGcmInternal() argument
350 GCMParameterSpec spec = new GCMParameterSpec(GCM_TAG_LEN_BYTES * 8, nonce); in aesGcmInternal()
444 byte[] nonce = new byte[GCM_NONCE_LEN_BYTES]; in genRandomNonce()
445 new SecureRandom().nextBytes(nonce); in genRandomNonce()
446 return nonce; in genRandomNonce()
DWrappedKey.java118 public WrappedKey(byte[] nonce, byte[] keyMaterial, @Nullable byte[] keyMetadata, in WrappedKey() argument
120 this(nonce, keyMaterial, keyMetadata, platformKeyGenerationId, in WrappedKey()
136 public WrappedKey(byte[] nonce, byte[] keyMaterial, @Nullable byte[] keyMetadata, in WrappedKey() argument
138 mNonce = nonce; in WrappedKey()
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/storage/
DRecoverableKeyStoreDbTest.java85 byte[] nonce = getUtf8Bytes("nonce1"); in insertKey_replacesOldKey()
89 WrappedKey wrappedKey = new WrappedKey(nonce, keyMaterial, keyMetadata, generationId); in insertKey_replacesOldKey()
93 assertArrayEquals(nonce, retrievedKey.getNonce()); in insertKey_replacesOldKey()
98 nonce = getUtf8Bytes("nonce2"); in insertKey_replacesOldKey()
102 wrappedKey = new WrappedKey(nonce, keyMaterial, keyMetadata, generationId); in insertKey_replacesOldKey()
106 assertArrayEquals(nonce, retrievedKey.getNonce()); in insertKey_replacesOldKey()
170 byte[] nonce = getUtf8Bytes("nonce"); in getKey_returnsInsertedKey()
174 WrappedKey wrappedKey = new WrappedKey(nonce, keyMaterial, keyMetadata, generationId, 120); in getKey_returnsInsertedKey()
179 assertArrayEquals(nonce, retrievedKey.getNonce()); in getKey_returnsInsertedKey()
339 byte[] nonce = getUtf8Bytes("nonce"); in setPlatformKeyGenerationId_invalidatesExistingKeysForUser()
[all …]
/frameworks/base/libs/storage/
DIObbActionListener.cpp48 int32_t nonce = data.readInt32(); in onTransact() local
50 onObbResult(filename, nonce, state); in onTransact()
DIMountService.cpp446 const sp<IObbActionListener>& token, int32_t nonce, const sp<ObbInfo>& obbInfo) in mountObb() argument
454 data.writeInt32(nonce); in mountObb()
468 const sp<IObbActionListener>& token, const int32_t nonce) in unmountObb() argument
475 data.writeInt32(nonce); in unmountObb()
/frameworks/base/packages/BackupEncryption/test/robolectric/src/com/android/server/backup/encryption/tasks/
DBackupFileDecryptorTaskTest.java448 dos.write(chunk.nonce()); in createEncryptedFileUsingExplicitStarts()
450 position += chunk.nonce().length + chunk.encryptedBytes().length; in createEncryptedFileUsingExplicitStarts()
498 dos.writeInt(chunk.nonce().length + chunk.encryptedBytes().length); in createEncryptedFileUsingInlineLengths()
499 dos.write(chunk.nonce()); in createEncryptedFileUsingInlineLengths()
550 byte[] nonce = randomData(GCM_NONCE_LENGTH_BYTES); in encrypt()
554 new GCMParameterSpec(GCM_TAG_LENGTH_BYTES * BITS_PER_BYTE, nonce)); in encrypt()
559 out.write(nonce); in encrypt()
/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/keys/
DKeyWrapUtils.java77 new GCMParameterSpec(GCM_TAG_LENGTH_BITS, wrappedKey.nonce)); in unwrap()
99 wrappedKey.nonce = cipher.getIV(); in wrap()
/frameworks/base/libs/storage/include/storage/
DIMountService.h68 const int32_t nonce, const sp<ObbInfo>& obbInfo) = 0;
70 const sp<IObbActionListener>& token, const int32_t nonce) = 0;
DIObbActionListener.h32 … virtual void onObbResult(const String16& filename, const int32_t nonce, const int32_t state) = 0;
/frameworks/base/core/java/android/os/storage/
DIObbActionListener.aidl36 void onObbResult(in String filename, int nonce, int status) = 0; in onObbResult() argument
DIStorageManager.aidl63 IObbActionListener token, int nonce, in ObbInfo obbInfo) = 21; in mountObb() argument
70 void unmountObb(in String rawPath, boolean force, IObbActionListener token, int nonce) = 22; in unmountObb() argument
DStorageManager.java415 public void onObbResult(String filename, int nonce, int status) { in onObbResult() argument
418 delegate = mListeners.get(nonce); in onObbResult()
420 mListeners.remove(nonce); in onObbResult()
433 mListeners.put(delegate.nonce, delegate); in addListener()
436 return delegate.nonce; in addListener()
451 private final int nonce; field in StorageManager.ObbListenerDelegate
454 nonce = getNextNonce(); in ObbListenerDelegate()
694 final int nonce = mObbActionListener.addListener(listener); in mountObb() local
695 mStorageManager.mountObb(rawPath, canonicalPath, key, mObbActionListener, nonce, in mountObb()
766 final int nonce = mObbActionListener.addListener(listener); in unmountObb() local
[all …]
/frameworks/base/core/java/android/app/
DPropertyInvalidatedCache.java654 final long nonce = SystemProperties.getLong(name, NONCE_UNSET); in invalidateCacheLocked() local
655 if (nonce == NONCE_DISABLED) { in invalidateCacheLocked()
671 nonce, in invalidateCacheLocked()
717 final long nonce = SystemProperties.getLong(name, NONCE_UNSET); in corkInvalidations() local
718 if (nonce != NONCE_UNSET && nonce != NONCE_DISABLED) { in corkInvalidations()
/frameworks/base/core/tests/coretests/src/android/os/
DFileUtilsTest.java592 final String nonce = String.valueOf(System.nanoTime()); in testConvertToModernFd() local
599 final File validVideoCameraDir = new File(cameraDir, "validVideo-" + nonce + ".mp4"); in testConvertToModernFd()
600 final File validImageCameraDir = new File(cameraDir, "validImage-" + nonce + ".jpg"); in testConvertToModernFd()
602 final File validVideoNonCameraDir = new File(nonCameraDir, "validVideo-" + nonce + ".mp4"); in testConvertToModernFd()
603 final File validImageNonCameraDir = new File(nonCameraDir, "validImage-" + nonce + ".jpg"); in testConvertToModernFd()

12