File tree 3 files changed +26
-3
lines changed
3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -581,7 +581,8 @@ impl CipherCtxRef {
581
581
/// output size check removed. It can be used when the exact
582
582
/// buffer size control is maintained by the caller.
583
583
///
584
- /// SAFETY: The caller is expected to provide `output` buffer
584
+ /// # Safety
585
+ /// The caller is expected to provide `output` buffer
585
586
/// large enough to contain correct number of bytes. For streaming
586
587
/// ciphers the output buffer size should be at least as big as
587
588
/// the input buffer. For block ciphers the size of the output
@@ -693,7 +694,8 @@ impl CipherCtxRef {
693
694
/// This function is the same as [`Self::cipher_final`] but with
694
695
/// the output buffer size check removed.
695
696
///
696
- /// SAFETY: The caller is expected to provide `output` buffer
697
+ /// # Safety
698
+ /// The caller is expected to provide `output` buffer
697
699
/// large enough to contain correct number of bytes. For streaming
698
700
/// ciphers the output buffer can be empty, for block ciphers the
699
701
/// output buffer should be at least as big as the block.
Original file line number Diff line number Diff line change 119
119
//! ```
120
120
#![ doc( html_root_url = "https://docs.rs/openssl/0.10" ) ]
121
121
#![ warn( rust_2018_idioms) ]
122
- #![ allow( clippy:: uninlined_format_args) ]
122
+ #![ allow( clippy:: uninlined_format_args, clippy :: needless_doctest_main ) ]
123
123
124
124
#[ doc( inline) ]
125
125
pub use ffi:: init;
Original file line number Diff line number Diff line change @@ -696,6 +696,27 @@ impl Crypter {
696
696
self . ctx . cipher_update ( input, Some ( output) )
697
697
}
698
698
699
+ /// Feeds data from `input` through the cipher, writing encrypted/decrypted
700
+ /// bytes into `output`.
701
+ ///
702
+ /// The number of bytes written to `output` is returned. Note that this may
703
+ /// not be equal to the length of `input`.
704
+ ///
705
+ /// # Safety
706
+ ///
707
+ /// The caller must provide an `output` buffer large enough to contain
708
+ /// correct number of bytes. For streaming ciphers the output buffer size
709
+ /// should be at least as big as the input buffer. For block ciphers the
710
+ /// size of the output buffer depends on the state of partially updated
711
+ /// blocks.
712
+ pub unsafe fn update_unchecked (
713
+ & mut self ,
714
+ input : & [ u8 ] ,
715
+ output : & mut [ u8 ] ,
716
+ ) -> Result < usize , ErrorStack > {
717
+ self . ctx . cipher_update_unchecked ( input, Some ( output) )
718
+ }
719
+
699
720
/// Finishes the encryption/decryption process, writing any remaining data
700
721
/// to `output`.
701
722
///
You can’t perform that action at this time.
0 commit comments