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

Take stock of all algorithms #892

Closed
baentsch opened this issue Feb 3, 2021 · 38 comments
Closed

Take stock of all algorithms #892

baentsch opened this issue Feb 3, 2021 · 38 comments
Assignees
Milestone

Comments

@baentsch
Copy link
Member

baentsch commented Feb 3, 2021

This issue to capture what we discussed today (also for the benefit of @christianpaquin):

  • Create a current view as to where we stand for each algorithm (round3 readiness, code level, etc.)
  • Decide whether/how to parcel out work to arrive at 0.5 release readiness (incl. whether/how to address common code issues as per Take stock of common code #849).
  • Probably also list release-criteria for 0.5 (not discussed today but in a previous meeting).

@dstebila @xvzcf are working on this.

@baentsch baentsch added this to the 0.5.0 RC1 milestone Feb 3, 2021
@dstebila
Copy link
Member

Here is a draft of a YML file showing the information to be collected about an algorithm and its implementations.

name: FrodoKEM
type: kem
principal-submitters:
  - Michael Naehrig
  - Erdem Alkim
  - Joppe Bos
  - Léo Ducas
  - Karen Easterbrook
  - Brian LaMacchia
  - Patrick Longa
  - Ilya Mironov
  - Valeria Nikolaenko
  - Christopher Peikert
  - Ananth Raghunathan
  - Douglas Stebila
auxiliary-submitters: []
crypto_assumption: learning with errors (LWE)
website: https://frodokem.org/
nist-round: 3
variants:
  - name: FrodoKEM-640-AES
    claimed-nist-level: 1
    claimed-security: IND-CCA2
    length-public-key: 9616
    length-ciphertext: 9720
    length-secret-key: 19888
    length-shared-secret: 16
    supported_configurations:
      - 
        platforms: [Linux x86, macOS x86, Windows x86]
        builds:
          - build: portable
            comments: portable C with optional use of AVX2 and AESNI instructions (selected at compile-time, enabled by default if available)
            cpu_features: [AVX2, AESNI]
            common_crypto:
              - AES: liboqs
              - SHA2: liboqs
            implementation: based on https://github.com/microsoft/PQCrypto-LWEKE/commit/669522db63850fa64d1a24a47e138e80a59349db optimized implementation
            no_secret_dependent_branching_claimed: true
            no_secret_dependent_branching_checked_by_valgrind: true
            large_stack_usage: false (this is where we might say an algorithm has large stack usage and may cause failures when run in threads)
          - build: non-portable with AVX2 and AESNI
            comments: portable C with use of AVX2 and AESNI instructions
            cpu_features: [AVX2, AESNI]
            common_crypto:
              - AES: liboqs
              - SHA2: liboqs
            implementation: based on https://github.com/microsoft/PQCrypto-LWEKE/commit/669522db63850fa64d1a24a47e138e80a59349db optimized implementation
            no_secret_dependent_branching_claimed: true
            no_secret_dependent_branching_checked_by_valgrind: true
            large_stack_usage: false
          - build: non-portable without AVX2 or AESNI
            comments: portable C
            cpu_features: [AVX2, AESNI]
            common_crypto:
              - AES: liboqs
              - SHA2: liboqs
            implementation: based on https://github.com/microsoft/PQCrypto-LWEKE/commit/669522db63850fa64d1a24a47e138e80a59349db optimized implementation
            no_secret_dependent_branching_claimed: true
            no_secret_dependent_branching_checked_by_valgrind: true
            large_stack_usage: false
      - 
        platforms: [Linux ARM]
        builds:
          - build: all
            comments: portable C
            cpu_features: []
            common_crypto:
              - AES: liboqs
              - SHA2: liboqs
            implementation: based on https://github.com/microsoft/PQCrypto-LWEKE/commit/669522db63850fa64d1a24a47e138e80a59349db optimized implementation
            no_secret_dependent_branching_claimed: true
            no_secret_dependent_branching_checked_by_valgrind: true
            large_stack_usage: false

@baentsch
Copy link
Member Author

Thanks for this first cut. First questions:

  1. What defines large_stack_usage? Shouldn't this better be an "evaluated" constant (e.g., LARGE, MEDIUM, SMALL) based on some concrete measurements? What about heap requirements?
  2. Has this been built/extended from https://github.com/PQClean/PQClean/blob/master/crypto_kem/frodokem1344aes/META.yml ? Then there'd be a quick path forward to completion for all algorithms (at least for PQClean-originating algorithms)
  3. Is a number for nist-round sufficient? How do you distinguish between "Finalists" and "Alternate Candidates"?

@dstebila
Copy link
Member

  1. What defines large_stack_usage? Shouldn't this better be an "evaluated" constant (e.g., LARGE, MEDIUM, SMALL) based on some concrete measurements? What about heap requirements?

The concrete requirement here was "have we observed it crashing in multi-threaded tests in the language wrappers"?

  1. Has this been built/extended from https://github.com/PQClean/PQClean/blob/master/crypto_kem/frodokem1344aes/META.yml ? Then there'd be a quick path forward to completion for all algorithms (at least for PQClean-originating algorithms)

Not systematically, just inspired by.

  1. Is a number for nist-round sufficient? How do you distinguish between "Finalists" and "Alternate Candidates"?

This was intended to keep track that we've updated to the Round 3 version.

@dstebila
Copy link
Member

Tagging @xvzcf @christianpaquin @crockeea @jschanck @bhess @vsoftco @baentsch to invite any feedback.

@baentsch
Copy link
Member Author

Beyond the already answered questions above, do we safely assume that each algorithm is using common RAND? Should we have a test to validate that?

Looking at other common code, is it correct that Frodo unlike other algorithms doesn't use SHA3 (incl. SHA3x4)? Last question: Do we agree that the common_crypto tag also addresses/resolves #849?

If so, I'd support using/filling this template for all algorithms (and release 0.5 when all algs have the nist_round tagged 3).

@bhess
Copy link
Member

bhess commented Feb 11, 2021

Looks very good.

Is the goal to use these files also for a direct upstream-import of the implementations? If so it can make sense to unify some of the structure and naming (e.g. "implementations" vs. "supported_configurations", the way to encode the supported platforms). Compare for example here: https://github.com/pq-crystals/dilithium/blob/master/Dilithium2_META.yml

Additional information that can be useful:

  • KAT hashes
  • Compile options used, if any
  • Quantified stack usage (probably needs additional profiling with Valgrind/massif or similar)
  • Heap usage
 supported_configurations:
      - 
        platforms: [Linux x86, macOS x86, Windows x86]

Is it x86 or x86_64?

      - 
        platforms: [Linux ARM]

Similar here, do we want to detail the ARM architecture (aarch64, armhf, armel, ..)?

@dstebila
Copy link
Member

Beyond the already answered questions above, do we safely assume that each algorithm is using common RAND? Should we have a test to validate that?

I hadn't thought to check if people are using something other than common RAND. I'm not aware of anyone doing that in the algorithms we have. Not sure how we'd validate that automatically though.

Looking at other common code, is it correct that Frodo unlike other algorithms doesn't use SHA3 (incl. SHA3x4)? Last question: Do we agree that the common_crypto tag also addresses/resolves #849?

Oops, all Frodo variants do use SHA3, not SHA2; the -SHAKE variants just use it more. Will have to fix. And yes, hopefully this will resolve #849.

@dstebila
Copy link
Member

Is the goal to use these files also for a direct upstream-import of the implementations?

The initial goal was to provide an organized summary of the implementations characteristics, for people to understand what we have and to generate relevant documentation/tables. It was not an immediate goal to tie in with the copy-from-upstream mechanism; I was worried that expanding the scope too far would mean it never gets done.

Additional information that can be useful:

  • KAT hashes

Okay if we imagine this to be used for automatically connecting with code; less necessary if we imagine this is oriented around documentation (since those KATs are already present in the same commit elsewhere in the liboqs repo).

  • Compile options used, if any

Specifically?

  • Quantified stack usage (probably needs additional profiling with Valgrind/massif or similar)
  • Heap usage

To me that's more of an output characteristic, something that would e.g. be measured using profiling, rather than reported on a specification document like this one.

    platforms: [Linux x86, macOS x86, Windows x86]

Is it x86 or x86_64?

    platforms: [Linux ARM]

Similar here, do we want to detail the ARM architecture (aarch64, armhf, armel, ..)?

Yes, that is a good point.

@baentsch
Copy link
Member Author

To me that's more of an output characteristic, something that would e.g. be measured using profiling, rather than reported on a specification document like this one.

+1. Also, such properties are compiler&platform dependent. @bhess If you're not aware of it, you may want to head over to https://openquantumsafe.org/benchmarking/visualization/mem_sig_series.html (where you can --among many other options-- toggle between maxHeap and maxStack usage comparisons) to take a look at what we already have. Suggestions for improvements always welcome. Oh, and

Compile options used, if any

are also captured there.

@bhess
Copy link
Member

bhess commented Feb 11, 2021

Thanks @dstebila @baentsch for the details. Makes a lot of sense for documentation. Having the output characteristics and used settings available in the profiling page is better than putting them in static docs.

@xvzcf
Copy link
Contributor

xvzcf commented Feb 11, 2021

What about changing the supported_configurations key to build_configurations and having it be defined something like:

build_configurations:
  x86-64:
    - 
      type: portable
      comments: portable C with optional use of AVX2 and AESNI instructions (selected at compile-time, enabled by default if available)
      platforms: [Linux, macOS, Windows]
      cpu_features: [AVX2, AESNI]
      common_crypto:
         - AES: liboqs
         - SHA2: liboqs
      implementation: based on https://github.com/microsoft/PQCrypto-LWEKE/commit/669522db63850fa64d1a24a47e138e80a59349db optimized implementation
      no_secret_dependent_branching_claimed: true
      no_secret_dependent_branching_checked_by_valgrind: true
      large_stack_usage: false (this is where we might say an algorithm has large stack usage and may cause failures when run in threads)
    -
      type: non-portable with AVX2 and AESNI
      comments: non-portable C with use of AVX2 and AESNI instructions
      cpu_features: [AVX2, AESNI]
      platforms: [Linux, macOS, Windows]
      common_crypto:
                - AES: liboqs
                - SHA2: liboqs
      implementation: based on https://github.com/microsoft/PQCrypto-LWEKE/commit/669522db63850fa64d1a24a47e138e80a59349db optimized implementation
      no_secret_dependent_branching_claimed: true
      no_secret_dependent_branching_checked_by_valgrind: true
      large_stack_usage: false
  armhf:
  -
      type: portable
      platforms: [Linux]
      comments: portable C
      cpu_features: []
      common_crypto:
         - AES: liboqs
         - SHA2: liboqs
      implementation: based on https://github.com/microsoft/PQCrypto-LWEKE/commit/669522db63850fa64d1a24a47e138e80a59349db optimized implementation
      no_secret_dependent_branching_claimed: true
      no_secret_dependent_branching_checked_by_valgrind: true
      large_stack_usage: false
  armel:
  ....

@dstebila
Copy link
Member

That seems fine to me, @xvzcf.

@baentsch
Copy link
Member Author

Last remaining issue before releasing 0.6, right? Would it be an idea to complete a release of liboqs and all subprojects before the end of May/PQC workshop? For 0.5 it took us a month to move from RC on liboqs until final release of all subprojects... Thus, what about focusing on/closing this now and having a liboqs-0.6 RC by the end of April?

@dstebila
Copy link
Member

Greed. @xvzcf have you made any progress on generating documentation from the sample YML file?

@xvzcf
Copy link
Contributor

xvzcf commented Apr 20, 2021

Greed. @xvzcf have you made any progress on generating documentation from the sample YML file?

No, will look at it today.

@xvzcf
Copy link
Contributor

xvzcf commented Apr 21, 2021

Here's the slightly reworked YAML:

name: FrodoKEM
type: kem
principal-submitters:
  - Michael Naehrig
  - Erdem Alkim
  - Joppe Bos
  - Léo Ducas
  - Karen Easterbrook
  - Brian LaMacchia
  - Patrick Longa
  - Ilya Mironov
  - Valeria Nikolaenko
  - Christopher Peikert
  - Ananth Raghunathan
  - Douglas Stebila
auxiliary-submitters: []
crypto-assumption: learning with errors (LWE)
website: https://frodokem.org/
nist-round: 3
spec-version: NIST Round 3 submission
spdx-license-identifier: MIT
implementation-chain:
  - SAMPLE_URL_LEAF
  - SAMPLE_URL_INT
  - https://github.com/microsoft/PQCrypto-LWEKE/commit/669522db63850fa64d1a24a47e138e80a59349db
implementation-type: optimized
parameter-sets:
  -
    name: FrodoKEM-640-AES
    claimed-nist-level: 1
    claimed-security: IND-CCA2
    length-public-key: 9616
    length-ciphertext: 9720
    length-secret-key: 19888
    length-shared-secret: 16
    implementations:
      -
        arch: x86-64
        portable: yes
        platforms: [Linux, macOS, Windows]
        cpu-extensions-used: [AVX2, AESNI]
        common-crypto:
          - AES: liboqs
          - SHA2: liboqs
        no-secret-dependent-branching-claimed: true
        no-secret-dependent-branching-checked-by-valgrind: true
        large-stack-usage: false
      -
        arch: armel
        portable: no
        cpu-extensions-used: []
        platforms: [Linux, macOS, Windows]
        common-crypto:
          - AES: liboqs
          - SHA2: liboqs
        no-secret-dependent-branching-claimed: true
        no-secret-dependent-branching-checked-by-valgrind: true
        large-stack-usage: false
      -
        arch: armhf
        portable: yes
        platforms: [Linux]
        cpu-extensions-used: []
        common-crypto:
          - AES: liboqs
          - SHA2: liboqs
        no-secret-dependent-branching-claimed: true
        no-secret-dependent-branching-checked-by-valgrind: true
        large-stack-usage: false

and the associated documentation markdown:

FrodoKEM

  • Algorithm type: key encapsulation mechanism
  • Main cryptographic assumption: learning with errors (LWE).
  • Authors website: https://frodokem.org/.
  • Specification version: NIST Round 3 submission.
  • Implementation taken from
  • License (SPDX-Identifier): MIT.

Parameter set summary

Parameter set Security Model Claimed NIST Level Public key size (bytes) Secret key size (bytes) Ciphertext size (bytes) Shared secret size (bytes)
FrodoKEM-640-AES IND-CCA2 1 9616 19888 9720 16

Link to memory consumption benchmark: https://openquantumsafe.org/benchmarking/visualization/mem_kem.html#refselector=Performance&familyselector=Frodo

FrodoKEM-640-AES implementation characteristics

Architecture Platforms CPU Extensions Used Portable? No branching-on-secrets claimed? No branching-on-secrets checked by valgrind? Large stack usage?
x86-64 Linux,macOS,Windows, AVX2,AESNI, True True True False
armel Linux,macOS,Windows, False True True False
armhf Linux, True True True False

Explanation of terms

  • Large stack usage: INSERT_EXPLANATION_HERE

@xvzcf
Copy link
Contributor

xvzcf commented Apr 21, 2021

@open-quantum-safe/core thoughts?

@baentsch
Copy link
Member Author

Looks basically OK to me. Suggestions for improvement: What about putting this link behind the truth value concerning "Large stack usage": https://openquantumsafe.org/benchmarking/visualization/mem_kem.html ? May avoid discussions what constitutes "large" with clear figures. Also, would it be reasonable to add "in optimized implementation" behind the "CPU Extensions Used" heading (or a footnote -- to document there's both optimized and reference code available; the latter of which arguably always is portable).

@xvzcf
Copy link
Contributor

xvzcf commented Apr 22, 2021

I'd be more inclined to put the link in the explanation section (unless there's a link to display numbers only for a specific implementation of choice on that page)

