Skip to content

Commit 4be47c8

Browse files
committed
Version 0.7.2
1 parent d84511a commit 4be47c8

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

examples/kem.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# key encapsulation Python example
22

3-
import pprint
43
import oqs
5-
pp = pprint.PrettyPrinter(sort_dicts=False)
4+
from pprint import pprint
65

76
#######################################################################
87
# KEM example
@@ -12,14 +11,14 @@
1211
print("liboqs-python version:", oqs.oqs_python_version())
1312
print("Enabled KEM mechanisms:")
1413
kems = oqs.get_enabled_KEM_mechanisms()
15-
pp.pprint(kems)
14+
pprint(kems, compact=True)
1615

1716
# create client and server with sample KEM mechanisms
1817
kemalg = "Kyber512"
1918
with oqs.KeyEncapsulation(kemalg) as client:
2019
with oqs.KeyEncapsulation(kemalg) as server:
2120
print("\nKey encapsulation details:")
22-
pp.pprint(client.details)
21+
pprint(client.details)
2322

2423
# client generates its keypair
2524
public_key = client.generate_keypair()

examples/sig.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# signature Python example
22

3-
import pprint
43
import oqs
5-
pp = pprint.PrettyPrinter(sort_dicts=False)
4+
from pprint import pprint
65

76
#######################################################################
87
# signature example
98
#######################################################################
109

1110
print("liboqs version:", oqs.oqs_version())
12-
print("liboqs-python version:", oqs.oqs_python_version())
11+
print("libboost-python version:", oqs.oqs_python_version())
1312
print("Enabled signature mechanisms:")
1413
sigs = oqs.get_enabled_sig_mechanisms()
15-
pp.pprint(sigs)
14+
pprint(sigs, compact=True)
1615

1716
message = "This is the message to sign".encode()
1817

@@ -21,7 +20,7 @@
2120
with oqs.Signature(sigalg) as signer:
2221
with oqs.Signature(sigalg) as verifier:
2322
print("\nSignature details:")
24-
pp.pprint(signer.details)
23+
pprint(signer.details)
2524

2625
# signer generates its keypair
2726
signer_public_key = signer.generate_keypair()

0 commit comments

Comments
 (0)