From 42e65ffe5f2659d998ff0a7e5ebea2573c23a86f Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 16 Aug 2012 16:38:31 +0200 Subject: crypto: Add more generic hash interface --- lib/crypto/doc/src/crypto.xml | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'lib/crypto/doc/src/crypto.xml') diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 36f8bc6deb..0d78dbc426 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -255,6 +255,57 @@ Mpint() = >]]> the computed SHA message digest.

+ + hash(Type, Data) -> Digest + + + Type = md4 | md5 | sha | sha224 | sha256 | sha384 | sha512 + Data = iodata() + Digest = binary() + + +

Computes a message digest of type Type from Data.

+
+
+ + hash_init(Type) -> Context + + + Type = md4 | md5 | sha | sha224 | sha256 | sha384 | sha512 + + +

Initializes the context for streaming hash operations. Type determines + which digest to use. The returned context should be used as argument + to hash_update.

+
+
+ + hash_update(Context, Data) -> NewContext + + + Data = iodata() + + +

Updates the digest represented by Context using the given Data. Context + must have been generated using hash_init + or a previous call to this function. Data can be any length. NewContext + must be passed into the next call to hash_update + or hash_final.

+
+
+ + hash_final(Context) -> Digest + + + Digest = binary() + + +

Finalizes the hash operation referenced by Context returned + from a previous call to hash_update. + The size of Digest is determined by the type of hash + function used to generate it.

+
+
md5_mac(Key, Data) -> Mac Compute an MD5 MACmessage authentification code -- cgit v1.2.3