Rename sapling_utils.py to utils.py.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
a7a1e5b217
commit
929692ecdc
2
ff1.py
2
ff1.py
|
@ -7,7 +7,7 @@ from binascii import unhexlify, hexlify
|
|||
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
|
||||
from cryptography.hazmat.backends import default_backend
|
||||
|
||||
from sapling_utils import bebs2ip, i2bebsp, beos2ip, bebs2osp, cldiv
|
||||
from utils import bebs2ip, i2bebsp, beos2ip, bebs2osp, cldiv
|
||||
|
||||
# Morris Dworkin
|
||||
# NIST Special Publication 800-38G
|
||||
|
|
|
@ -4,7 +4,7 @@ import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
|||
from orchard_group_hash import group_hash
|
||||
from orchard_pallas import Fp, Scalar
|
||||
from orchard_sinsemilla import sinsemilla_hash_to_point
|
||||
from sapling_utils import i2lebsp
|
||||
from utils import i2lebsp
|
||||
|
||||
# Commitment schemes used in Orchard https://zips.z.cash/protocol/nu5.pdf#concretecommit
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import orchard_iso_pallas
|
|||
from pyblake2 import blake2b
|
||||
from orchard_pallas import Fp, p, q, PALLAS_B, Point
|
||||
from orchard_iso_pallas import PALLAS_ISO_B, PALLAS_ISO_A
|
||||
from sapling_utils import i2beosp, cldiv, beos2ip, i2leosp, lebs2ip
|
||||
from utils import i2beosp, cldiv, beos2ip, i2leosp, lebs2ip
|
||||
from tv_output import render_args, render_tv
|
||||
from tv_rand import Rand
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
from orchard_group_hash import map_to_curve_simple_swu
|
||||
from orchard_iso_pallas import Point as IsoPoint
|
||||
from orchard_pallas import Fp
|
||||
from sapling_utils import leos2ip
|
||||
from utils import leos2ip
|
||||
from tv_output import render_args, render_tv
|
||||
from tv_rand import Rand
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from binascii import unhexlify
|
|||
from orchard_pallas import Fp
|
||||
from orchard_sinsemilla import sinsemilla_hash
|
||||
|
||||
from sapling_utils import i2lebsp, leos2bsp
|
||||
from utils import i2lebsp, leos2bsp
|
||||
|
||||
# https://zips.z.cash/protocol/nu5.pdf#constants
|
||||
MERKLE_DEPTH = 32
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
||||
|
||||
from sapling_jubjub import FieldElement
|
||||
from sapling_utils import leos2ip
|
||||
from utils import leos2ip
|
||||
|
||||
p = 0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001
|
||||
q = 0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from orchard_pallas import Fp
|
||||
import numpy as np
|
||||
from sapling_utils import leos2ip
|
||||
from utils import leos2ip
|
||||
from tv_output import render_args, render_tv
|
||||
from tv_rand import Rand
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from orchard_pallas import Fp
|
||||
from orchard_poseidon import perm
|
||||
from sapling_utils import leos2ip
|
||||
from utils import leos2ip
|
||||
from tv_output import render_args, render_tv
|
||||
from tv_rand import Rand
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import math
|
|||
import orchard_iso_pallas
|
||||
|
||||
from orchard_pallas import Fp, Point
|
||||
from sapling_utils import cldiv, lebs2ip, i2leosp
|
||||
from utils import cldiv, lebs2ip, i2leosp
|
||||
from orchard_group_hash import group_hash
|
||||
from tv_output import render_args, render_tv
|
||||
from tv_rand import Rand
|
||||
|
|
|
@ -5,7 +5,7 @@ from pyblake2 import blake2s
|
|||
|
||||
from sapling_jubjub import Point, JUBJUB_COFACTOR
|
||||
from tv_output import render_args, render_tv
|
||||
from sapling_utils import i2leosp
|
||||
from utils import i2leosp
|
||||
|
||||
# First 64 bytes of the BLAKE2s input during group hash.
|
||||
# This is chosen to be some random string that we couldn't have
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
||||
|
||||
from sapling_utils import i2lebsp, leos2ip, i2leosp
|
||||
from utils import i2lebsp, leos2ip, i2leosp
|
||||
|
||||
q_j = 52435875175126190479447740508185965837690552500527637822603658699938581184513
|
||||
r_j = 6554484396890773809930967563523245729705921265872317281365359162392183254199
|
||||
|
|
|
@ -7,7 +7,7 @@ from sapling_generators import PROVING_KEY_BASE, SPENDING_KEY_BASE, group_hash
|
|||
from sapling_jubjub import Fr
|
||||
from sapling_merkle_tree import MERKLE_DEPTH
|
||||
from sapling_notes import note_commit, note_nullifier
|
||||
from sapling_utils import leos2bsp, leos2ip
|
||||
from utils import leos2bsp, leos2ip
|
||||
from tv_output import render_args, render_tv
|
||||
|
||||
#
|
||||
|
|
|
@ -4,7 +4,7 @@ import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
|||
from binascii import unhexlify
|
||||
|
||||
from sapling_pedersen import pedersen_hash
|
||||
from sapling_utils import i2lebsp, leos2bsp
|
||||
from utils import i2lebsp, leos2bsp
|
||||
|
||||
MERKLE_DEPTH = 32
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ from sapling_generators import VALUE_COMMITMENT_VALUE_BASE, VALUE_COMMITMENT_RAN
|
|||
from sapling_jubjub import Fr, JUBJUB_COFACTOR
|
||||
from sapling_key_components import SpendingKey, diversify_hash
|
||||
from sapling_notes import note_commit
|
||||
from sapling_utils import leos2bsp, leos2ip
|
||||
from utils import leos2bsp, leos2ip
|
||||
from tv_output import render_args, render_tv
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ from sapling_pedersen import (
|
|||
mixing_pedersen_hash,
|
||||
windowed_pedersen_commitment,
|
||||
)
|
||||
from sapling_utils import i2lebsp
|
||||
from utils import i2lebsp
|
||||
|
||||
def note_commit(rcm, g_d, pk_d, v):
|
||||
return windowed_pedersen_commitment(rcm, [1] * 6 + i2lebsp(64, v) + g_d + pk_d)
|
||||
|
|
|
@ -7,7 +7,7 @@ from sapling_generators import (
|
|||
WINDOWED_PEDERSEN_RANDOMNESS_BASE,
|
||||
)
|
||||
from sapling_jubjub import Fr, Point
|
||||
from sapling_utils import cldiv, i2leosp
|
||||
from utils import cldiv, i2leosp
|
||||
|
||||
|
||||
#
|
||||
|
|
|
@ -7,7 +7,7 @@ from pyblake2 import blake2b
|
|||
from sapling_generators import SPENDING_KEY_BASE
|
||||
from sapling_jubjub import Fr, Point, r_j
|
||||
from sapling_key_components import to_scalar
|
||||
from sapling_utils import cldiv, leos2ip
|
||||
from utils import cldiv, leos2ip
|
||||
from tv_output import render_args, render_tv
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from pyblake2 import blake2b
|
|||
|
||||
from sapling_key_components import to_scalar, prf_expand, diversify_hash, DerivedAkNk, DerivedIvk
|
||||
from sapling_generators import SPENDING_KEY_BASE, PROVING_KEY_BASE
|
||||
from sapling_utils import i2leosp, i2lebsp, lebs2osp
|
||||
from utils import i2leosp, i2lebsp, lebs2osp
|
||||
from ff1 import ff1_aes256_encrypt
|
||||
from tv_output import render_args, render_tv, option, Some
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import struct
|
|||
|
||||
from sapling_generators import find_group_hash, SPENDING_KEY_BASE
|
||||
from sapling_jubjub import Fq, Point
|
||||
from sapling_utils import leos2ip
|
||||
from utils import leos2ip
|
||||
from zc_utils import write_compact_size
|
||||
|
||||
MAX_MONEY = 21000000 * 100000000
|
||||
|
|
Loading…
Reference in New Issue