Investigate crypto crash on Android w/o libjbigi.so
Opened 7 years ago
Last modified 2 years ago
#1343assigneddefect
Investigate crypto crash on Android w/o libjbigi.so
Reported by:str4dOwned by:Meeh Priority: minor Milestone:
Component: apps/android Version: 0.9.14 Keywords:
Cc:
Parent Tickets:
Sensitive: no
Description
zzz, _sponge, I'm thinking now that we don't need to include jbigi in Android
https://developer.android.com/reference/java/math/BigInteger.html
"This implementation is efficient for operations traditionally used in cryptography, such as the generation of large prime numbers and computation of the modular inverse."
tl;dr GMP is doing nothing, Android devs have already optimized (at least on Android 4.1.2)
str4d, native was slower 3 years ago too…. the trouble was that Android BigInteger? crashed the jvm. Until I added jbigi, nothing worked.
I spent maybe 6 months trying to track down why. unsuccessfully.
and yes this was on an OG Droid Froyo.
never found a bug report or fix about it
also, testing on numerous 32-bit platforms showed that 5.0.2 was no faster than 4.3.2, and twice the .so size.
To this day we still ship 4.3.2 for 32 bit and 5.0.2 for 64 bit, as set up in May/June? 2011. We haven't touched jbigi since.
see notes in installer/lib/jbigi/README.txt
re: dropping jbigi, sure, if we can figure out when it got fixed.
All I know is I spent 6 months or a year getting the router to work on android, and a big part of that was realizing that it was dying in ssu, i.e. DH, i.e. bigInt.
now, i could try it w/o jbigi on my OG droid, maybe it got fixed somewhere along the way, but there hasn't been an OTA update in years
What sort of crash? OOM or something else?
and of course now I can't run the upcoming release on Froyo anyway, we've moved to API 9.
Yah, that's another point
it was a crash in native code
k
for months i worked around it by disabling SSU
That at least implies that Android API 8 was using NativeBN internally.
but RI signatures also failed about half the time too.
so it would create its own RI, sign it, then it would fail a double=check, and the router would die there.
once I added jbigi it all just magically worked
maybe we could go back through 5 years of AOSP checkins and find a fix point… but more likely we'd just have to throw it out there w/o jbigi and see if anybody bitches
is either one of those worth 89 KB or a 6% speedup? dunno.
btw, the speed test never crashed. only the router.
Right, meaning it's some obscure corner case that is being triggered.
zzz, did the crash happen in the emulator ever?
i think I couldn't ever get the emulator crypto to work, don't remember if exactly the same crash or not