Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.10.0 #79

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Version 0.10.0 - March 27, 2024

- Removed the NIST PRNG as the latter is no longer exposed by liboqs' public
API

# Version 0.9.0 - October 30, 2023

- This is a maintenance release, minor deprecation fixes
- Python minimum required version is enforced to Python 3.8 in `pyproject.toml`
- To follow Python conventions, renamed in `oqs/oqs.py`:
- `is_KEM_enabled()` -> `is_kem_enabled()`
- `get_enabled_KEM_mechanisms()` -> `get_enabled_kem_mechanisms()`
- `get_supported_KEM_mechanisms()` -> `get_supported_kem_mechanisms()`

# Version 0.8.0 - July 5, 2023

- This is a maintenance release, minor fixes
- Minimalistic Docker support
- Migrated installation method to `pyproject.toml`
- Removed AppVeyor and CircleCI, all continuous integration is now done via GitHub actions

# Version 0.7.2 - August 27, 2022

- Added library version retrieval functions:
- `oqs_version()`
- `oqs_python_version()`

# Version 0.7.1 - January 5, 2022

- Release numbering updated to match liboqs
- Added macOS support on CircleCI, we now support macOS & Linux (CircleCI) and Windows (AppVeyor)

# Version 0.4.0 - November 28, 2020

- Renamed 'master' branch to 'main'

# Version 0.3.0 - June 10, 2020

- The liboqs handle has now module-private visibility in `oqs.py` so clients can not access it directly; can be accessed via the new `oqs.native()` function
- Closing #7 [link](https://github.com/open-quantum-safe/liboqs-python/issues/7), all issues addressed
- Added AppVeyor continuous integration

# Version 0.2.1 - January 22, 2020

- Added a signature example
- Added partial support for RNGs from `<oqs/rand.h>`
- Added an RNG example

# Version 0.2.0 - October 8, 2019

- This release updates for compatibility with liboqs 0.2.0, which contains new/updated algorithms based on NIST Round 2 submissions.

# Version 0.1.0 - April 23, 2019

- Initial release
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Version 0.9.0 - October 30, 2023
is_KEM_enabled() -> is_kem_enabled()
get_enabled_KEM_mechanisms() -> get_enabled_kem_mechanisms()
get_supported_KEM_mechanisms() -> get_supported_kem_mechanisms()
- Removed the NIST PRNG as the later is no longer exposed by liboqs' public API

Version 0.8.0 - July 5, 2023
- This is a maintenance release, minor fixes
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2023 Open Quantum Safe
Copyright (c) 2018-2024 Open Quantum Safe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ cmake -S liboqs -B liboqs/build -DCMAKE_INSTALL_PREFIX="C:\liboqs" -DBUILD_SHARE
Execute in a Terminal/Console/Administrator Command Prompt

```shell
python3 -mvenv venv
python3 -mvenv venv
. venv/bin/activate
python3 -m ensurepip --upgrade
```
Expand Down Expand Up @@ -185,7 +185,7 @@ In case you want to use the Docker container as a development environment, mount
container with

```shell
docker run --rm -it --workdir=/app -v ${PWD}:/app oqs-python /bin/bash
docker run --rm -it --workdir=/app -v ${PWD}:/app oqs-python /bin/bash
```

