use crate::ir::DataType;
use crate::ops::Backend;
use crate::ops::{IntrinsicDescriptor, OpSpec};
pub const WGSL: &str = include_str!("wgsl/hmac_md5.wgsl");
#[must_use]
pub fn hmac_md5(key: &[u8], msg: &[u8]) -> [u32; 4] {
crate::ops::hash::reference::hmac::hmac_md5_words(key, msg)
}
pub const INPUTS: &[DataType] = &[DataType::Bytes, DataType::Bytes];
pub const LAWS: &[crate::ops::AlgebraicLaw] = &[];
pub const OUTPUTS: &[DataType] = &[const { DataType::U32 }; 4];
pub const SPEC: OpSpec = OpSpec::intrinsic(
"hash.hmac_md5",
INPUTS,
OUTPUTS,
LAWS,
wgsl_only,
IntrinsicDescriptor::new(
"hash.hmac_md5.wgsl",
"wgsl-hmac-md5",
crate::ops::hash::cpu_refs::hmac_md5,
),
);
pub fn wgsl_only(backend: &Backend) -> bool {
matches!(backend, Backend::Wgsl)
}