-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dsa: Add initial DSA implementation (#471)
Adds an initial implementation of DSA (see #8) The following things work when tested against OpenSSL: - The generated keys are valid and can be imported and exported from/to their DER/PEM representation - Signatures generated by this library can be successfully verified - Signatures can be imported and exported from/into their DER representation - Signatures generated by OpenSSL can be successfully imported and verified
- Loading branch information
Showing
30 changed files
with
2,103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: dsa | ||
on: | ||
pull_request: | ||
paths: | ||
- "dsa/**" | ||
- "Cargo.*" | ||
push: | ||
branches: master | ||
|
||
defaults: | ||
run: | ||
working-directory: dsa | ||
|
||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUSTFLAGS: "-Dwarnings" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: | ||
- thumbv7em-none-eabi | ||
- wasm32-unknown-unknown | ||
toolchain: | ||
- 1.57.0 # MSRV | ||
- stable | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
toolchain: ${{ matrix.toolchain }} | ||
override: true | ||
- run: cargo build --target ${{ matrix.target }} --release --no-default-features | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
platform: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
toolchain: | ||
- 1.57.0 # MSRV | ||
- stable | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Enforce LF | ||
working-directory: . | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
override: true | ||
- run: cargo test --release --no-default-features | ||
- run: cargo test --release | ||
- run: cargo test --release --all-features |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = [ | ||
"dsa", | ||
"ecdsa", | ||
"ed25519", | ||
"rfc6979" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target/ | ||
Cargo.lock | ||
*.pem | ||
*.der |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[package] | ||
name = "dsa" | ||
version = "0.0.1" | ||
edition = "2021" | ||
license = "Apache-2.0 OR MIT" | ||
readme = "README.md" | ||
categories = ["cryptography"] | ||
keywords = ["crypto", "nist", "signature"] | ||
rust-version = "1.57" | ||
|
||
[dependencies] | ||
digest = "0.10.3" | ||
num-bigint = { package = "num-bigint-dig", version = "0.8.1", default-features = false, features = ["prime", "rand", "zeroize"] } | ||
num-traits = { version = "0.2.15", default-features = false } | ||
opaque-debug = "0.3.0" | ||
paste = "1.0.7" | ||
pkcs8 = { version = "0.9.0", default-features = false, features = ["alloc"] } | ||
rand = { version = "0.8.5", default-features = false } | ||
rfc6979 = { version = "0.2.0", path = "../rfc6979" } | ||
signature = { version = ">= 1.5.0, < 1.6.0", default-features = false, features = ["digest-preview", "rand-preview"] } | ||
zeroize = { version = "1.5.5", default-features = false } | ||
|
||
[features] | ||
default = [] | ||
|
||
[dev-dependencies] | ||
pkcs8 = { version = "0.9.0", default-features = false, features = ["pem"] } | ||
rand = "0.8.5" | ||
rand_chacha = "0.3.1" | ||
sha1 = "0.10.1" | ||
sha2 = "0.10.2" |
Oops, something went wrong.