[native][AES] Implement encrypt function on Android
Summary:
Counterpart of D7005 for Android. More context in that diff.
Docs: https://developer.android.com/reference/kotlin/javax/crypto/Cipher
Inspired by: https://levelup.gitconnected.com/doing-aes-gcm-in-android-adventures-in-the-field-72617401269d
Depends on D7006
Test Plan:
The same as in D7005:
import * as AES from './utils/aes-crypto-module.js'; const key = AES.generateKey(); const plaintextBytes = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); const ciphertext = AES.encrypt(key, plaintextBytes); console.log('Ciphertext', ciphertext); // ensured that ciphertext is 12+10+16=38 bytes long (ciphertext.length==38)
Reviewers: marcin, atul, varun
Reviewed By: atul
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D7007