File tree 3 files changed +13
-9
lines changed
crates/components/hmac-sha256/src
3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 5
5
//! HMAC(m) = H((key' xor opad) || H((key' xor ipad) || m))
6
6
//!
7
7
//! * H - SHA256 hash function
8
- //! * key' - key padded with zero bytes to 64 bytes (we do not support longer keys)
8
+ //! * key' - key padded with zero bytes to 64 bytes (we do not support longer
9
+ //! keys)
9
10
//! * opad - 64 bytes of 0x5c
10
11
//! * ipad - 64 bytes of 0x36
11
12
//! * m - message
12
13
//!
13
- //! This implementation computes HMAC-SHA256 using intermediate results `outer_partial` and `inner_local`.
14
- //! Then HMAC(m) = H(outer_partial || inner_local)
14
+ //! This implementation computes HMAC-SHA256 using intermediate results
15
+ //! `outer_partial` and `inner_local`. Then HMAC(m) = H(outer_partial ||
16
+ //! inner_local)
15
17
//!
16
18
//! * `outer_partial` - key' xor opad
17
19
//! * `inner_local` - H((key' xor ipad) || m)
Original file line number Diff line number Diff line change 1
1
//! Provides [`PrfFunction`], for computing the TLS 1.2 PRF.
2
2
//!
3
- //! If the feature flag `local-inner-hash` is set, provides an implementation which computes
4
- //! some hashes locally.
3
+ //! If the feature flag `local-inner-hash` is set, provides an implementation
4
+ //! which computes some hashes locally.
5
5
6
6
use crate :: { sha256:: Sha256 , PrfError } ;
7
7
use mpz_circuits:: circuits:: xor;
@@ -24,8 +24,8 @@ mod local;
24
24
#[ cfg( feature = "local-inner-hash" ) ]
25
25
pub ( crate ) use local:: PrfFunction ;
26
26
27
- /// Depending on the provided `mask` computes and returns `outer_partial` or `inner_partial` for
28
- /// HMAC-SHA256.
27
+ /// Depending on the provided `mask` computes and returns `outer_partial` or
28
+ /// `inner_partial` for HMAC-SHA256.
29
29
///
30
30
/// # Arguments
31
31
///
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ impl Sha256 {
30
30
/// # Arguments
31
31
///
32
32
/// * `state` - The starting state for the SHA256 compression function.
33
- /// * `processed` - The number of already processed bytes corresponding to `state`.
33
+ /// * `processed` - The number of already processed bytes corresponding to
34
+ /// `state`.
34
35
pub ( crate ) fn set_state ( & mut self , state : Array < U32 , 8 > , processed : usize ) -> & mut Self {
35
36
self . state = Some ( state) ;
36
37
self . processed = processed;
@@ -49,7 +50,8 @@ impl Sha256 {
49
50
50
51
/// Computes the padding for SHA256.
51
52
///
52
- /// Padding is computed depending on [`Self::state`] and [`Self::processed`].
53
+ /// Padding is computed depending on [`Self::state`] and
54
+ /// [`Self::processed`].
53
55
///
54
56
/// # Arguments
55
57
///
You can’t perform that action at this time.
0 commit comments