Skip to content

Commit

Permalink
don't use threads for CROSS variants with large stack usage
Browse files Browse the repository at this point in the history
Signed-off-by: rtjk <[email protected]>
  • Loading branch information
rtjk committed Aug 5, 2024
1 parent ad79543 commit 9343183
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ All names other than `ML-KEM` and `ML-DSA` are subject to change. `liboqs` makes
#### Signature schemes

<!--- OQS_TEMPLATE_FRAGMENT_LIST_SIGS_START -->
- **CROSS**: cross-rsdp-128-balanced, cross-rsdp-128-fast, cross-rsdp-128-small, cross-rsdp-192-balanced, cross-rsdp-192-fast, cross-rsdp-192-small, cross-rsdp-256-balanced, cross-rsdp-256-fast, cross-rsdp-256-small, cross-rsdpg-128-balanced, cross-rsdpg-128-fast, cross-rsdpg-128-small, cross-rsdpg-192-balanced, cross-rsdpg-192-fast, cross-rsdpg-192-small, cross-rsdpg-256-balanced, cross-rsdpg-256-fast, cross-rsdpg-256-small
- **CROSS**: cross-rsdp-128-balanced, cross-rsdp-128-fast, cross-rsdp-128-small, cross-rsdp-192-balanced, cross-rsdp-192-fast, cross-rsdp-192-small, cross-rsdp-256-balanced, cross-rsdp-256-fast, cross-rsdp-256-small, cross-rsdpg-128-balanced, cross-rsdpg-128-fast, cross-rsdpg-128-small, cross-rsdpg-192-balanced, cross-rsdpg-192-fast, cross-rsdpg-192-small, cross-rsdpg-256-balanced, cross-rsdpg-256-fast, cross-rsdpg-256-small
- **CRYSTALS-Dilithium**: Dilithium2, Dilithium3, Dilithium5
- **Falcon**: Falcon-512, Falcon-1024, Falcon-padded-512, Falcon-padded-1024
- **MAYO**: MAYO-1, MAYO-2, MAYO-3, MAYO-5†
Expand Down
24 changes: 12 additions & 12 deletions docs/algorithms/sig/cross.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.

| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage? |
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
| [Primary Source](#primary-source) | clean | All | All | None | True | True | False |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | False |
| [Primary Source](#primary-source) | clean | All | All | None | True | True | True |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | True |

Are implementations chosen based on runtime CPU feature detection? **Yes**.

Expand All @@ -85,17 +85,17 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.

| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage? |
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
| [Primary Source](#primary-source) | clean | All | All | None | True | True | False |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | False |
| [Primary Source](#primary-source) | clean | All | All | None | True | True | True |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | True |

Are implementations chosen based on runtime CPU feature detection? **Yes**.

## cross-rsdp-256-balanced implementation characteristics

| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage? |
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
| [Primary Source](#primary-source) | clean | All | All | None | True | True | False |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | False |
| [Primary Source](#primary-source) | clean | All | All | None | True | True | True |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | True |

Are implementations chosen based on runtime CPU feature detection? **Yes**.

Expand All @@ -112,8 +112,8 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.

| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage? |
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
| [Primary Source](#primary-source) | clean | All | All | None | True | True | False |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | False |
| [Primary Source](#primary-source) | clean | All | All | None | True | True | True |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | True |

Are implementations chosen based on runtime CPU feature detection? **Yes**.

Expand Down Expand Up @@ -166,8 +166,8 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.

| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage? |
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
| [Primary Source](#primary-source) | clean | All | All | None | True | True | False |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | False |
| [Primary Source](#primary-source) | clean | All | All | None | True | True | True |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | True |

Are implementations chosen based on runtime CPU feature detection? **Yes**.

Expand All @@ -193,8 +193,8 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.

| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage? |
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
| [Primary Source](#primary-source) | clean | All | All | None | True | True | False |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | False |
| [Primary Source](#primary-source) | clean | All | All | None | True | True | True |
| [Primary Source](#primary-source) | avx2 | x86\_64 | All | AVX2 | True | True | True |

Are implementations chosen based on runtime CPU feature detection? **Yes**.

Expand Down
24 changes: 12 additions & 12 deletions docs/algorithms/sig/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- upstream: primary-upstream
upstream-id: avx2
supported-platforms:
Expand All @@ -107,7 +107,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- name: cross-rsdp-192-balanced
oqs_alg: OQS_SIG_alg_cross_rsdp_192_balanced
claimed-nist-level: 3
Expand Down Expand Up @@ -180,7 +180,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- upstream: primary-upstream
upstream-id: avx2
supported-platforms:
Expand All @@ -191,7 +191,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- name: cross-rsdp-256-balanced
oqs_alg: OQS_SIG_alg_cross_rsdp_256_balanced
claimed-nist-level: 5
Expand All @@ -208,7 +208,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- upstream: primary-upstream
upstream-id: avx2
supported-platforms:
Expand All @@ -219,7 +219,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- name: cross-rsdp-256-fast
oqs_alg: OQS_SIG_alg_cross_rsdp_256_fast
claimed-nist-level: 5
Expand Down Expand Up @@ -264,7 +264,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- upstream: primary-upstream
upstream-id: avx2
supported-platforms:
Expand All @@ -275,7 +275,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- name: cross-rsdpg-128-balanced
oqs_alg: OQS_SIG_alg_cross_rsdpg_128_balanced
claimed-nist-level: 1
Expand Down Expand Up @@ -432,7 +432,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- upstream: primary-upstream
upstream-id: avx2
supported-platforms:
Expand All @@ -443,7 +443,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- name: cross-rsdpg-256-balanced
oqs_alg: OQS_SIG_alg_cross_rsdpg_256_balanced
claimed-nist-level: 5
Expand Down Expand Up @@ -516,7 +516,7 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
- upstream: primary-upstream
upstream-id: avx2
supported-platforms:
Expand All @@ -527,4 +527,4 @@ parameter-sets:
- SHA3: liboqs
no-secret-dependent-branching-claimed: true
no-secret-dependent-branching-checked-by-valgrind: true
large-stack-usage: false
large-stack-usage: true
4 changes: 2 additions & 2 deletions tests/test_sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ int main(int argc, char **argv) {
OQS_STATUS rc;
#if OQS_USE_PTHREADS
#define MAX_LEN_SIG_NAME_ 64
// don't run MAYO_5 in threads because of large stack usage
char no_thread_sig_patterns[][MAX_LEN_SIG_NAME_] = {"MAYO-5"};
// don't run algorithms with large stack usage in threads
char no_thread_sig_patterns[][MAX_LEN_SIG_NAME_] = {"MAYO-5", "cross-rsdp-128-small", "cross-rsdp-192-small", "cross-rsdp-256-balanced", "cross-rsdp-256-small", "cross-rsdpg-192-small", "cross-rsdpg-256-small"};
int test_in_thread = 1;
for (size_t i = 0 ; i < sizeof(no_thread_sig_patterns) / MAX_LEN_SIG_NAME_; ++i) {
if (strstr(alg_name, no_thread_sig_patterns[i]) != NULL) {
Expand Down

0 comments on commit 9343183

Please sign in to comment.