HomePhabricator
Diffusion Comm 46037bfe9b83

[native][AES] Implement generateKey function

Description

[native][AES] Implement generateKey function

Summary:
This diff implements a function, that generates AES-256 key using platforms' native APIs.

iOS docs: https://developer.apple.com/documentation/cryptokit/aes/gcm/nonce
Android docs: https://developer.android.com/reference/kotlin/javax/crypto/KeyGenerator

Depends on D7002

Test Plan:
Ensured the function returns random numbers on both platforms:


import { generateKey } from './utils/aes-crypto-module.js';

console.log(generateKey());
// should display sth like: [82, 226, ..., 215, 19, 13] // 32 values

Reviewers: marcin, atul, varun

Reviewed By: atul

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D7004

Details

Provenance
bartekAuthored on Mar 13 2023, 4:38 AM
Reviewer
atul
Differential Revision
D7004: [native][AES] Implement generateKey function
Parents
rCOMM8735eb5f5924: [native] Create AESCrypto Expo module
Branches
Unknown
Tags
Unknown