Home
last modified time | relevance | path

Searched refs:keyBytes (Results 1 – 10 of 10) sorted by relevance

/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/crypto/
DIkeMac.java73 public byte[] signBytes(byte[] keyBytes, byte[] dataToSign) { in signBytes() argument
80 .signBytes(keyBytes, dataToSign, true /*needTruncation*/); in signBytes()
82 keyBytes = modifyKeyIfNeeded(keyBytes); in signBytes()
84 .signBytes(keyBytes, dataToSign, false /*needTruncation*/); in signBytes()
89 SecretKeySpec secretKey = new SecretKeySpec(keyBytes, getAlgorithmName()); in signBytes()
101 private byte[] modifyKeyIfNeeded(byte[] keyBytes) { in modifyKeyIfNeeded() argument
114 if (keyBytes.length < 16) { in modifyKeyIfNeeded()
115 keyBytes = Arrays.copyOf(keyBytes, 16); in modifyKeyIfNeeded()
116 } else if (keyBytes.length > 16) { in modifyKeyIfNeeded()
117 keyBytes = in modifyKeyIfNeeded()
[all …]
DIkeNormalModeCipher.java45 private byte[] doCipherAction(byte[] data, byte[] keyBytes, byte[] ivBytes, int opmode) in doCipherAction() argument
47 if (getKeyLength() != keyBytes.length) { in doCipherAction()
52 + keyBytes.length); in doCipherAction()
55 SecretKeySpec key = new SecretKeySpec(keyBytes, getAlgorithmName()); in doCipherAction()
84 public byte[] encrypt(byte[] paddedData, byte[] keyBytes, byte[] ivBytes) { in encrypt() argument
86 return doCipherAction(paddedData, keyBytes, ivBytes, Cipher.ENCRYPT_MODE); in encrypt()
102 public byte[] decrypt(byte[] encryptedData, byte[] keyBytes, byte[] ivBytes) in decrypt() argument
104 return doCipherAction(encryptedData, keyBytes, ivBytes, Cipher.DECRYPT_MODE); in decrypt()
DIkeCombinedModeCipher.java77 byte[] data, byte[] additionalAuthData, byte[] keyBytes, byte[] ivBytes, int opmode) in doCipherAction() argument
82 ByteBuffer secretKeyAndSaltBuffer = ByteBuffer.wrap(keyBytes); in doCipherAction()
83 byte[] secretKeyBytes = new byte[keyBytes.length - mSaltLen]; in doCipherAction()
145 byte[] paddedData, byte[] additionalAuthData, byte[] keyBytes, byte[] ivBytes) { in encrypt() argument
148 paddedData, additionalAuthData, keyBytes, ivBytes, Cipher.ENCRYPT_MODE); in encrypt()
167 byte[] keyBytes, in decrypt() argument
175 keyBytes, in decrypt()
DAesXCbcImpl.java62 public byte[] signBytes(byte[] keyBytes, byte[] dataToSign, boolean needTruncation) { in signBytes() argument
76 byte[] key1 = encryptAesBlock(keyBytes, HexDump.hexStringToByteArray(KEY1_SEED_HEX_STRING)); in signBytes()
77 byte[] key2 = encryptAesBlock(keyBytes, HexDump.hexStringToByteArray(KEY2_SEED_HEX_STRING)); in signBytes()
78 byte[] key3 = encryptAesBlock(keyBytes, HexDump.hexStringToByteArray(KEY3_SEED_HEX_STRING)); in signBytes()
144 private byte[] encryptAesBlock(byte[] keyBytes, byte[] dataToEncrypt) { in encryptAesBlock() argument
152 Cipher.ENCRYPT_MODE, new SecretKeySpec(keyBytes, mCipher.getAlgorithm()), iv); in encryptAesBlock()
DIkeMacIntegrity.java122 public byte[] generateChecksum(byte[] keyBytes, byte[] dataToAuthenticate) { in generateChecksum() argument
123 if (getKeyLength() != keyBytes.length) { in generateChecksum()
128 + keyBytes.length); in generateChecksum()
131 byte[] signedBytes = signBytes(keyBytes, dataToAuthenticate); in generateChecksum()
DIkeMacPrf.java154 public byte[] generateKeyMat(byte[] keyBytes, byte[] dataToSign, int keyMaterialLen) { in generateKeyMat() argument
155 return KeyGenerationUtils.prfPlus(this, keyBytes, dataToSign, keyMaterialLen); in generateKeyMat()
/packages/modules/IPsec/src/java/com/android/internal/net/crypto/
DKeyGenerationUtils.java42 ByteSigner byteSigner, byte[] keyBytes, byte[] dataToSign, int keyMaterialLen) { in prfPlus() argument
54 previousMac = byteSigner.signBytes(keyBytes, dataToSignBuffer.array()); in prfPlus()
79 byte[] signBytes(byte[] keyBytes, byte[] dataToSign); in signBytes() argument
/packages/modules/IPsec/src/java/com/android/internal/net/eap/crypto/
DHmacSha256ByteSigner.java47 public byte[] signBytes(byte[] keyBytes, byte[] dataToSign) { in signBytes() argument
50 mac.init(new SecretKeySpec(keyBytes, MAC_ALGORITHM_STRING)); in signBytes()
/packages/services/Telecomm/testapps/src/com/android/server/telecom/testapps/
DTestCertActivity.java145 byte[] keyBytes = Base64.decode(key.getBytes(), Base64.DEFAULT); in savePublicKey()
160 mnc, type, identifier, keyBytes, new Date()); in savePublicKey()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/testmode/
DDeterministicSecureRandom.java74 public byte[] signBytes(byte[] keyBytes, byte[] dataToSign) { in signBytes() argument