mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-05 13:50:14 +00:00
14 lines
351 B
Python
14 lines
351 B
Python
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() |