ChaCha20 IOS usage problems

56 Views Asked by At

Stack: LibGDX, robovm, java(kotlin) Platform: IOS Algo: ChaCha Task: encrypt/decrypt byte arrays

I've tried Cipher.getInstance(), but got NoSuchAlgorithmException on IOS (same code on Android build works fine). BC is visible among security providers. I've tried bouncycastle's ChaChaEngine. Same result: Android - fine, IOS - ChaChaEngine class not found

Any ideas how to implement ChaCha on IOS or link to sourcecode to implement it by hands?

1

There are 1 best solutions below

0
ilya_kas On BEST ANSWER

I've solved this issue. Posting steps for anyone facing same problem:

  1. Check your robovm.xml. It must contain not only basic concrete bouncy castle references but also <pattern>com.android.org.bouncycastle.**</pattern>
  2. The problem is with this concrete algo. After step 1 you can move from ChaCha20 to AES/CFB/PKCS7Padding