Added internal abstraction to SHA-256
This commit is contained in:
parent
715a84c6f2
commit
d24f3a490a
14
RNS/Cryptography/Hashes.py
Normal file
14
RNS/Cryptography/Hashes.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import hashlib
|
||||||
|
|
||||||
|
|
||||||
|
def sha256(data):
|
||||||
|
"""
|
||||||
|
The SHA-256 primitive is abstracted here to allow platform-
|
||||||
|
aware hardware acceleration in the future. Currently only
|
||||||
|
uses Python's internal SHA-256 implementation. All SHA-256
|
||||||
|
calls in RNS end up here.
|
||||||
|
"""
|
||||||
|
digest = hashlib.sha256()
|
||||||
|
digest.update(data)
|
||||||
|
|
||||||
|
return digest.digest()
|
Loading…
Reference in New Issue
Block a user