Extend cryptographic module with hash functions.

Add hash function to cryptographic module for signing
messages and fix minor code mistakes.

Signed-off-by: Krzysztof Opasiak <ups100@tlen.pl>