Skip to content

Commit

Permalink
Only render info about insecure impls if we have them
Browse files Browse the repository at this point in the history
  • Loading branch information
thomwiggers committed Oct 16, 2023
1 parent cfe44a1 commit b00207b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 3 additions & 0 deletions generate-implementations.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def generate_pqcrypto_crate(implementations):
target_dir = 'pqcrypto'
shutil.rmtree(target_dir)
os.makedirs(os.path.join(target_dir, 'src'))
any_insecure = any(kem.get('insecure') for (_name, kem) in implementations['kems'].items())
any_insecure |= any(sig.get('insecure') for (_name, sig) in implementations['signs'].items())

render_template(
target_dir, 'Cargo.toml', "pqcrypto/Cargo.toml.j2",
Expand All @@ -152,6 +154,7 @@ def generate_pqcrypto_crate(implementations):
target_dir, 'README.md', 'pqcrypto/README.md.j2',
kems=implementations['kems'],
signs=implementations['signs'],
any_insecure=any_insecure,
)
shutil.copytree(
"pqcrypto-template/pqcrypto/examples",
Expand Down
2 changes: 2 additions & 0 deletions pqcrypto-template/pqcrypto/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ This project contains Post-Quantum cryptographic algorithms that participate in
the [NIST PQC standardization effort][nistpqc]. It is currently a collection of
wrappers around C implementations from the [PQClean][pqclean] project.

{% if any_insecure %}
## Insecure algorithms

This crate contains optional support for insecure algorithms. They can be enabled via the
``cryptographically-insecure`` flag.

This crate also contains algorithms that have non-constant time implementations.
Always check the relevant algorithms for their security details.
{% endif %}

## Included algorithms

Expand Down
7 changes: 0 additions & 7 deletions pqcrypto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ This project contains Post-Quantum cryptographic algorithms that participate in
the [NIST PQC standardization effort][nistpqc]. It is currently a collection of
wrappers around C implementations from the [PQClean][pqclean] project.

## Insecure algorithms

This crate contains optional support for insecure algorithms. They can be enabled via the
``cryptographically-insecure`` flag.

This crate also contains algorithms that have non-constant time implementations.
Always check the relevant algorithms for their security details.

## Included algorithms

Expand Down

0 comments on commit b00207b

Please sign in to comment.