Remove last pieces of code from the reference implementation of ed25519

pynacl
Michał Sałaban 2 years ago
parent d3a6a8f470
commit 25b1a9dc89

@ -41,13 +41,10 @@ Copyright (c) 2017-2018 Michał Sałaban <michal@salaban.info> and Contributors:
Copyright (c) 2016 The MoneroPy Developers (``monero/base58.py`` taken from `MoneroPy`_)
Copyright (c) 2011-2013 `pyca/ed25519`_ Developers (``monero/ed25519.py``)
Copyright (c) 2011 thomasv@gitorious (``monero/seed.py`` based on `Electrum`_)
.. _`LICENSE.txt`: LICENSE.txt
.. _`MoneroPy`: https://github.com/bigreddmachine/MoneroPy
.. _`pyca/ed25519`: https://github.com/pyca/ed25519
.. _`Electrum`: https://github.com/spesmilo/electrum
.. _`lalanza808`: https://github.com/lalanza808

@ -3,14 +3,12 @@ Authors
* Michał Sałaban <michal@salaban.info>
* MoneroPy Developers (``monero/base58.py`` taken from `MoneroPy`_)
* `pyca/ed25519`_ Developers (``monero/ed25519.py``)
* thomasv@gitorious (``monero/seed.py`` based on `Electrum`_)
* and other Contributors: `lalanza808`_, `cryptochangements34`_, `atward`_, `rooterkyberian`_, `brucexiu`_, `lialsoftlab`_, `moneroexamples`_, `massanchik`_, `MrClottom`_, `jeffro256`_, `sometato`_.
.. _`LICENSE.txt`: LICENSE.txt
.. _`MoneroPy`: https://github.com/bigreddmachine/MoneroPy
.. _`pyca/ed25519`: https://github.com/pyca/ed25519
.. _`Electrum`: https://github.com/spesmilo/electrum
.. _`lalanza808`: https://github.com/lalanza808

@ -1,22 +1,5 @@
import binascii
import nacl.bindings
import six
def bit(h, i):
return (six.indexbytes(h, i // 8) >> (i % 8)) & 1
def encodeint(y):
bits = [(y >> i) & 1 for i in range(256)]
return b"".join(
[six.int2byte(sum([bits[i * 8 + j] << j for j in range(8)])) for i in range(32)]
)
def decodeint(s):
return sum(2 ** i * bit(s, i) for i in range(0, 256))
edwards_add = nacl.bindings.crypto_core_ed25519_add
inv = nacl.bindings.crypto_core_ed25519_scalar_invert

Loading…
Cancel
Save