I need to calculate a SHA-256 hash of a large file (or portion of it). My implementation works fine, but its much slower than the C++\'s CryptoPP calculation (25 Min. vs. 10
It used to be that Java ran about 10x slower than the same C++ code. Nowadays is closer to 2x slower. I think what your running into is just a fundamental part of Java. JVMs will get faster, especially as new JIT techniques are discovered, but you'll have a hard time out performing C.
Have you tried alternative JVMs and/or compilers? I used to get better performance with JRocket, but less stability. Ditto for using jikes over javac.