Re: BouncyCastle SCrypt using more memory than native impls?
Peter Dettman <[email protected]> Sat, 20 Jul 2019 21:58:08 +0700
| Newsgroups | gmane.comp.encryption.bouncy-castle.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Andreas, At a quick glance there appears to be room for improvement, I'll look into it further. To make things concrete, what SCrypt parameters are you using? Regards, Pete Dettman On 20/7/19 5:06 pm, Andreas Schildbach wrote: > I recently switched out the SCrypt implementation in my app. I had been > using native code: https://github.com/wg/scrypt. For reference, the code > I had been using was removed via this commit: > https://github.com/bitcoin-wallet/bitcoin-wallet/commit/83210d60461182188be8e13133a9bee40eefd1da > > I'm now using BouncyCastle org.spongycastle.crypto.generators.SCrypt > (artifact: org.bouncycastle:bcprov-jdk15on:1.60) > > I now have the problem that on low-end Android devices my app gets a lot > of OutOfMemoryErrors. I wonder if the BouncyCastle implementation > somehow uses more memory than it should, e.g. by copying buffers? > > Is this maybe a known problem? I scanned the BCs issues at GitHub but > didn't find much about SCrypt at all. > > By the way: on modern Android devices (Pixel 2, Android 9, 64 bit) the > BouncyCastle implementation actually runs faster than the native code > before! > >