oarust 0.9.0

GPU-first semantic computing engine written in Rust
// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
// schema=cryptography_ntt.json schema_version=1 generator_version=64
// schema_sha256=41becefeaa2223d2d91e896cab4a1ffe92425f0c6c3c14abd55a2cd517ab5fe7
// Public generic cyclic NTT; radix-two identities, portable paired words.
// No OA C++ generic NTT donor exists; fixed PQC transforms are distinct.
import attributes;
import prime62;
struct PushConstants {
	uint forward_index;
	uint inverse_index;
	uint count;
	uint grid_width;
	uint modulus_low;
	uint modulus_high;
	uint negative_inverse;
	uint root_low;
	uint root_high;
	uint inverse_root_low;
	uint inverse_root_high;
	uint one_low;
	uint one_high;
};
[[vk::push_constant]] PushConstants push;
[[vk::binding(0, 0)]] RWByteAddressBuffer storage_buffers[];
[kernel_name("ntt_twiddles")]
[domain("cryptography")]
[variant("generic")]
[dtype("u32")]
[status("experimental")]
[shader("compute")]
[numthreads(128, 1, 1)]
void main(uint3 tid : SV_DispatchThreadID) {
	uint index = tid.x + tid.y * push.grid_width;
	if (index >= push.count || (push.modulus_low & 1u) == 0u || push.modulus_high >= 0x40000000u) return;
	uint2 modulus = uint2(push.modulus_low, push.modulus_high);
	uint forward_extent, inverse_extent;
	storage_buffers[push.forward_index].GetDimensions(forward_extent);
	storage_buffers[push.inverse_index].GetDimensions(inverse_extent);
	if (push.count > forward_extent / 8u || push.count > inverse_extent / 8u) return;
	uint2 one = uint2(push.one_low, push.one_high);
	uint2 forward = prime62_power(uint2(push.root_low, push.root_high), index, modulus, push.negative_inverse, one);
	uint2 inverse = prime62_power(uint2(push.inverse_root_low, push.inverse_root_high), index, modulus, push.negative_inverse, one);
	storage_buffers[push.forward_index].Store<uint2>(index * 8u, forward);
	storage_buffers[push.inverse_index].Store<uint2>(index * 8u, inverse);
}