Skip to content

Commit a3e5356

Browse files
author
Dmitry Surnin
committed
Merge remote-tracking branch 'origin/master' into file-struct
2 parents cde6d56 + abdb4d7 commit a3e5356

File tree

5 files changed

+21
-42
lines changed

5 files changed

+21
-42
lines changed

build-scripts/ubuntu-1604/build-3rd-parties.sh

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,6 @@ function build_from_pypi {
3838
rm ${PREREM_TMP}
3939
}
4040

41-
function build_indy_crypto {
42-
PACKAGE_NAME=$1
43-
44-
if [ -z $2 ]; then
45-
PACKAGE_VERSION=""
46-
else
47-
PACKAGE_VERSION="==$2"
48-
fi
49-
POSTINST_TMP=postinst-${PACKAGE_NAME}
50-
PREREM_TMP=prerm-${PACKAGE_NAME}
51-
cp postinst ${POSTINST_TMP}
52-
cp prerm ${PREREM_TMP}
53-
sed -i 's/{package_name}/'${PACKAGE_NAME}'/' ${POSTINST_TMP}
54-
sed -i 's/{package_name}/'${PACKAGE_NAME}'/' ${PREREM_TMP}
55-
56-
fpm --input-type "python" \
57-
--output-type "deb" \
58-
--architecture "amd64" \
59-
--verbose \
60-
--python-bin "/usr/bin/python3" \
61-
--exclude "*.pyc" \
62-
--exclude "*.pyo" \
63-
--maintainer "Hyperledger <[email protected]>" \
64-
--after-install ${POSTINST_TMP} \
65-
--before-remove ${PREREM_TMP} \
66-
--package ${OUTPUT_PATH} \
67-
--depends libindy-crypto \
68-
--name ${PACKAGE_NAME} \
69-
${PACKAGE_NAME}${PACKAGE_VERSION}
70-
71-
rm ${POSTINST_TMP}
72-
rm ${PREREM_TMP}
73-
}
74-
7541
build_from_pypi ioflo 1.5.4
7642
build_from_pypi orderedset 2.0
7743
build_from_pypi base58 0.2.4
@@ -83,4 +49,3 @@ build_from_pypi pyzmq 16.0.2
8349
build_from_pypi intervaltree 2.1.0
8450
build_from_pypi portalocker 0.5.7
8551
build_from_pypi sortedcontainers 1.5.7
86-
build_indy_crypto python3-indy-crypto 0.1.2

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'))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
'ioflo==1.5.4', 'semver', 'base58', 'orderedset',
7272
'sortedcontainers==1.5.7', 'psutil', 'pip',
7373
'portalocker==0.5.7', 'pyzmq', 'raet',
74-
'psutil', 'intervaltree', 'msgpack-python==0.4.6', 'python3-indy-crypto==0.1.2'],
74+
'psutil', 'intervaltree', 'msgpack-python==0.4.6', 'indy-crypto==0.1.6'],
7575
extras_require={
7676
'stats': ['python-firebase'],
7777
'benchmark': ['pympler']

0 commit comments

Comments
 (0)