For the latter, I'll edit my comment above to add an implementation-type key to the YAML, and the resulting generated markdown will have this:

@baentsch
Copy link
Member Author

unless there's a link to display numbers only for a specific implementation of choice on that page

That's a good feature idea for profiling visualization. Now so implemented: If open-quantum-safe/profiling#54 is landed you can direct link to specific algorithms and implementations, e.g. https://openquantumsafe.org/benchmarking/visualization/mem_kem.html#refselector=Performance&familyselector=Frodo

@baentsch
Copy link
Member Author

@xvzcf Linking to specific profiling pages/algs now works as advertised above. Could we now finalize this (and put the resultant docs into 0.6.0)?

@dstebila dstebila modified the milestones: 0.6.0 RC1, 0.6.0 RC2 Apr 28, 2021
@xvzcf
Copy link
Contributor

xvzcf commented Apr 28, 2021

@xvzcf Linking to specific profiling pages/algs now works as advertised above. Could we now finalize this (and put the resultant docs into 0.6.0)?

I've updated the markdown to include a link to the benchmark (under the parameter set summary section).

@dstebila
Copy link
Member

dstebila commented Apr 28, 2021

I've put the example YML file for FrodoKEM in a new-datasheets branch in the docs/algorithms/kem folder. It's ready for other people to adapt for other schemes. As promised, here are the assignments. Please try to do this within the next week, you can push directly to the new-datasheets branch. If you have any problems / questions, please ask on here.

