Cargo.lock
Cargo.lock
This file has not been changed.
Cargo.toml
Cargo.toml
This file has not been changed.
sachy-crypto/Cargo.toml
sachy-crypto/Cargo.toml
This file has not been changed.
sachy-crypto/README.md
sachy-crypto/README.md
This file has not been changed.
+7
-5
sachy-crypto/src/lib.rs
+7
-5
sachy-crypto/src/lib.rs
···
256
256
kdf.expand(b"SachY-Crypt0", &mut key)
257
257
.map_err(|_| ProtoError)?;
258
258
259
-
kdf.expand(b"N*nceOne", &mut first).map_err(|_| ProtoError)?;
260
-
kdf.expand(b"N#nceTwo", &mut second).map_err(|_| ProtoError)?;
259
+
kdf.expand(b"N*nceOne", &mut first)
260
+
.map_err(|_| ProtoError)?;
261
+
kdf.expand(b"N#nceTwo", &mut second)
262
+
.map_err(|_| ProtoError)?;
261
263
262
264
Ok(Self {
263
265
aead: ChaCha20Poly1305::new(&key.into()),
···
346
348
let mut buffer2 = vec![0u8; 64];
347
349
348
350
// Using the same nonce to check that the internal AEAD states match. Normally, client/server
349
-
// would work with randomised nonces, because nonce reuse is BAD
351
+
// would work with unique derived nonces, because nonce reuse is BAD
350
352
alice.aead.encrypt_in_place(&nonce, &[], &mut buffer1)?;
351
353
bob.aead.encrypt_in_place(&nonce, &[], &mut buffer2)?;
352
354
···
354
356
// so the outputs should match each other
355
357
assert_eq!(&buffer1, &buffer2);
356
358
357
-
// Both Transports have derived base nonces for each client/server context.
358
-
// Client nonces will not match Server nonces.
359
+
// Both Transports have derived base nonces for each context.
360
+
// First context nonces will not match Second context nonces.
359
361
assert_eq!(alice.first, bob.first);
360
362
assert_eq!(alice.second, bob.second);
361
363
assert_ne!(alice.first, alice.second);
History
18 rounds
0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
pull request successfully merged
1 commit
expand
collapse
Sachy's crypto scheme lmao
1/2 failed, 1/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
1/2 failed, 1/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 failed
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao
2/2 success
expand
collapse
expand 0 comments
1 commit
expand
collapse
Sachy's crypto scheme lmao