From 3881407ea8444c280d9659f40e6c169a1e10310d Mon Sep 17 00:00:00 2001 From: Michael Loftis Date: Tue, 18 Dec 2012 15:08:46 -0700 Subject: add ripemd160 support to crypto add ripemd160 message digest support to the crypto app, includes some test cases. --- lib/crypto/src/crypto.erl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/crypto/src/crypto.erl') diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index 461558a79e..69fecf4a11 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -25,6 +25,7 @@ -export([hash/2, hash_init/1, hash_update/2, hash_final/1]). -export([md4/1, md4_init/0, md4_update/2, md4_final/1]). -export([md5/1, md5_init/0, md5_update/2, md5_final/1]). +-export([ripemd160/1, ripemd160_init/0, ripemd160_update/2, ripemd160_final/1]). -export([sha/1, sha_init/0, sha_update/2, sha_final/1]). -export([sha224/1, sha224_init/0, sha224_update/2, sha224_final/1]). -export([sha256/1, sha256_init/0, sha256_update/2, sha256_final/1]). @@ -70,6 +71,7 @@ -define(FUNC_LIST, [md4, md4_init, md4_update, md4_final, md5, md5_init, md5_update, md5_final, + ripemd160, ripemd160_init, ripemd160_update, ripemd160_final, sha, sha_init, sha_update, sha_final, sha224, sha224_init, sha224_update, sha224_final, sha256, sha256_init, sha256_update, sha256_final, @@ -262,6 +264,20 @@ md4_init() -> ?nif_stub. md4_update(_Context, _Data) -> ?nif_stub. md4_final(_Context) -> ?nif_stub. +%% +%% RIPEMD160 +%% + +-spec ripemd160(iodata()) -> binary(). +-spec ripemd160_init() -> binary(). +-spec ripemd160_update(binary(), iodata()) -> binary(). +-spec ripemd160_final(binary()) -> binary(). + +ripemd160(_Data) -> ?nif_stub. +ripemd160_init() -> ?nif_stub. +ripemd160_update(_Context, _Data) -> ?nif_stub. +ripemd160_final(_Context) -> ?nif_stub. + %% %% SHA %% -- cgit v1.2.3