KEMs:

Signatures:

@baentsch
Copy link
Member Author

OK for me to take on HQC and Rainbow.

Question(s) on FrodoKEM: Is that really complete/correct?

  1. Shouldn't this read "SHA3":

  1. Should these URLs be filled-in (or removed):
    implementation-chain:
    - SAMPLE_URL_LEAF
    - SAMPLE_URL_INT

Finally, am I assuming correct that we don't explicitly/separately list reference implementation(s) -- unless no optimized variant is available?

@baentsch
Copy link
Member Author

Additional question regarding secret dependent branching: Do I assume correct that we shall state false on no-secret-dependent-branching-claimed if we have a suppression file (e.g., for HQC) -- as well as true on no-secret-dependent-branching-checked-by-valgrind?

One could argue that the claim to this property is made by the authors, though, as the NIST submission states "Our optimized AVX2 implementation is now constant time and avoids secret dependent memory access" (in my eyes code branches are --code-- memory accesses). Given this, these bits now confuse me a bit: Could @xvzcf @jschanck @dstebila please provide guidance/a link as to how to set these truth values?

@dstebila
Copy link
Member

Question(s) on FrodoKEM: Is that really complete/correct?

  1. Shouldn't this read "SHA3":

You're right, fixed; thanks.

  1. Should these URLs be filled-in (or removed):
    implementation-chain:
    - SAMPLE_URL_LEAF
    - SAMPLE_URL_INT

