mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-20 15:20:59 -04:00
Added internal python-only implementation of Ed25519
This commit is contained in:
parent
34efbc6100
commit
e0b795b4d0
12 changed files with 845 additions and 37 deletions
|
@ -1,14 +1,20 @@
|
|||
import hashlib
|
||||
|
||||
"""
|
||||
The SHA primitives are 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.
|
||||
"""
|
||||
|
||||
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()
|
||||
return digest.digest()
|
||||
|
||||
def sha512(data):
|
||||
digest = hashlib.sha512()
|
||||
digest.update(data)
|
||||
|
||||
return digest.digest()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue