cryptopt
CryptOpt: Verified Compilation with Randomized Program Search for Cryptographic Primitives
Science Score: 77.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, acm.org, zenodo.org -
✓Committers with academic emails
1 of 4 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.9%) to scientific vocabulary
Keywords from Contributors
Scientific Fields
Repository
CryptOpt: Verified Compilation with Randomized Program Search for Cryptographic Primitives
Basic Info
- Host: GitHub
- Owner: 0xADE1A1DE
- License: apache-2.0
- Language: TypeScript
- Default Branch: main
- Homepage: https://0xade1a1de.github.io/CryptOpt/
- Size: 132 MB
Statistics
- Stars: 61
- Watchers: 4
- Forks: 11
- Open Issues: 13
- Releases: 1
Metadata Files
Readme.md
CryptOpt: Verified Compilation with Random Program Search for Cryptographic Primitives
CryptOpt is the result of a research project aiming to enhance the state-of-the-art of how we generate fast code for cryptographic primitives. CryptOpt is an optimizer, which feeds itself from Fiat Cryptography, generates optimized x86-64 Assembly for field arithmetic, and then feeds that Assembly back into Fiat Cryptography for end-to-end formal verification. With doing that, CryptOpt achieves much higher performance than GCC and Clang on many different micro-architectures, and in some cases even surpassing the performance hand-optimized Assembly.
The generated fast and verified assembly files are in the fiat-amd64-directory in the Fiat project and here. Here is the table from the research paper showcasing average speedups against GCC 12 / Clang 15 with respective highest optimization settings.
Geometric means of Speedup CryptOpt vs. off- the-shelf compilers.
| Primitive | Mul (Clang) | Mul (GCC) | Square (Clang) | Square (GCC) | |-------------|-------------|------------|----------------|--------------| | Curve25519 | 1.25 | 1.16 | 1.18 | 1.17 | | P-224 | 1.54 | 2.52 | 1.40 | 2.56 | | P-256 | 1.70 | 2.61 | 1.63 | 2.59 | | P-384 | 1.45 | 2.49 | 1.37 | 2.51 | | SIKEp434 | 1.70 | 2.43 | 1.73 | 2.39 | | Curve448 | 1.19 | 0.98 | 1.07 | 1.05 | | P-521 | 1.30 | 0.97 | 1.35 | 1.03 | | Poly1305 | 1.12 | 1.22 | 1.11 | 1.26 | | secp256k1 | 1.80 | 2.62 | 1.71 | 2.54 |
Use CryptOpt
If you want to optimize on your own machine, or a different primitive you can
1. Follow the instructions in the INSTALL document.
1. Run ./CryptOpt --help to check if the installation worked.
1. Run ./CryptOpt to see an optimization in action.
1. Follow the instructions in the First Steps document to get a feeling of what is going on.
The CryptOpt optimizer can also be used with non-Fiat Cryptography input. For more information see the ./test/manual-bridge/
Research Papers
The paper has been published in PLDI 2023, and is available online here and here, the BibTeX here. The full version of the paper, featuring the appendix with detailed performance measurements, is available online on arXiv here and here.
The ICSE'23 DEMO paper titled CryptOpt: Automatic Optimization of Straightline Code, which explains the technical engineering effort in more detail is available online here and here, the BibTeX here.
Tracking usage of CryptOpt
We have used CryptOpt to generate code for:
libsecp256k1-compatible code (./CryptOpt --curve secp256k1_dettman --memoryConstraints out1-arg1) (PR #1329)- BLS12-381 Curves (
./CryptOpt --curve bls12_381_p,./CryptOpt --curve bls12_381_q) - Curve25519 (solinas, i.e. saturated) code is integrated into BoringSSL with this commit (slight manual adaptions needed, because BoringSSL requires
rbpto point to the stack. See issue #144 in this repo.)
Acknowledgements
This project was supported by:
- The Air Force Office of Scientific Research (AFOSR) under award number FA9550-20-1-0425
- the ARC Discovery Early Career Researcher Award DE200101577
- the ARC Discovery Projects DP200102364 and DP210102670
- The Blavatnik ICRC at Tel-Aviv University
- Data61, CSIRO
- the National Science Foundation under grants CNS-1954712 and CNS-2130671
- the National Science Foundation Expedition on the Science of Deep Specification (award CCF-1521584)
- the Phoenix HPC service at the University of Adelaide
- and gifts from Amazon Web Services, AMD, Facebook, Google, Intel and the Tezos Foundation.
Owner
- Name: 0xADE1A1DE
- Login: 0xADE1A1DE
- Kind: organization
- Repositories: 5
- Profile: https://github.com/0xADE1A1DE
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: >-
CryptOpt: Verified Compilation with Random Programized
Search for Cryptographic Primitives
message: >-
If you use this software, please cite both the article
from preferred-citation and the software itself
type: software
authors:
- family-names: Kuepper
given-names: Joel
identifiers:
- type: doi
value: 10.1145/3591272
description: Paper DOI
- type: doi
value: 10.5281/zenodo.2542117
description: Research Artifact
- type: url
value: 'https://arxiv.org/abs/2211.10665'
description: ArXiv URL for full paper
url: 'https://github.com/0xADE1A1DE/CryptOpt'
keywords:
- elliptic-curve cryptography
- search-based software engineering
- assembly
license: Apache-2.0
date-released: '2022-08-01'
preferred-citation:
title: "CryptOpt: Verified Compilation with Randomized Program Search"
type: conference-paper
doi: 10.1145/3591272
authors:
- family-names: Kuepper
given-names: Joel
- family-names: Erbsen
given-names: Andres
- family-names: Gross
given-names: Jason
- family-names: Conoly
given-names: Owen
- family-names: Sun
given-names: Chuyue
- family-names: Sian
given-names: Samuel
- family-names: Wu
given-names: David
- family-names: Chlipala
given-names: Adam
- family-names: Chuengsatiansup
given-names: Chitchanok
- family-names: Genkin
given-names: Daniel
- family-names: Wagner
given-names: Markus
- family-names: Yarom
given-names: Yuval
journal: "Proc. ACM Program. Lang."
month: 6
year: 2023
conference: PLDI
volume: 7
publisher:
name: "Association for Computing Machinery"
GitHub Events
Total
- Watch event: 8
- Fork event: 1
Last Year
- Watch event: 8
- Fork event: 1
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Joel | r****v@g****m | 458 |
| dependabot[bot] | 4****] | 138 |
| javali7 | j****7 | 3 |
| Yuval Yarom | y****l@c****u | 3 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 0
- Total pull requests: 170
- Average time to close issues: N/A
- Average time to close pull requests: 2 days
- Total issue authors: 0
- Total pull request authors: 3
- Average comments per issue: 0
- Average comments per pull request: 0.35
- Merged pull requests: 119
- Bot issues: 0
- Bot pull requests: 164
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- kanin-kearpimy (1)
Pull Request Authors
- dependabot[bot] (95)
- dderjoel (4)
- samuel-tian (1)
- kanin-kearpimy (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- 414 dependencies
- @rollup/plugin-typescript ^8.3.4 development
- @types/fs-extra ^9.0.13 development
- @types/lodash-es ^4.17.6 development
- @types/node ^18.6.3 development
- @types/yargs ^17.0.10 development
- @typescript-eslint/eslint-plugin ^5.32.0 development
- @typescript-eslint/parser ^5.32.0 development
- c8 ^7.12.0 development
- eslint ^8.21.0 development
- eslint-config-prettier ^8.5.0 development
- eslint-plugin-import ^2.26.0 development
- eslint-plugin-prettier ^4.2.1 development
- eslint-plugin-simple-import-sort ^7.0.0 development
- prettier ^2.7.1 development
- rollup ^2.77.2 development
- rollup-plugin-copy ^3.4.0 development
- rollup-plugin-shell ^1.0.8 development
- rollup-plugin-terser ^7.0.2 development
- tslib ^2.4.0 development
- typescript ^4.7.4 development
- vite ^3.0.4 development
- vite-tsconfig-paths ^3.5.0 development
- vitest ^0.20.2 development
- fs-extra ^10.1.0
- lodash-es ^4.17.21
- measuresuite file:./modules/MeasureSuite
- simple-statistics ^7.7.5
- yargs ^17.5.1
- dependabot/fetch-metadata v1.1.1 composite
- 0xADE1A1DE/AssemblyLine main composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- irongut/CodeCoverageSummary v1.2.0 composite
- jwalton/gh-find-current-pr v1 composite
- marocchino/sticky-pull-request-comment v2 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- ubuntu jammy build