That's just so you all can see the syntax, will be removed for Frodo eventually since Frodo doesn't need them.

Finally, am I assuming correct that we don't explicitly/separately list reference implementation(s) -- unless no optimized variant is available?

Yes.

@dstebila
Copy link
Member

Additional question regarding secret dependent branching: Do I assume correct that we shall state false on no-secret-dependent-branching-claimed if we have a suppression file (e.g., for HQC) -- as well as true on no-secret-dependent-branching-checked-by-valgrind?

One could argue that the claim to this property is made by the authors, though, as the NIST submission states "Our optimized AVX2 implementation is now constant time and avoids secret dependent memory access" (in my eyes code branches are --code-- memory accesses). Given this, these bits now confuse me a bit: Could @xvzcf @jschanck @dstebila please provide guidance/a link as to how to set these truth values?

I'd say we should put a link to the suppression file indicating the exceptions.

@baentsch
Copy link
Member Author

I'd say we should put a link to the suppression file indicating the exceptions.

How/where? Also, please note that in the case of HQC it's 3 files. Until that's clear, I'll consider HQC done: Please take a look. If you'd want me to extend the YAML->MD converter, please let me know where that code is (@xvzcf ? Didn't find it in scripts or doc).

@jschanck
Copy link
Contributor

Regarding HQC: How about I open an issue describing the non-constant time behaviour that is documented in the suppression files, and then we link to the issue.

@bhess
Copy link
Member

bhess commented May 3, 2021

Added a yml file for Dilithium.

A few minor comments:

For implementation_type, there are at the moment values for "Plain C" (Rainbow) and "optimized" (Dilithium, HQC, Frodo).
The NIST submissions contain "reference", "optimized" and "additional" implementations, where both "reference" and "optimized" implementations need to be plain portable C. Additional implementations can be assembly-optimized. Would it be clearer to have "reference (plain C)", "optimized (plain C)" and "assembly-optimized" as possible values for implementation_type?

The Frodo yml lists macOS and Windows as target platforms for armel and armhf. Isn't it just Linux (or perhaps macOS because of M1)?

platforms: [Linux, macOS, Windows]

platforms: [Linux, macOS, Windows]

The Frodo yml lists "armel" as not portable. Is this correct?

I'd say we should put a link to the suppression file indicating the exceptions.

For SIKE, I believe that the issues were resolved after #914. @christianpaquin @jschanck Could the two SIKE-related files be removed from here? https://github.com/open-quantum-safe/liboqs/tree/main/tests/constant_time/kem/issues.

If you'd want me to extend the YAML->MD converter, please let me know where that code is (@xvzcf ? Didn't find it in scripts or doc).

