Java Serpent GCM bouncy castle在Android上的实现非常缓慢
我使用最新的源代码实现了Serpent GCM加密Java Serpent GCM bouncy castle在Android上的实现非常缓慢,java,android,performance,bouncycastle,spongycastle,Java,Android,Performance,Bouncycastle,Spongycastle,我使用最新的源代码实现了Serpent GCM加密 public byte[] encrypt(byte[] key, byte[] iv, byte[] pt, byte[] aad, int tagLength) throws InvalidCipherTextException { GCMBlockCipher c = new GCMBlockCipher(new SerpentEngine()); c.init(true, new
public byte[] encrypt(byte[] key, byte[] iv, byte[] pt, byte[] aad,
int tagLength) throws InvalidCipherTextException {
GCMBlockCipher c = new GCMBlockCipher(new SerpentEngine());
c.init(true,
new AEADParameters(new KeyParameter(key), tagLength, iv, aad));
int outsize = c.getOutputSize(pt.length);
byte[] out = new byte[outsize];
int len = c.processBytes(pt, 0, pt.length, out, 0);
c.doFinal(out, len);
return out;
}
它在我的台式机(WindowsCoreI7)上运行得非常好。加密5Mb文件大约需要190毫秒。但突然间,部署在三星galaxy 4平板电脑(Android 5.0.1)上的相同代码需要40秒才能对同一文件进行相同的加密。我们尝试了华为Acend G300(Android 2.3.6),只需17秒
我们还测试了相同的加密,不幸的是,我们没有获得更好的性能
非常感谢您的帮助 你试过跟踪吗?@zapl还没有,我们会尽快尝试。你试过跟踪吗?@zapl还没有,我们会尽快尝试