On 20/04/2010 01:18, Oliver Yang wrote:
Does anyone knows that the kernel API who can do MD5 digest in Solaris
kernel?
Are you developing a protocol that requires the use of MD5 ? If not
then I highly recommend not using MD5 but instead using SHA-256, to use
SHA-256 change all references below from md5/MD5 to sha2/SHA2.
#include <sys/md5.h>
Then you can use MD5Init(), MD5Update(), MD5Final(). However in the
kernel those are considered Consolidation Private APIs to the ON
consolidation.
Note also that on current UltraSPARC T2 hardware (or x86 with add in
cards such as the CA-500/1000/4000/6000) those APIs will not attempt to
use hardware acceleration.
To get hardware acceleration you must use the (also Contracted
Consolidation Private) KCF API.
#include <sys/crypto/api.h>
Then you can call crypto_digest() - see the following link for the API.
http://src.opensolaris.org/source/xref/crypto/man-pages/man/catman9f/crypto_digest.9f
Note that the KCF API is considered Consolidation Private to the ON
consolidation and could be changed at any time without warning to anyone
developing kernel components outside of the ON consolidation. If your
component is in ON that is fine.
If you need more information on crypto algorithms use in the OpenSolaris
kernel please ask on crypto-disc...@opensolaris.org or feel free to
contact me directly at my internal Oracle email address.
--
Darren J Moffat
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code