A more comprehensive Docker example is provided in the
Expand Down Expand Up @@ -232,7 +232,7 @@ and [Michele Mosca](http://faculty.iqc.uwaterloo.ca/mmosca/) at the University o
Contributors to the liboqs-python wrapper include:

- Ben Davies (University of Waterloo)
- Vlad Gheorghiu (softwareQ Inc., University of Waterloo)
- Vlad Gheorghiu ([softwareQ Inc.](https://www.softwareq.ca) and the University of Waterloo)
- Christian Paquin (Microsoft Research)
- Douglas Stebila (University of Waterloo)

Expand Down
34 changes: 19 additions & 15 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
# liboqs-python version 0.9.0
# liboqs-python version 0.10.0

---

## About

The **Open Quantum Safe (OQS) project** has the goal of developing and prototyping quantum-resistant cryptography. More
information on OQS can be found on our website https://openquantumsafe.org/ and on GitHub
at https://github.com/open-quantum-safe/.
The **Open Quantum Safe (OQS) project** has the goal of developing and
prototyping quantum-resistant cryptography. More information on OQS can be
found on our website https://openquantumsafe.org/ and on GitHub at
https://github.com/open-quantum-safe/.

**liboqs** is an open source C library for quantum-resistant cryptographic algorithms. See more about liboqs
at [https://github.com/open-quantum-safe/liboqs/](https://github.com/open-quantum-safe/liboqs/), including a list of
supported algorithms.
**liboqs** is an open source C library for quantum-resistant cryptographic
algorithms. See more about liboqs at
[https://github.com/open-quantum-safe/liboqs/](https://github.com/open-quantum-safe/liboqs/),
including a list of supported algorithms.

**liboqs-python** is an open source Python 3 wrapper for the liboqs C library for quantum-resistant cryptographic
algorithms. Details about liboqs-python can be found
in [README.md](https://github.com/open-quantum-safe/liboqs-python/blob/main/README.md). See in particular limitations on
intended use.
**liboqs-python** is an open source Python 3 wrapper for the liboqs C library
for quantum-resistant cryptographic algorithms. Details about liboqs-python can
be found in
[README.md](https://github.com/open-quantum-safe/liboqs-python/blob/main/README.md).
See in particular limitations on intended use.

---

## Release notes

This release of liboqs-python was released on October 30, 2023. Its release page on GitHub
is https://github.com/open-quantum-safe/liboqs-python/releases/tag/0.9.0.
This release of liboqs-python was released on October 30, 2023. Its release
page on GitHub is
https://github.com/open-quantum-safe/liboqs-python/releases/tag/0.9.0.

---

## What's New

This is the 9th release of liboqs-python. For a list of changes
see [CHANGES.txt](https://github.com/open-quantum-safe/liboqs-python/blob/main/CHANGES.txt).
This is the 10th release of liboqs-python. For a list of changes see
[CHANGES.txt](https://github.com/open-quantum-safe/liboqs-python/blob/main/CHANGES.txt).
23 changes: 11 additions & 12 deletions examples/kem.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
# key encapsulation Python example
# Key encapsulation Python example

import oqs
from pprint import pprint

#######################################################################
# KEM example
#######################################################################

print("liboqs version:", oqs.oqs_version())
print("liboqs-python version:", oqs.oqs_python_version())
print("Enabled KEM mechanisms:")
kems = oqs.get_enabled_kem_mechanisms()
pprint(kems, compact=True)

# create client and server with sample KEM mechanisms
# Create client and server with sample KEM mechanisms
kemalg = "Kyber512"
with oqs.KeyEncapsulation(kemalg) as client:
with oqs.KeyEncapsulation(kemalg) as server:
print("\nKey encapsulation details:")
pprint(client.details)

# client generates its keypair
# Client generates its keypair
public_key_client = client.generate_keypair()
# optionally, the secret key can be obtained by calling export_secret_key()
# Optionally, the secret key can be obtained by calling export_secret_key()
# and the client can later be re-instantiated with the key pair:
# secret_key_client = client.export_secret_key()
# store key pair, wait... (session resumption):

# Store key pair, wait... (session resumption):
# client = oqs.KeyEncapsulation(kemalg, secret_key_client)

# the server encapsulates its secret using the client's public key
# The server encapsulates its secret using the client's public key
ciphertext, shared_secret_server = server.encap_secret(public_key_client)

# the client decapsulates the server's ciphertext to obtain the shared secret
# The client decapsulates the server's ciphertext to obtain the shared secret
shared_secret_client = client.decap_secret(ciphertext)

print("\nShared secretes coincide:", shared_secret_client == shared_secret_server)
print(
"\nShared secretes coincide:", shared_secret_client == shared_secret_server
)
22 changes: 12 additions & 10 deletions examples/rand.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# various RNGs Python example
# Various RNGs Python example

import platform # to learn the OS we're on
import oqs.rand as oqsrand # must be explicitly imported
from oqs import oqs_version, oqs_python_version

#######################################################################
# randomness example
#######################################################################

print("liboqs version:", oqs_version())
print("liboqs-python version:", oqs_python_version())

# we do not yet support OpenSSL under Windows
oqsrand.randombytes_switch_algorithm("system")
print(
"{:17s}".format("System (default):"),
" ".join("{:02X}".format(x) for x in oqsrand.randombytes(32)),
)

# We do not yet support OpenSSL under Windows
if platform.system() != "Windows":
oqsrand.randombytes_switch_algorithm("OpenSSL")
print('{:17s}'.format("OpenSSL:"), ' '.join('{:02X}'.format(x) for x in oqsrand.randombytes(32)))

oqsrand.randombytes_switch_algorithm("system")
print('{:17s}'.format("System (default):"), ' '.join('{:02X}'.format(x) for x in oqsrand.randombytes(32)))
print(
"{:17s}".format("OpenSSL:"),
" ".join("{:02X}".format(x) for x in oqsrand.randombytes(32)),
)
19 changes: 8 additions & 11 deletions examples/sig.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# signature Python example
# Signature Python example

import oqs
from pprint import pprint

#######################################################################
# signature example
#######################################################################

print("liboqs version:", oqs.oqs_version())
print("liboqs-python version:", oqs.oqs_python_version())
print("Enabled signature mechanisms:")
Expand All @@ -15,25 +11,26 @@

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

# create signer and verifier with sample signature mechanisms
# Create signer and verifier with sample signature mechanisms
sigalg = "Dilithium2"
with oqs.Signature(sigalg) as signer:
with oqs.Signature(sigalg) as verifier:
print("\nSignature details:")
pprint(signer.details)

# signer generates its keypair
# Signer generates its keypair
signer_public_key = signer.generate_keypair()
# optionally, the secret key can be obtained by calling export_secret_key()
# Optionally, the secret key can be obtained by calling export_secret_key()
# and the signer can later be re-instantiated with the key pair:
# secret_key = signer.export_secret_key()
# store key pair, wait... (session resumption):

# Store key pair, wait... (session resumption):
# signer = oqs.Signature(sigalg, secret_key)

# signer signs the message
# Signer signs the message
signature = signer.sign(message)

# verifier verifies the signature
# Verifier verifies the signature
is_valid = verifier.verify(message, signature, signer_public_key)

print("\nValid signature?", is_valid)
Loading
Loading