Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 75 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## How to use this fork

This repository is a fork of https://github.com/cloudflare/boringtun.
We aim for 100% API compatibility with upstream.
We aim for a high API compatibility with upstream.
As such, the best way to use this fork is by patching the `boringtun` dependency in your `Cargo.toml`:

```toml
Expand All @@ -15,6 +15,9 @@ boringtun = { git = "https://github.com/firezone/boringtun", branch = "master" }

The full list of patches in this fork over upstream can be seen in [here](https://github.com/cloudflare/boringtun/compare/master...firezone:boringtun:master).

Up until [37739b0a366ca73029ada59c043bf1d3e56f97f6](https://github.com/firezone/boringtun/commit/37739b0a366ca73029ada59c043bf1d3e56f97f6), all changes are fully backwards-compatible.
Going forward, we bumped the version to 0.7 and made some breaking changes like bumping `x25519-dalek` and `rand` as well as removing some deprecated APIs.

## Warning
Boringtun is currently undergoing a restructuring. You should probably not rely on or link to
the master branch right now. Instead you should use the crates.io page.
Expand Down
2 changes: 1 addition & 1 deletion boringtun-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ tracing-subscriber = "0.3.20"
tracing-appender = "0.2.3"

[dependencies.boringtun]
version = "0.6.0"
version = "0.7.0"
path = "../boringtun"
features = ["device"]
7 changes: 4 additions & 3 deletions boringtun/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "boringtun"
description = "an implementation of the WireGuard® protocol designed for portability and speed"
version = "0.6.1"
version = "0.7.0"
authors = [
"Noah Kennedy <[email protected]>",
"Andy Grover <[email protected]>",
Expand Down Expand Up @@ -31,11 +31,12 @@ tracing-subscriber = { version = "0.3", features = ["fmt"], optional = true }
ip_network = "0.4.1"
ip_network_table = "0.2.0"
ring = "0.17"
x25519-dalek = { version = "2.0.1", features = [
x25519-dalek = { version = "=3.0.0-pre.1", features = [
"reusable_secrets",
"static_secrets",
"os_rng"
] }
rand = "0.8.5"
rand = "0.9.1"
chacha20poly1305 = "0.10.1"
aead = "0.5.2"
blake2 = "0.10"
Expand Down
6 changes: 3 additions & 3 deletions boringtun/benches/crypto_benches/chacha20poly1305_benching.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use aead::{AeadInPlace, KeyInit};
use criterion::{BenchmarkId, Criterion, Throughput};
use rand::{rngs::OsRng, RngCore};
use rand::{rngs::OsRng, RngCore, TryRngCore};
use ring::aead::{Aad, LessSafeKey, Nonce, UnboundKey, CHACHA20_POLY1305};

fn chacha20poly1305_ring(key_bytes: &[u8], buf: &mut [u8]) {
Expand Down Expand Up @@ -49,7 +49,7 @@ pub fn bench_chacha20poly1305(c: &mut Criterion) {
let mut key = [0; 32];
let mut buf = vec![0; i + 16];

let mut rng = OsRng;
let mut rng = OsRng.unwrap_err();

rng.fill_bytes(&mut key);
rng.fill_bytes(&mut buf);
Expand All @@ -65,7 +65,7 @@ pub fn bench_chacha20poly1305(c: &mut Criterion) {
let mut key = [0; 32];
let mut buf = vec![0; i + 16];

let mut rng = OsRng;
let mut rng = OsRng.unwrap_err();

rng.fill_bytes(&mut key);
rng.fill_bytes(&mut buf);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::Criterion;
use rand::rngs::OsRng;
use rand::{rngs::OsRng, TryRngCore};

pub fn bench_x25519_public_key(c: &mut Criterion) {
let mut group = c.benchmark_group("x25519_public_key");
Expand All @@ -8,7 +8,7 @@ pub fn bench_x25519_public_key(c: &mut Criterion) {

group.bench_function("x25519_public_key_dalek", |b| {
b.iter(|| {
let secret_key = x25519_dalek::StaticSecret::random_from_rng(OsRng);
let secret_key = x25519_dalek::StaticSecret::random_from_rng(&mut OsRng.unwrap_mut());
let public_key = x25519_dalek::PublicKey::from(&secret_key);

(secret_key, public_key)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
use criterion::{BatchSize, Criterion};
use rand::rngs::OsRng;
use rand::{rngs::OsRng, TryRngCore};

pub fn bench_x25519_shared_key(c: &mut Criterion) {
let mut group = c.benchmark_group("x25519_shared_key");

group.sample_size(1000);

group.bench_function("x25519_shared_key_dalek", |b| {
let public_key =
x25519_dalek::PublicKey::from(&x25519_dalek::StaticSecret::random_from_rng(OsRng));
let public_key = x25519_dalek::PublicKey::from(
&x25519_dalek::StaticSecret::random_from_rng(&mut OsRng.unwrap_mut()),
);

b.iter_batched(
|| x25519_dalek::StaticSecret::random_from_rng(OsRng),
|| x25519_dalek::StaticSecret::random_from_rng(&mut OsRng.unwrap_mut()),
|secret_key| secret_key.diffie_hellman(&public_key),
BatchSize::SmallInput,
);
Expand Down
Loading
Loading