Skip to content

Commit d8b221c

Browse files
committed
syn2mas: use ChaCha20 for all operations
1 parent 7bc0267 commit d8b221c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/syn2mas/src/migration.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ async fn migrate_users(
340340

341341
let (tx, mut rx) = tokio::sync::mpsc::channel::<SynapseUser>(10 * 1024 * 1024);
342342

343-
let mut rng = rand_chacha::ChaCha8Rng::from_rng(rng).expect("failed to seed rng");
343+
// create a new RNG seeded from the passed RNG so that we can move it into the
344+
// spawned task
345+
let mut rng = rand_chacha::ChaChaRng::from_rng(rng).expect("failed to seed rng");
344346
let task = tokio::spawn(
345347
async move {
346348
let mut user_buffer = MasWriteBuffer::new(&mas, MasWriter::write_users);
@@ -645,6 +647,8 @@ async fn migrate_devices(
645647

646648
let (tx, mut rx) = tokio::sync::mpsc::channel(10 * 1024 * 1024);
647649

650+
// create a new RNG seeded from the passed RNG so that we can move it into the
651+
// spawned task
648652
let mut rng = rand_chacha::ChaChaRng::from_rng(rng).expect("failed to seed rng");
649653
let task = tokio::spawn(
650654
async move {
@@ -784,6 +788,8 @@ async fn migrate_unrefreshable_access_tokens(
784788
let (tx, mut rx) = tokio::sync::mpsc::channel(10 * 1024 * 1024);
785789

786790
let now = clock.now();
791+
// create a new RNG seeded from the passed RNG so that we can move it into the
792+
// spawned task
787793
let mut rng = rand_chacha::ChaChaRng::from_rng(rng).expect("failed to seed rng");
788794
let task = tokio::spawn(
789795
async move {

0 commit comments

Comments
 (0)