Skip to content

Commit fe2eed1

Browse files
committed
Remove old notes
1 parent 2d1ef1b commit fe2eed1

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/crypto/cipher.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,9 @@ impl EncryptCipher {
136136
Ok((Self { push_stream }, msg))
137137
}
138138

139-
// Possible API's:
140-
// encrypted message is (tag + encrypted + mac )
141-
// to have *zero* alocations we could
142-
// * take a buffer of the expected final length, plantext starts at 1 to 1 + planetext.len()
143-
// * final length is 1 + plaintext.len() + mac.len()
144-
// * we write tag to 0
145-
// * encrypt plain text part in place
146-
// * write mac to end
147-
//
148-
// it would be akward to take an array like this. We could infer the plaintext via the buffer
149-
// it's range would be (1..(buf.len() - mac.len()))
150-
// encypt-in-place the palintext,
151-
// For now... let's just return the encrypted buffer
152-
//
139+
// TODO make this work in-place
153140
/// Encrypts `msg` and returns the encrypted bytes
154141
pub(crate) fn encrypt(&mut self, msg: &[u8]) -> io::Result<Vec<u8>> {
155-
// NB: the result is written in place to the provided, however the buffer must be able to
156-
// grow, since the encrypted message is bigger. So here we convert the slice to a vec.
157142
let mut out = msg.to_vec();
158143
self.push_stream
159144
.push(&mut out, &[], Tag::Message)

0 commit comments

Comments
 (0)