Skip to content

Commit 4cfcbed

Browse files
committed
Configure Rust template accordingly
1 parent 6d4c698 commit 4cfcbed

File tree

10 files changed

+118
-174
lines changed

10 files changed

+118
-174
lines changed

.all-contributorsrc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"projectName": "crypto-primitives",
3+
"projectOwner": "NethermindEth",
4+
"repoType": "github",
5+
"repoHost": "https://github.com",
6+
"files": [
7+
"README.md"
8+
],
9+
"imageSize": 100,
10+
"commit": true,
11+
"commitConvention": "none",
12+
"contributors": [
13+
{
14+
"login": "frozenspider",
15+
"name": "Alex Abdugafarov",
16+
"avatar_url": "https://avatars.githubusercontent.com/u/2077017?v=4",
17+
"profile": "https://github.com/frozenspider",
18+
"contributions": [
19+
"code"
20+
]
21+
},
22+
{
23+
"login": "cupicmarko",
24+
"name": "Marko Cupic",
25+
"avatar_url": "https://avatars.githubusercontent.com/u/71461781?v=4",
26+
"profile": "https://github.com/cupicmarko",
27+
"contributions": [
28+
"review"
29+
]
30+
},
31+
{
32+
"login": "NiDimi",
33+
"name": "Nick Dimitriou",
34+
"avatar_url": "https://avatars.githubusercontent.com/u/81875532?v=4",
35+
"profile": "https://github.com/NiDimi",
36+
"contributions": [
37+
"review"
38+
]
39+
},
40+
{
41+
"login": "maksimryndin",
42+
"name": "maksimryndin",
43+
"avatar_url": "https://avatars.githubusercontent.com/u/16288656?v=4",
44+
"profile": "https://maksimryndin.github.io/",
45+
"contributions": [
46+
"review",
47+
"projectManagement"
48+
]
49+
}
50+
],
51+
"contributorsPerLine": 7,
52+
"linkToUsage": true
53+
}

.github/workflows/linter.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
- uses: dtolnay/rust-toolchain@nightly
17+
with:
18+
components: clippy, rustfmt
1619
- name: Run Fmt
17-
run: cargo fmt --all -- --check
20+
run: cargo +nightly fmt --all -- --check
1821

1922
- name: Run Clippy
2023
run: cargo clippy --all-targets --all-features

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# Rust/Cargo
66
debug/
77
target/
8-
# TODO(template) Cargo.lock should be tracked in binary crates, but not in libraries
98
Cargo.lock
109

