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