[fpc-devel] Implementing SHA256 Unit.
Garry Wood
garry at softoz.com.au
Sun Mar 20 02:11:02 CET 2016
>I'm trying to write a sha256 implementation in pure pascal like sha1 and md5 units.
>With negative results.
>Someone can helpme with this?
I recently ported the implementation from LibTimCrypt / wpa_supplicant (which are both from public domain implementations), you can find the unit here:
https://github.com/ultibohub/Core/blob/master/source/rtl/ultibo/core/crypto.pas
This is for our Ultibo embedded project but the code is pure pascal and should compile for any platform if you adjust the uses clause.
This has been validated against a number of test vectors available from different sources and seems correct although I can’t test on big endian CPU at present. The unit also includes ports of AES, DES, DES3 and RC4 ciphers as well as MD5 and SHA1.
Cheers,
Garry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20160320/b0a5911b/attachment.html>
More information about the fpc-devel
mailing list