1110
# MSVC Windows builds of rustc generate these, which store debugging information
@@ -15,4 +14,4 @@ Cargo.lock
1514
**/*.rs.bk
1615

1716
# Code coverage output
18-
lcov.info
17+
lcov.info

CODEOWNERS

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1 @@
1-
# CODEOWNERS TODO(template)
2-
#
3-
# This file defines code ownership for this repository.
4-
# Code owners are automatically requested for review when someone opens a pull request.
5-
#
6-
# 📖 Learn more: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
7-
8-
# =============================================================================
9-
# GLOBAL OWNERS
10-
# =============================================================================
11-
# These owners will be requested for review on ALL pull requests
12-
# Uncomment and customize the line below:
13-
14-
* @NethermindEth/zk-engineering
15-
# * @username1 @username2
16-
17-
# =============================================================================
18-
# PATH-BASED OWNERSHIP
19-
# =============================================================================
20-
# Define owners for specific files or directories
21-
# Examples:
22-
23-
# *.md @username
24-
# /docs/ @username1 @username2
1+
* @frozenspider @cupicmarko @NiDimi

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ After cloning the repository, follow the instructions below to run the documenta
3030
cargo doc
3131
```
3232

33-
Docs for `TODO(template) template_crate`:
33+
Docs for `crypto-primitives`:
3434

3535
```sh
36-
RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps -p template_crate --open
36+
RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps -p crypto_primitives --open
3737
```
3838

3939
## Performance
@@ -88,7 +88,7 @@ This command will open a browser page that contains a graphic representation of
8888

8989
### Dhat
9090
We can add Dhat as a dependency:
91-
```rust
91+
```toml
9292
[dependencies]
9393
dhat = "latest"
9494

@@ -114,4 +114,4 @@ But these 3 should be enough for the average application to identify bottlenecks
114114

115115
For async-rust we also recommend: [Tracing](https://crates.io/crates/tracing), [Tokio-Console](https://crates.io/crates/tokio-console), and [Oha](https://crates.io/crates/oha).
116116
For Rayon-based parallel Rust code, we recommend Samply.
117-
It provides good profiling despite missing some multithreading details.
117+
It provides good profiling despite missing some multithreading details.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ zeroize = { version = "1", default-features = false, optional = true }
3232

3333
[dev-dependencies]
3434
proptest = { version = "1.8.0", default-features = false, features = ["alloc"] }
35-
rand = { version = "0.9" }
35+
rand = { version = "0" }
3636

3737
[features]
3838
default = ["std"]

README.md

Lines changed: 48 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,59 @@
1-
# :crab: RUST PROJECT TEMPLATE - TODO(template) PUT PROJECT NAME HERE
2-
<!--`TODO(template) update each badge with your username and repository name.`-->
3-
[![Docs](https://github.com/NethermindEth/rust-template/actions/workflows/docs.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/docs.yml)
4-
[![Lint](https://github.com/NethermindEth/rust-template/actions/workflows/linter.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/linter.yml)
5-
[![Build](https://github.com/NethermindEth/rust-template/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/build-and-test.yml)
6-
[![Dependencies](https://github.com/NethermindEth/rust-template/actions/workflows/dependency-audit.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/dependency-audit.yml)
7-
[![UB](https://github.com/NethermindEth/rust-template/actions/workflows/ub-detection.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/ub-detection.yml)
8-
[![Coverage](https://github.com/NethermindEth/rust-template/actions/workflows/coverage.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/coverage.yml)
9-
<!-- You can replace them with a single badge if you create a main CI file that calls the other workflows
10-
[![CI](https://github.com/{{USERNAME}}/{{REPOSITORY}}/workflows/CI/badge.svg)](https://github.com/{{USERNAME}}/{{REPOSITORY}}/actions)
11-
-->
12-
<!--`TODO(template) update with your rust version`
13-
If you want to change from stable to Minimum Supported Rust Version (MSRV), replace the badge with:
14-
![MSRV](https://img.shields.io/badge/rustc-1.70+-ab6000.svg) TODO(template) update specific version
15-
-->
1+
# crypto-primitives
2+
3+
[![Docs](https://github.com/NethermindEth/crypto-primitives/actions/workflows/docs.yml/badge.svg)](https://github.com/NethermindEth/crypto-primitives/actions/workflows/docs.yml)
4+
[![Lint](https://github.com/NethermindEth/crypto-primitives/actions/workflows/linter.yml/badge.svg)](https://github.com/NethermindEth/crypto-primitives/actions/workflows/linter.yml)
5+
[![Build](https://github.com/NethermindEth/crypto-primitives/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/NethermindEth/crypto-primitives/actions/workflows/build-and-test.yml)
6+
[![Dependencies](https://github.com/NethermindEth/crypto-primitives/actions/workflows/dependency-audit.yml/badge.svg)](https://github.com/NethermindEth/crypto-primitives/actions/workflows/dependency-audit.yml)
7+
[![UB](https://github.com/NethermindEth/crypto-primitives/actions/workflows/ub-detection.yml/badge.svg)](https://github.com/NethermindEth/crypto-primitives/actions/workflows/ub-detection.yml)
8+
[![Coverage](https://github.com/NethermindEth/crypto-primitives/actions/workflows/coverage.yml/badge.svg)](https://github.com/NethermindEth/crypto-primitives/actions/workflows/coverage.yml)
169
![Rust](https://img.shields.io/badge/rust-stable-orange.svg)
17-
<!--`TODO(template) update license version if needed. Check LICENSE first`-->
1810
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
19-
<!--`TODO(template) update with your crate information. Remove if not needed.`-->
20-
[![Crates.io](https://img.shields.io/crates/v/{{CRATE_NAME}}.svg)](https://crates.io/crates/{{CRATE_NAME}})
21-
[![Documentation](https://docs.rs/{{CRATE_NAME}}/badge.svg)](https://docs.rs/{{CRATE_NAME}})
11+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
12+
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
13+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
2214

23-
TODO(template) describe the project
24-
25-
## TODO(template) - rust template usage (remove this section after setup)
26-
27-
This is a rust template from ZKE team :rocket: (a focus on cryptographic libs in sync Rust).
28-
29-
:bike: To use it - find `TODO(template)` over the repository and set appropriate values.
30-
31-
- [ ] Settings -> Collaborators and teams - add your team group as admins for the repo (e.g. [zk-engineering](https://github.com/orgs/NethermindEth/teams/zk-engineering))
32-
- [ ] Settings -> General -> Pull Requests - allow only `Allow squash merging`, also tick `Automatically delete head branches`
33-
- [ ] Settings -> Pages -> Build and deployment -> Source Github Actions
34-
- [ ] Update the description of the repo at the repo's page, add tag topics
35-
- [ ] Introduce necessary sections at the repo's page (releases, deployments etc)
36-
- [ ] Add a website url (if applicable) or a docs page (see [docs](./.github/workflows/docs.yml) flow for public repos)
37-
- [ ] Add [all contributors](https://allcontributors.org/docs/en/cli/installation)
38-
- [ ] Import protection rulesets (see below) in the repo settings (Settings -> Rules -> Rulesets -> Import a ruleset)
39-
- [ ] For binary crates with specific requirements to Rust features consider also [pinning](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) the rust toolchain version
40-
41-
Main branch protection
42-
43-
```json
44-
{
45-
"id": 4981961,
46-
"name": "Main protection",
47-
"target": "branch",
48-
"source_type": "Repository",
49-
"source": "NethermindEth/rust-template",
50-
"enforcement": "active",
51-
"conditions": {
52-
"ref_name": {
53-
"exclude": [],
54-
"include": [
55-
"~DEFAULT_BRANCH"
56-
]
57-
}
58-
},
59-
"rules": [
60-
{
61-
"type": "deletion"
62-
},
63-
{
64-
"type": "non_fast_forward"
65-
},
66-
{
67-
"type": "required_deployments",
68-
"parameters": {
69-
"required_deployment_environments": []
70-
}
71-
},
72-
{
73-
"type": "required_signatures"
74-
},
75-
{
76-
"type": "pull_request",
77-
"parameters": {
78-
"required_approving_review_count": 1,
79-
"dismiss_stale_reviews_on_push": false,
80-
"require_code_owner_review": false,
81-
"require_last_push_approval": false,
82-
"required_review_thread_resolution": true,
83-
"automatic_copilot_code_review_enabled": false,
84-
"allowed_merge_methods": [
85-
"merge",
86-
"squash",
87-
"rebase"
88-
]
89-
}
90-
}
91-
],
92-
"bypass_actors": []
93-
}
94-
```
95-
96-
Signed commits
97-
98-
```json
99-
{
100-
"id": 4982030,
101-
"name": "Signed commits",
102-
"target": "branch",
103-
"source_type": "Repository",
104-
"source": "NethermindEth/rust-template",
105-
"enforcement": "active",
106-
"conditions": {
107-
"ref_name": {
108-
"exclude": [],
109-
"include": [
110-
"~ALL"
111-
]
112-
}
113-
},
114-
"rules": [
115-
{
116-
"type": "required_signatures"
117-
}
118-
],
119-
"bypass_actors": []
120-
}
121-
```
122-
123-
## How to use
124-
125-
To generate a new project from this template, you need to install [cargo-generate](https://github.com/cargo-generate/cargo-generate) and run:
126-
127-
```sh
128-
cargo install cargo-generate
129-
130-
cargo generate --git https://github.com/NethermindEth/rust-template
131-
```
132-
133-
## Examples
134-
135-
See [examples](./examples/).
15+
Nethermind Crypto Primitives, a WIP endeavor to provide a set of primitives useful for cryptographic applications that can be mixed and matched together.
16+
Contains traits and their adapters for existing libraries as optional modules.
17+
Toolkit is fully modular, so you can use only the parts you need.
13618

13719
## License
13820

139-
TODO(template) - update [license](https://www.notion.so/nethermind/Open-Source-Software-Usage-and-Licensing-Policy-1c3360fc38d080fd9e61c29b35d1d5af) if needed.
140-
For commercial licenses it is required to get an approve from Legal.
141-
14221
Apache 2.0
14322

14423
## Would like to contribute?
14524

14625
see [Contributing](./CONTRIBUTING.md).
26+
27+
## Contributors ✨
28+
29+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
30+
31+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
32+
<!-- prettier-ignore-start -->
33+
<!-- markdownlint-disable -->
34+
<table>
35+
<tbody>
36+
<tr>
37+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/frozenspider"><img src="https://avatars.githubusercontent.com/u/2077017?v=4?s=100" width="100px;" alt="Alex Abdugafarov"/><br /><sub><b>Alex Abdugafarov</b></sub></a><br /><a href="https://github.com/NethermindEth/crypto-primitives/commits?author=frozenspider" title="Code">💻</a></td>
38+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/cupicmarko"><img src="https://avatars.githubusercontent.com/u/71461781?v=4?s=100" width="100px;" alt="Marko Cupic"/><br /><sub><b>Marko Cupic</b></sub></a><br /><a href="https://github.com/NethermindEth/crypto-primitives/pulls?q=is%3Apr+reviewed-by%3Acupicmarko" title="Reviewed Pull Requests">👀</a></td>
39+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/NiDimi"><img src="https://avatars.githubusercontent.com/u/81875532?v=4?s=100" width="100px;" alt="Nick Dimitriou"/><br /><sub><b>Nick Dimitriou</b></sub></a><br /><a href="https://github.com/NethermindEth/crypto-primitives/pulls?q=is%3Apr+reviewed-by%3ANiDimi" title="Reviewed Pull Requests">👀</a></td>
40+
<td align="center" valign="top" width="14.28%"><a href="https://maksimryndin.github.io/"><img src="https://avatars.githubusercontent.com/u/16288656?v=4?s=100" width="100px;" alt="maksimryndin"/><br /><sub><b>maksimryndin</b></sub></a><br /><a href="https://github.com/NethermindEth/crypto-primitives/pulls?q=is%3Apr+reviewed-by%3Amaksimryndin" title="Reviewed Pull Requests">👀</a> <a href="#projectManagement-maksimryndin" title="Project Management">📆</a></td>
41+
</tr>
42+
</tbody>
43+
<tfoot>
44+
<tr>
45+
<td align="center" size="13px" colspan="7">
46+
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
47+
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
48+
</img>
49+
</td>
50+
</tr>
51+
</tfoot>
52+
</table>
53+
54+
<!-- markdownlint-restore -->
55+
<!-- prettier-ignore-end -->
56+
57+
<!-- ALL-CONTRIBUTORS-LIST:END -->
58+
59+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ We ask you to please not publicly disclose any details of the vulnerability unti
77

88
**Please do not report security vulnerabilities through public GitHub issues.**
99

10-
Instead, please use GitHub's <!-- TODO(template) update repository url --> [report vulnerability](https://github.com/NethermindEth/rust-template/security/advisories/new) tool to create a draft advisory.
10+
Instead, please use GitHub's [report vulnerability](https://github.com/NethermindEth/crypto-primitives/security/advisories/new) tool to create a draft advisory.
1111
Please include as much information as you can provide (listed below) to help us better understand the nature and scope of the possible issue:
1212

1313
* Type of issue.
@@ -16,7 +16,7 @@ Please include as much information as you can provide (listed below) to help us
1616
* Step-by-step instructions to reproduce the issue and any additional configuration that might be needed.
1717
* Severity of the issue.
1818

19-
Alternatively, please email <!-- TODO(template) update the email address if needed --> [[email protected]](mailto:[email protected]).
19+
Alternatively, please email [[email protected]](mailto:[email protected]).
2020
In case of using the email, please also specify the affected repository.
2121

2222
We will try to address your email as soon as possible.
@@ -25,4 +25,4 @@ But if you have not received an answer after a couple of days, please follow up
2525
## Fixes
2626

2727
We will release fixes for verified security vulnerabilities.
28-
We expect to publish vulnerabilities using GitHub <!-- TODO(template) update repo information --> [security advisories](https://github.com/NethermindEth/rust-template/security/advisories).
28+
We expect to publish vulnerabilities using GitHub [security advisories](https://github.com/NethermindEth/crypto-primitives/security/advisories).

deny.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ highlight = "all"
7474

7575
[bans.workspace-dependencies]
7676
duplicates = 'deny'
77-
# TODO(template) you should provide an example with the lib usage
7877
unused = 'deny'
7978

8079
[sources]

proc-macros/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//! This crate provides a procedural macro to derive implementations of
2-
//! infallible checked operations for types that implement the corresponding
3-
//! non-checked operations.
1+
//! This internal helper crate provides a procedural macro to derive
2+
//! implementations of infallible checked operations for types that implement
3+
//! the corresponding non-checked operations.
44
mod infallible_checked_op;
55

66
use proc_macro::TokenStream;

0 commit comments

Comments
 (0)