Bug 38142 - SPECjvm2008 crypto.aes test fails due to lack of support for 168-bit tripledes keys
Summary: SPECjvm2008 crypto.aes test fails due to lack of support for 168-bit triplede...
Alias: None
Product: classpath
Classification: Unclassified
Component: crypto (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: ---
Assignee: Casey Marshall
Depends on:
Blocks: 38141
  Show dependency treegraph
Reported: 2008-11-16 01:33 UTC by Andrew John Hughes
Modified: 2018-05-07 06:22 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Andrew John Hughes 2008-11-16 01:33:32 UTC
Added debug info. to Classpath and a causal exception to StopBenchmarkException to get:

javax.crypto.KeyGenerator: init(168,java.security.SecureRandom@10ca0e0)
gnu.javax.crypto.jce.key.TripleDESKeyGeneratorImpl: init(168,java.security.SecureRandom@10ca0e0)
gnu.javax.crypto.jce.key.TripleDESKeyGeneratorImpl: init(21,java.security.SecureRandom@10ca0e0)
Error in setup of Benchmark.
spec.harness.StopBenchmarkException: Error invoking bmSetupBenchmarkMethod
   at spec.harness.ProgramRunner.invokeBmSetupBenchmark(ProgramRunner.java:185)
   at spec.harness.ProgramRunner.runBenchmark(ProgramRunner.java:301)
   at spec.harness.ProgramRunner.run(ProgramRunner.java:98)
   at java.lang.VMThread.run(VMThread.java:120)
Caused by: java.lang.reflect.InvocationTargetException
   at java.lang.reflect.VMMethod.invoke(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:331)
   at spec.harness.ProgramRunner.invokeBmSetupBenchmark(ProgramRunner.java:183)
   ...3 more
Caused by: spec.harness.StopBenchmarkException: Error in setup of crypto.aes.
   at spec.benchmarks.crypto.aes.Main.setupBenchmark(Main.java:165)
   at java.lang.reflect.VMMethod.invoke(Native Method)
   ...5 more
Caused by: java.security.InvalidParameterException: unsupported key size: 21, valid sizes are: [8, 16, 24]
   at gnu.javax.crypto.jce.key.SecretKeyGeneratorImpl.engineInit(SecretKeyGeneratorImpl.java:102)
   at javax.crypto.KeyGenerator.init(KeyGenerator.java:280)
   at spec.benchmarks.crypto.aes.Main.setupBenchmark(Main.java:161)
   ...6 more
Comment 1 Andrew John Hughes 2008-11-16 01:34:04 UTC
With CACAO + current GNU Classpath CVS
Comment 2 Casey Marshall 2008-11-16 05:24:33 UTC
I'm not sure what AES is supposed to do with 168-bit keys; the algorithm is supposed to only be defined for 128, 196, and 256-bit keys. Presumably someone's made up a procedure for using keys of this length in AES, but some quick searching didn't give me anything.

The JDK probably pads or truncates the key.
Comment 3 顏義洋 2018-05-07 06:22:40 UTC
I encounter the same problem

I found that it is actually caused by DES, in GNU Classpath supported DES key width are 64, 128 and 192.

I modified the SPECjvm 2008 crypto.aes benchmark src/spec/benchmarks/crypto/aes/Main.java

desKeySize from 168 to 128 would passed the test