Skip to content

Commit

Permalink
xmr: bp - use sc_inv_into
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Aug 17, 2018
1 parent 5d505c4 commit 2c612e4
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/apps/monero/xmr/bulletproof.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
from apps.monero.xmr.serialize.int_serialize import dump_uvarint_b, dump_uvarint_b_into
from apps.monero.xmr.serialize_messages.tx_rsig_bulletproof import Bulletproof

# curve size
# 2**252 + 3*610042537739*15158679415041928064055629
ED25519_ORD = 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed


# Constants

BP_LOG_N = 6
Expand Down Expand Up @@ -127,11 +122,9 @@ def invert(dst, x):
:return:
"""
dst = _ensure_dst_key(dst)
xint = 0
xint = xint.from_bytes(x, "little")
xinv = mul_inverse_used(xint, ED25519_ORD)
buff = xinv.to_bytes(32, "little")
copy_key(dst, buff)
crypto.decodeint_into_noreduce(tmp_sc_1, x)
crypto.sc_inv_into(tmp_sc_2, tmp_sc_1)
crypto.encodeint_into(tmp_sc_2, dst)
return dst


Expand Down

0 comments on commit 2c612e4

Please sign in to comment.