Skip to content

Commit a2776fc

Browse files
author
Christophe Oosterlynck
committed
Merge branch 'hash_module'
2 parents aaf5cc8 + 3594fc0 commit a2776fc

25 files changed

+2686
-14
lines changed

src/CryptoPlus/Hash.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/CryptoPlus/Hash/RIPEMD.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from Crypto.Hash import RIPEMD
2+
3+
def new(data=""):
4+
"""Create a new RIPEMD-160 hash object
5+
6+
data = initial input (raw string) to the hashing object
7+
if present, the method call update(arg) is made
8+
9+
EXAMPLE:
10+
=========
11+
12+
>>> from CryptoPlus.Hash import RIPEMD
13+
14+
>>> message = "abc"
15+
>>> hasher = RIPEMD.new()
16+
>>> hasher.update(message)
17+
>>> hasher.hexdigest()
18+
'8eb208f7e05d987a9b044a8e98c6b087f15a0bfc'
19+
20+
>>> message = "message digest"
21+
>>> hasher = RIPEMD.new()
22+
>>> hasher.update(message)
23+
>>> hasher.hexdigest()
24+
'5d0689ef49d2fae572b881b123a85ffa21595f36'
25+
"""
26+
return RIPEMD.new(data)

src/CryptoPlus/Hash/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# hash functions of pycrypto can be just imported
2+
# wrapping might be a better idea if docstrings need to be expanded
3+
# wrapping in Cipher was needed to make the new chaining modes available
4+
from Crypto.Hash import SHA, SHA256, MD5, MD2, MD4, HMAC
5+
6+
__all__ = ["SHA","SHA256","MD5","MD2","MD4","HMAC","RIPEMD"]
7+

0 commit comments

Comments
 (0)