Skip to content

Commit 7cbbf44

Browse files
authored
feat: ed25519 digital signature scheme (#179)
* init: eddsa * fix lint&spell * improve code comment and add doc * fix readme dsa, downgrade anim quality * fix latex, add bench * improve keygen algo * improve doc * fix doc * fix doc tex, add sha512 * update spell dict * mv imgs/gifs to assets, cleanup * add mdbook and deploy on gh-pages * fix fmt * use write_all instead of write * update readme,book.toml,add desc to create_mdbook * finalize * update book.toml * add sk,pk to struct, generic sha * remove unused feature
1 parent 9e8b0f9 commit 7cbbf44

35 files changed

Lines changed: 2335 additions & 252 deletions

.codespell-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ ronkathon
22
crate
33
nd
44
te
5+
SHS

.github/workflows/deploy.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy mdBook site to Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
# Build job
25+
build:
26+
runs-on: ubuntu-latest
27+
env:
28+
MDBOOK_VERSION: 0.4.43
29+
MDBOOK_KATEX_VERSION: 0.9.2
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Install mdBook
33+
run: |
34+
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
35+
rustup update
36+
cargo install --version ${MDBOOK_VERSION} mdbook
37+
cargo install --version ${MDBOOK_KATEX_VERSION} mdbook-katex
38+
- name: Setup Pages
39+
id: pages
40+
uses: actions/configure-pages@v5
41+
- name: Build with mdBook
42+
run: |
43+
cargo run --bin create_mdbook
44+
cp -r assets book/
45+
mdbook build
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: ./docs
50+
51+
# Deployment job
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ dump
3333

3434
# coverage files
3535
lcov.info
36+
37+
# mdbook
38+
create_mdbook
39+
book
40+
mdbook
41+
docs

Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ edition ="2021"
55
license ="MIT OR Apache-2.0"
66
name ="ronkathon"
77
repository ="https://github.com/pluto/ronkathon"
8-
version = "0.1.1"
9-
exclude =["CHANGELOG.md", "src/tree/ConstructMerkleTree.gif"]
8+
version ="0.1.1"
9+
exclude =["CHANGELOG.md", "assets/"]
1010

1111
[dependencies]
12-
rand ="0.8"
13-
itertools="0.14"
14-
hex ="0.4"
12+
rand ="0.8"
13+
itertools ="0.14"
14+
hex ="0.4"
15+
crypto-bigint ="0.6.0-rc.6"
16+
regex ="1.11.1"
17+
num-traits ="0.2.19"
1518

1619
[dev-dependencies]
1720
rstest ="0.24"
@@ -21,6 +24,7 @@ ark-ff ={ version="0.5", features=["std"] }
2124
ark-crypto-primitives={ version="0.5", features=["sponge"] }
2225
des ="0.8"
2326
chacha20 ="0.9"
27+
hex-literal ="0.4"
2428

2529
[[bin]]
2630
name="hmac_sha256_bin"

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ to run example code.
3434

3535
## Primitives
3636

37-
- [Finite Group](src/field/group.rs)
38-
- [Fields and Their Extensions](src/field/README.md)
39-
- [Binary Fields](src/field/binary_towers/README.md)
37+
- **Fundamental Algebraic Structures**
38+
- [Group](src/algebra/group/README.md)
39+
- [Fields and Their Extensions](src/algebra/field/README.md)
40+
- [Binary Fields](src/field/binary_towers/README.md)
4041
- [Curves and Their Pairings](src/curve/README.md)
4142
- [Polynomials](src/polynomial/mod.rs)
4243
- [KZG Commitments](src/kzg/README.md)
@@ -46,7 +47,9 @@ to run example code.
4647

4748
### Signatures
4849

49-
- [Tiny ECDSA](src/ecdsa.rs)
50+
- [Digital Signature Algorithms](src/dsa/README.md)
51+
- [Elliptic Curve Digital Signature Algorithm(ECDSA)](src/dsa/ecdsa.rs)
52+
- [Edwards-Curve Digital Signature Algorithm(EdDSA)](src/dsa/eddsa/mod.rs)
5053

5154
### Encryption
5255

@@ -68,10 +71,6 @@ to run example code.
6871
- [Sha256 Hash](src/hashes/README.md)
6972
- [Poseidon Hash](src/hashes/poseidon/README.md)
7073

71-
## In Progress
72-
73-
- [ ] Edwards curve Signatures (EdDSA)
74-
7574
## Resources
7675

7776
We have found the following resources helpful in understanding the foundational mathematics behind this implementation. After going through these, you should be able to understand the codebase

SUMMARY.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
- [Introduction](README.md)
2+
- [Algebra](src/algebra/README.md)
3+
- [Field](src/algebra/field/README.md)
4+
- [Binary Towers](src/algebra/field/binary_towers/README.md)
5+
- [Group](src/algebra/group/README.md)
6+
- [Codes](src/codes/README.md)
7+
- [Compiler](src/compiler/README.md)
8+
- [Curve](src/curve/README.md)
9+
- [Digital Signature Algorithms](src/dsa/README.md)
10+
- [Encryption]()
11+
- [Asymmetric]()
12+
- [RSA](src/encryption/asymmetric/rsa/README.md)
13+
- [Symmetric Encryption](src/encryption/symmetric/README.md)
14+
- [AES](src/encryption/symmetric/aes/README.md)
15+
- [ChaCha](src/encryption/symmetric/chacha/README.md)
16+
- [DES](src/encryption/symmetric/des/README.md)
17+
- [Modes](src/encryption/symmetric/modes/README.md)
18+
- [Hashes](src/hashes/README.md)
19+
- [Poseidon](src/hashes/poseidon/README.md)
20+
- [HMAC](src/hmac/README.md)
21+
- [KZG](src/kzg/README.md)
22+
- [Merkle Trees](src/tree/README.md)

src/encryption/symmetric/modes/figure_cbc.svg renamed to assets/figure_cbc.svg

File renamed without changes.

0 commit comments

Comments
 (0)