{"id":13578718,"url":"https://github.com/mcginty/snow","last_synced_at":"2025-05-13T17:05:21.020Z","repository":{"id":40244180,"uuid":"71048006","full_name":"mcginty/snow","owner":"mcginty","description":"A Rust implementation of the Noise Protocol Framework","archived":false,"fork":false,"pushed_at":"2025-04-18T08:40:53.000Z","size":3042,"stargazers_count":935,"open_issues_count":35,"forks_count":122,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-04-24T00:41:33.493Z","etag":null,"topics":["crypto","cryptography","noise","noise-protocol","noise-protocol-framework","rust","security"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcginty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-10-16T12:09:30.000Z","updated_at":"2025-04-18T13:07:51.000Z","dependencies_parsed_at":"2023-02-18T04:45:52.472Z","dependency_job_id":"30aed9c6-87e9-479d-af53-0d09dfd169e8","html_url":"https://github.com/mcginty/snow","commit_stats":{"total_commits":526,"total_committers":38,"mean_commits":"13.842105263157896","dds":"0.26615969581749055","last_synced_commit":"b9626a23d6be0e42c194365401b2c051a8d87659"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcginty%2Fsnow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcginty%2Fsnow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcginty%2Fsnow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcginty%2Fsnow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcginty","download_url":"https://codeload.github.com/mcginty/snow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990460,"owners_count":21995774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","cryptography","noise","noise-protocol","noise-protocol-framework","rust","security"],"created_at":"2024-08-01T15:01:33.172Z","updated_at":"2025-05-13T17:05:20.996Z","avatar_url":"https://github.com/mcginty.png","language":"Rust","readme":"# Snow\n\n[![Crates.io](https://img.shields.io/crates/v/snow.svg)](https://crates.io/crates/snow)\n[![Docs.rs](https://docs.rs/snow/badge.svg)](https://docs.rs/snow)\n[![Build Status](https://github.com/mcginty/snow/workflows/Build/badge.svg)](https://github.com/mcginty/snow/actions)\n[![dependency status](https://deps.rs/repo/github/mcginty/snow/status.svg)](https://deps.rs/repo/github/mcginty/snow)\n\n![totally official snow logo](https://i.imgur.com/gFgvo49.jpg?1)\n\nAn implementation of Trevor Perrin's [Noise Protocol](https://noiseprotocol.org/) that\nis designed to be Hard To Fuck Up™.\n\n🔥 **Warning** 🔥 This library has not received any formal audit.\n\n## What's it look like?\n\nSee `examples/simple.rs` for a more complete TCP client/server example.\n\n```rust\nlet mut noise = snow::Builder::new(\"Noise_NN_25519_ChaChaPoly_BLAKE2s\".parse()?)\n                    .build_initiator()?;\n\nlet mut buf = [0u8; 65535];\n\n// write first handshake message\nnoise.write_message(\u0026[], \u0026mut buf)?;\n\n// receive response message\nlet incoming = receive_message_from_the_mysterious_ether();\nnoise.read_message(\u0026incoming, \u0026mut buf)?;\n\n// complete handshake, and transition the state machine into transport mode\nlet mut noise = noise.into_transport_mode()?;\n```\n\nSee the full documentation at [https://docs.rs/snow](https://docs.rs/snow).\n\n## Implemented\n\nSnow is currently tracking against [Noise spec revision 34](https://noiseprotocol.org/noise_rev34.html).\n\nHowever, a not all features have been implemented yet (pull requests welcome):\n\n- [ ] [The `fallback` modifier](https://noiseprotocol.org/noise_rev34.html#the-fallback-modifier)\n\n## Crypto\n\nCryptographic providers are swappable through `Builder::with_resolver()`, but by default\nit chooses select, artisanal pure-Rust implementations (see `Cargo.toml` for a quick\noverview).\n\n### Other Providers\n\n#### ring\n\n[ring](https://github.com/briansmith/ring) is a crypto library based off of BoringSSL\nand is significantly faster than most of the pure-Rust implementations.\n\nIf you enable the `ring-resolver` feature, Snow will include a `resolvers::ring` module\nas well as a `RingAcceleratedResolver` available to be used with\n`Builder::with_resolver()`.\n\nIf you enable the `ring-accelerated` feature, Snow will default to choosing `ring`'s\ncrypto implementations when available.\n\n### Resolver primitives supported\n\n|                                        | default            | ring               |\n| -------------------------------------: | :----------------: | :----------------: |\n|     CSPRNG                             | :heavy_check_mark: | :heavy_check_mark: |\n|      25519                             | :heavy_check_mark: | :heavy_check_mark: |\n|        448                             |                    |                    |\n|      P-256\u003csup\u003e:checkered_flag:\u003c/sup\u003e  | :heavy_check_mark: |                    |\n|     AESGCM                             | :heavy_check_mark: | :heavy_check_mark: |\n| ChaChaPoly                             | :heavy_check_mark: | :heavy_check_mark: |\n| XChaChaPoly\u003csup\u003e:checkered_flag:\u003c/sup\u003e | :heavy_check_mark: |                    |\n|     SHA256                             | :heavy_check_mark: | :heavy_check_mark: |\n|     SHA512                             | :heavy_check_mark: | :heavy_check_mark: |\n|    BLAKE2s                             | :heavy_check_mark: |                    |\n|    BLAKE2b                             | :heavy_check_mark: |                    |\n\n\u003e [!Note]\n\u003e :checkered_flag: P-256 and XChaChaPoly are not in the official specification of Noise, and thus need to be enabled\nvia the feature flags `use-p256` and `use-xchacha20poly1305`, respectively.\n\n## `no_std` support and feature selection\n\nSnow can be used in `no_std` environments if `alloc` is provided.\n\nBy default, Snow uses the standard library, default crypto resolver and a selected collection\nof crypto primitives. To use Snow in `no_std` environments or make other kinds of customized\nsetups, use Snow with `default-features = false`. This way you will individually select\nthe components you wish to use. `default-resolver` is the only built-in resolver that\ncurrently supports `no_std`.\n\nTo use a custom setup with `default-resolver`, enable your desired selection of cryptographic primitives:\n\n|             | Primitive                              | Feature flag           |\n| ----------: | :------------------------------------- | :--------------------- |\n| **DHs**     | Curve25519                             | `use-curve25519`       |\n|             | P-256\u003csup\u003e:checkered_flag:\u003c/sup\u003e       | `use-p256`             |\n| **Ciphers** | AES-GCM                                | `use-aes-gcm`          |\n|             | ChaChaPoly                             | `use-chacha20poly1305` |\n|             | XChaChaPoly\u003csup\u003e:checkered_flag:\u003c/sup\u003e | `use-xchacha20poly1305`|\n| **Hashes**  | SHA-256                                | `use-sha2`             |\n|             | SHA-512                                | `use-sha2`             |\n|             | BLAKE2s                                | `use-blake2`           |\n|             | BLAKE2b                                | `use-blake2`           |\n\n\u003e [!Note]\n\u003e :checkered_flag: XChaChaPoly and P-256 are not in the official specification of Noise, but they are supported\nby Snow.\n\n### Example configurations\n\n**Curve25519 + AES-GCM + SHA-2** with standard library features.\n```toml\ndefault-features = false\nfeatures = [\n    \"use-curve25519\",\n    \"use-aes-gcm\",\n    \"use-sha2\",\n    \"std\",\n]\n```\n\n**Curve25519 + ChaChaPoly + BLAKE2** without standard library.\n```toml\ndefault-features = false\nfeatures = [\n    \"use-curve25519\",\n    \"use-chacha20poly1305\",\n    \"use-blake2\",\n]\n```\n\n### `getrandom` support\n\nMost crypto implementations supported by `default-resolver` will require\n[`getrandom`](getrandom).\n\nIf your target platform is not directly supported\nyou might have to provide a custom implementation in your crate root.\nCheck out their [documentation](getrandom-custom) for details.\n\n[getrandom]: https://crates.io/crates/getrandom\n[getrandom-custom]: https://docs.rs/getrandom/0.2.15/getrandom/macro.register_custom_getrandom.html\n\n## License\n\n`snow` is offered with a dual choice-of-license between:\n\n- [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n- [MIT license](https://opensource.org/license/mit/)\n\nwhere you may choose either of these licenses to follow for this work.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcginty%2Fsnow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcginty%2Fsnow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcginty%2Fsnow/lists"}