Skip to content

Commit 2d1ef1b

Browse files
committed
RawEncCipher -> EncCipher
1 parent 76b3a27 commit 2d1ef1b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/crypto/cipher.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,17 @@ fn write_stream_id(handshake_hash: &[u8], is_initiator: bool, out: &mut [u8]) {
102102
//NB "raw" here means UN-framed. No frame header.
103103
const RAW_HEADER_MSG_LEN: usize = STREAM_ID_LENGTH + Header::BYTES;
104104

105-
pub(crate) struct RawEncryptCipher {
105+
pub(crate) struct EncryptCipher {
106106
push_stream: PushStream,
107107
}
108108

109-
impl std::fmt::Debug for RawEncryptCipher {
109+
impl std::fmt::Debug for EncryptCipher {
110110
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
111111
write!(f, "RawEncryptCipher(crypto_secretstream)")
112112
}
113113
}
114114

115-
impl RawEncryptCipher {
115+
impl EncryptCipher {
116116
pub(crate) fn from_handshake_tx(
117117
handshake_result: &HandshakeResult,
118118
) -> std::io::Result<(Self, Vec<u8>)> {

src/crypto/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mod cipher;
22
mod curve;
33
mod handshake;
4-
pub(crate) use cipher::{DecryptCipher, RawEncryptCipher};
4+
pub(crate) use cipher::{DecryptCipher, EncryptCipher};
55
pub(crate) use handshake::{Handshake, HandshakeResult};

src/noise.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::{
1010
use tracing::{debug, error, instrument, trace, warn};
1111

1212
use crate::{
13-
crypto::{DecryptCipher, Handshake, HandshakeResult, RawEncryptCipher},
13+
crypto::{DecryptCipher, EncryptCipher, Handshake, HandshakeResult},
1414
Uint24LELengthPrefixedFraming,
1515
};
1616

@@ -27,8 +27,8 @@ pub fn encrypted_framed_message_channel<IO: AsyncWrite + AsyncRead + Send + Unpi
2727
pub(crate) enum Step {
2828
NotInitialized,
2929
Handshake(Box<Handshake>),
30-
SecretStream((RawEncryptCipher, HandshakeResult)),
31-
Established((RawEncryptCipher, DecryptCipher, HandshakeResult)),
30+
SecretStream((EncryptCipher, HandshakeResult)),
31+
Established((EncryptCipher, DecryptCipher, HandshakeResult)),
3232
}
3333

3434
impl Step {
@@ -458,7 +458,7 @@ fn poll_decrypt(
458458

459459
#[instrument(skip_all)]
460460
fn poll_encrypt(
461-
encryptor: &mut RawEncryptCipher,
461+
encryptor: &mut EncryptCipher,
462462
encrypted_tx: &mut VecDeque<Vec<u8>>,
463463
plain_tx: &mut VecDeque<Vec<u8>>,
464464
is_initiator: bool,
@@ -568,7 +568,7 @@ fn handle_setup_message(
568568
};
569569
// The cipher will be put to use to the writer only after the peer's answer has come
570570
let (cipher, init_msg) =
571-
match RawEncryptCipher::from_handshake_tx(handshake_result) {
571+
match EncryptCipher::from_handshake_tx(handshake_result) {
572572
Ok(x) => x,
573573
Err(e) => {
574574
error!("from_handshake_tx error {e:?}");

0 commit comments

Comments
 (0)