use crate::ir::DataType;
use crate::ops::Backend;
use crate::ops::{IntrinsicDescriptor, OpSpec};
pub const WGSL: &str = include_str!("wgsl_shaders/sha256.wgsl");
pub fn hkdf_expand(prk: &[u8], info: &[u8], length: u32) -> Result<Vec<u8>, String> {
crate::ops::hash::reference::kdf::hkdf_expand(prk, info, length)
}
pub const INPUTS: &[DataType] = &[DataType::Bytes, DataType::Bytes, DataType::U32];
pub const LAWS: &[crate::ops::AlgebraicLaw] = &[];
pub const OUTPUTS: &[DataType] = &[DataType::Bytes];
pub const SPEC: OpSpec = OpSpec::intrinsic(
"hash.hkdf_expand",
INPUTS,
OUTPUTS,
LAWS,
wgsl_only,
IntrinsicDescriptor::new(
"hash.hkdf_expand.wgsl",
"wgsl-hkdf-expand-sha256",
crate::ops::hash::cpu_refs::hkdf_expand,
),
);
pub fn wgsl_only(backend: &Backend) -> bool {
matches!(backend, Backend::Wgsl)
}