There is some code to partially generate the .md files after copy_from_upstream: https://github.com/open-quantum-safe/liboqs/tree/main/scripts/copy_from_upstream/docs/algorithms. This should be obsolete after completing this here, but it could serve as a template for generating .md files from the new yml-files.

@xvzcf
Copy link
Contributor

xvzcf commented May 3, 2021

For implementation_type, there are at the moment values for "Plain C" (Rainbow) and "optimized" (Dilithium, HQC, Frodo).
The NIST submissions contain "reference", "optimized" and "additional" implementations, where both "reference" and "optimized" implementations need to be plain portable C. Additional implementations can be assembly-optimized. Would it be clearer to have "reference (plain C)", "optimized (plain C)" and "assembly-optimized" as possible values for implementation_type?

My aim here was that these would just be (possibly opaque) identifiers that just make it possible to look up what "flavor" we pulled from the upstream code (if the upstream has three implementations X, Y, and Z, we'd also just note down X or Y or Z in the YAML file). In combination with the implementation-chain key this should make it possible to precisely determine what code was used.

The Frodo yml lists macOS and Windows as target platforms for armel and armhf. Isn't it just Linux (or perhaps macOS because of M1)?

platforms: [Linux, macOS, Windows]

platforms: [Linux, macOS, Windows]

The Frodo yml lists "armel" as not portable. Is this correct?

I did not check whether the values were correct, just copy-pasted to hash out what the general YAML file would look like.

If you'd want me to extend the YAML->MD converter, please let me know where that code is (@xvzcf ? Didn't find it in scripts or doc).

