Skip to content

Commit 26ce60c

Browse files
committed
remove output decoding for p
1 parent 9398382 commit 26ce60c

File tree

1 file changed

+7
-9
lines changed
  • crates/components/hmac-sha256/src/prf/function

1 file changed

+7
-9
lines changed

crates/components/hmac-sha256/src/prf/function/reduced.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl PrfFunction {
6565
pub(crate) fn wants_flush(&mut self) -> bool {
6666
let last_p = self.p.last().expect("Prf should be allocated");
6767

68-
if let State::Finished { .. } = last_p.state {
68+
if let State::Done = last_p.state {
6969
return false;
7070
}
7171
true
@@ -86,7 +86,7 @@ impl PrfFunction {
8686
State::Assigned { output } => {
8787
if let Some(output) = output.try_recv().map_err(PrfError::vm)? {
8888
let output = output.to_vec();
89-
a.state = State::Finished {
89+
a.state = State::Decoded {
9090
output: output.clone(),
9191
};
9292
self.a_msg = output;
@@ -97,17 +97,14 @@ impl PrfFunction {
9797

9898
match &mut p.state {
9999
State::Init { .. } => {
100-
if let State::Finished { output } = &a.state {
100+
if let State::Decoded { output } = &a.state {
101101
let mut p_msg = output.to_vec();
102102
p_msg.extend_from_slice(&self.start_seed_label);
103103
p.assign_inner_local(vm, inner_partial, &p_msg)?;
104104
}
105105
}
106-
State::Assigned { output } => {
107-
if let Some(output) = output.try_recv().map_err(PrfError::vm)? {
108-
let output = output.to_vec();
109-
p.state = State::Finished { output };
110-
}
106+
State::Assigned { .. } => {
107+
p.state = State::Done;
111108
}
112109
_ => (),
113110
}
@@ -216,9 +213,10 @@ enum State {
216213
Assigned {
217214
output: DecodeFutureTyped<BitVec, [u8; 32]>,
218215
},
219-
Finished {
216+
Decoded {
220217
output: Vec<u8>,
221218
},
219+
Done,
222220
}
223221

224222
#[derive(Debug)]

0 commit comments

Comments
 (0)