Skip to content

Commit abdb4d7

Browse files
ashcherbakovandkononykhin
authored andcommitted
Fix bls generator (#400)
* use correct generator for new BLS elliptic curve * fix static code validation errors * fix libindy dependency in tests * fix libindy dependency in tests * fix libindy dependency in tests * fix libindy dependency in tests * fix libindy dependency in tests
1 parent f81b5e8 commit abdb4d7

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

ci/ubuntu.dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ RUN pip3 install -U \
2020
virtualenv
2121
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88
2222
RUN echo "deb https://repo.sovrin.org/deb xenial master" >> /etc/apt/sources.list
23-
RUN apt-get update -y && apt-get install -y libindy-crypto
23+
RUN apt-get update -y && apt-get install -y libindy-crypto=0.1.6
2424
RUN useradd -ms /bin/bash -u $uid $user
2525
USER $user
2626
RUN virtualenv -p python3.5 /home/$user/test
2727
USER root
2828
RUN ln -sf /home/$user/test/bin/python /usr/local/bin/python
2929
RUN ln -sf /home/$user/test/bin/pip /usr/local/bin/pip
30-
RUN wget https://repo.evernym.com/libindy_crypto/ubuntu/stable/0.1.2/libindy-crypto_0.1.2_amd64.deb
31-
RUN dpkg -i ./libindy-crypto_0.1.2_amd64.deb
3230
USER $user
3331
# TODO: Automate dependency collection
3432
RUN pip install jsonpickle \
@@ -52,6 +50,5 @@ RUN pip install jsonpickle \
5250
ioflo==1.5.4 \
5351
psutil \
5452
intervaltree \
55-
pytest-xdist \
56-
python3-indy-crypto==0.1.2
53+
pytest-xdist
5754
WORKDIR /home/$user

crypto/bls/indy_crypto/bls_crypto_indy_crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class BlsGroupParamsLoaderIndyCrypto(BlsGroupParamsLoader):
99
def load_group_params(self) -> GroupParams:
1010
group_name = 'generator'
11-
g = "7BRrJUcxuAomyoBC7YkvRD9TpFrcGoYAT9BQhhxuNB4FFjNPffimLywJViQRJAPnP97PQxCHTiEBTu6KuYV7trC4Ez3eRz7QSnKUwd5KqG9PxQaFaNaJyFv8uAXQgm3Q7nkEqjjKrCKdWmj89ZmAG848Ucn2v6bqhNmShEH9ARQqxhozXbmBy68oa6eh1vxs3DYenGgeWnjCCueBbR7vrMB9ATJBpCuPg25KWXjyh6KqnLsZfcRdst4NzuAmS8NzBPSvW6"
11+
g = "3LHpUjiyFC2q2hD7MnwwNmVXiuaFbQx2XkAFJWzswCjgN1utjsCeLzHsKk1nJvFEaS4fcrUmVAkdhtPCYbrVyATZcmzwJReTcJqwqBCPTmTQ9uWPwz6rEncKb2pYYYFcdHa8N17HzVyTqKfgPi4X9pMetfT3A5xCHq54R2pDNYWVLDX"
1212
return GroupParams(group_name, g)
1313

1414

crypto/test/bls/indy_crypto/test_bls_crypto_indy_crypto.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ def test_generate_keys_bytes_seed_32bit(default_params):
8585
assert sk != pk
8686

8787

88+
def test_generate_keys_str_seed_32bit_for_nodes(default_params):
89+
seeds = []
90+
nodes_count = 4
91+
for i in range(1, nodes_count + 1):
92+
name = "Node" + str(i)
93+
seed = ('0' * (32 - len(name)) + name)
94+
seeds.append(seed)
95+
96+
pks = set()
97+
for i in range(nodes_count):
98+
sk, pk = BlsCryptoIndyCrypto.generate_keys(default_params, seeds[i])
99+
pks.add(pk)
100+
print(pk)
101+
102+
assert len(pks) == nodes_count
103+
104+
88105
def test_generate_different_keys(default_params):
89106
seed2 = 'Seed' + '0' * (48 - len('Seed'))
90107
seed3 = 'seeeed' + '0' * (48 - len('seeeed'))

0 commit comments

Comments
 (0)