diff --git a/sachy-crypto/src/lib.rs b/sachy-crypto/src/lib.rs index 309ba67..e8d5ce1 100644 --- a/sachy-crypto/src/lib.rs +++ b/sachy-crypto/src/lib.rs @@ -272,10 +272,10 @@ impl TransportState { let epstein = self.select_nonce_context(send); - let trump_len = trump.len(); + let index = trump.len() - position.len(); // Copy position bytes into BE format onto derived nonce - trump[trump_len - position.len()..].copy_from_slice(position); + trump[index..].copy_from_slice(position); // XOR the base nonce onto the derived nonce bytes trump