There is some code to partially generate the .md files after copy_from_upstream: https://github.com/open-quantum-safe/liboqs/tree/main/scripts/copy_from_upstream/docs/algorithms. This should be obsolete after completing this here, but it could serve as a template for generating .md files from the new yml-files.

I'll paste the quick-and-dirty script I wrote to generate the markdown files in a separate comment. I think we'll have to ensure consistency between the information in these new YAML files and, for example, copy_from_upstream.yml (such as making sure the pretty_name_fulls line up); we could automatically populate some of the fields in the new files using copy_from_upstream.yml and whatever else is there (the suppression files?), but this is probably best set aside for a future issue/PR.

@xvzcf
Copy link
Contributor

xvzcf commented May 3, 2021

The python script I used:

#!/usr/bin/env python3

import argparse
import sys
from tabulate import tabulate
import yaml
import os

config = {}
with open('frodokem.yml', mode='r', encoding='utf-8') as f:
    config = yaml.safe_load(f.read())

with open('frodokem-new-sample.md', mode='w', encoding='utf-8') as f:
    f.write('# {}\n\n'.format(config['name']))
    f.write('- **Algorithm type**: key encapsulation mechanism\n')
    f.write('- **Main cryptographic assumption**: {}.\n'.format(config['crypto-assumption']))
    f.write('- **Authors website**: {}.\n'.format(config['website']))
    f.write('- **Specification version**: {}.\n'.format(config['spec-version']))
    f.write('- **Implementation**: {} version from:\n'.format(config['implementation-type']))
    for url in config['implementation-chain'][:-1]:
        f.write('  - {}, which takes it from\n'.format(url))
    f.write('  - {}\n'.format(config['implementation-chain'][-1]))
    f.write('- **Implementation type**: {}\n'.format(config['implementation-type']))


    f.write('- **License (SPDX-Identifier)**: {}.\n'.format(config['spdx-license-identifier']))

    f.write('\n## Parameter set summary\n\n')
    table = [['Parameter set',
              'Security Model',
              'Claimed NIST Level',
              'Public key size (bytes)',
              'Secret key size (bytes)',
              'Ciphertext size (bytes)',
              'Shared secret size (bytes)']]
    for parameter_set in config['parameter-sets']:
        table.append([parameter_set['name'],
                      parameter_set['claimed-security'],
                      parameter_set['claimed-nist-level'],
                      parameter_set['length-public-key'],
                      parameter_set['length-secret-key'],
                      parameter_set['length-ciphertext'],
                      parameter_set['length-shared-secret']])
    f.write(tabulate(table, tablefmt="pipe", headers="firstrow", colalign=("center",)))
    f.write('\n')

    for parameter_set in config['parameter-sets']:
        f.write('\n## {} implementation characteristics\n\n'.format(parameter_set['name']))
        table = [['Architecture',
                  'Platforms',
                  'CPU Extensions Used',
                  'Portable?',
                  'No branching-on-secrets claimed?',
                  'No branching-on-secrets checked by valgrind?',
                  'Large stack usage?']]
        for impl in parameter_set['implementations']:
            table.append([impl['arch'],
                          ''.join(p + ',' for p in impl['platforms']),
                          ''.join(e + ',' for e in impl['cpu-extensions-used']),
                          impl['portable'],
                          impl['no-secret-dependent-branching-claimed'],
                          impl['no-secret-dependent-branching-checked-by-valgrind'],
                          impl['large-stack-usage']])
        f.write(tabulate(table, tablefmt="pipe", headers="firstrow", colalign=("center",)))
        f.write('\n')

    f.write('\n## Explanation of terms\n\n')
    f.write('- Large stack usage: INSERT_EXPLANATION_HERE')

