···2233use std::{boxed::Box, string::String, vec::Vec};
4455-use hex;
65use serde::{Deserialize, Deserializer, de};
7687use crate::strobe::{SecurityParameter, StrobeState};
···3837 Length(usize),
3938}
40394040+/// A boxed closure type, representing the operation to be executed by our Kat.
4141+type KatClosure<'s> = Box<dyn for<'a> Fn(&mut StrobeState, DataOrLength<'a>, bool) + 's>;
4242+4143// Given the name of the operation and meta flag, returns a closure that performs this operation.
4242-// The types are kind of a mess, because the input and output types of the closure have to fit all
4343-// possible STROBE operations.
4444-fn get_operation<'s>(
4545- op_name: &'s str,
4646- meta: bool,
4747-) -> Box<dyn for<'a> Fn(&mut StrobeState, DataOrLength<'a>, bool) + 's> {
4444+// Returns a boxed closure, because the input and output types of the closure have to fit all
4545+// possible STROBE operations and it is easier to erase that via boxing.
4646+fn get_operation<'s>(op_name: &'s str, meta: bool) -> KatClosure<'s> {
4847 let f = move |s: &mut StrobeState, dol: DataOrLength, more: bool| {
4948 let data = match dol {
5049 DataOrLength::Length(len) => {
···153152154153fn security_param_from_bits<'de, D: Deserializer<'de>>(
155154 deserializer: D,
156156-) -> Result<SecurityParameter, D::Error>
157157-where
158158- D: Deserializer<'de>,
159159-{
155155+) -> Result<SecurityParameter, D::Error> {
160156 match u64::deserialize(deserializer)? {
161157 128 => Ok(SecurityParameter::B128),
162158 256 => Ok(SecurityParameter::B256),