@christianpaquin
Copy link
Contributor

Since we are pushing 0.6, I took the liberty of delaying my assigned algs to next week, to address urgent deadlines this week. Hoping to get to this before our next meeting.

@christianpaquin
Copy link
Contributor

How are we supposed to answer questions fields that vary depending on platform support. For example, for SIKE, some optimizations are available on Linux and Darwin, but the build will revert to the portable version on Windows. Should I duplicate the arch entry:

 -  arch: x86-64
    portable: no
    platforms: [Linux, macOS]
    cpu-extensions-used: [ADX, MULX]
 -  arch: x86-64
    portable: yes
    platforms: [Windows]
    cpu-extensions-used: []

or should I combined both:

 -  arch: x86-64
    portable: yes
    platforms: [Linux, macOS,Windows]
    cpu-extensions-used: [ADX, MULX]

There are already 4 (params) x 2 (SIDH/SIKE) x 2 (compressed or not) = 16 variants for SIKE, each with 4 archs, so I'm weary of adding another split.

@dstebila
Copy link
Member

Go with duplicating for now, that way you can describe which combinations of arch/platform have which properties more precisely.

@jschanck
Copy link
Contributor

I added NTRU and Kyber. Some questions:

What is the top-level "implementation type" field for? This feels like it should be under parameter-sets/implementations, if it's necessary at all.

implementation-type: optimized

Does "portable" mean the implementation can be selected at runtime? If so, maybe change the name of the field to something like "dynamic-dispatch".

arch: x86-64
portable: yes
platforms: [Linux, macOS, Windows]
cpu-extensions-used: [AVX2, AESNI]

I've used "arch: any" / "platforms: any" for plain C. Is this OK?

arch: any
portable: yes
platforms: any

@dstebila dstebila removed this from the 0.6.0 RC2 milestone Jun 16, 2021
@dstebila dstebila added this to the 0.7.0 milestone Jul 7, 2021
@baentsch
Copy link
Member Author

Resolved for KEMs by #1030. Equivalent PR for signatures will close this issue.

@xvzcf
Copy link
Contributor

xvzcf commented Jul 23, 2021

Closed by #1053

@xvzcf xvzcf closed this as completed Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants