// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
// schema=cryptography_bigint.json schema_version=1 generator_version=64
// schema_sha256=636171eea6d8620d516a7d64ef1143ab03485ef3095474ad2e2c60e9fe0fe9e6
// No OA C++ BigInt donor exists. Arithmetic helpers are independently tested.
// One invocation owns every output limb/status of a complete batch row.
// This public-data baseline has no secret-placement or constant-time contract.
import attributes;
import bigint_words;
import bigint_division;
import wide_u32;
struct PushConstants {
uint left_index;
uint output_index;
uint count;
uint words;
uint input_words;
uint output_words;
};
[[vk::push_constant]] PushConstants push;
[[vk::binding(0, 0)]] RWByteAddressBuffer storage_buffers[];
[kernel_name("from_u32")]
[domain("cryptography")]
[variant("generic")]
[dtype("u32")]
[status("experimental")]
[shader("compute")]
[numthreads(32, 1, 1)]
void main(uint3 tid : SV_DispatchThreadID) {
uint row = tid.x;
if (row >= push.count || push.input_words == 0u || push.input_words > 256u || push.input_words != 1u || push.words < 1u || push.words > 128u) return;
uint left_extent; storage_buffers[push.left_index].GetDimensions(left_extent);
if (push.count > left_extent / (push.input_words * 4u)) return;
uint output_extent; uint output_row_bytes = push.words * 4u;
storage_buffers[push.output_index].GetDimensions(output_extent);
if (push.count > output_extent / output_row_bytes) return;
for (uint i = 0u; i < push.words; ++i) {
uint value = i < push.input_words ? storage_buffers[push.left_index].Load(row * push.input_words * 4u + i * 4u) : 0u;
storage_buffers[push.output_index].Store(row * output_row_bytes + i * 4u, value);
}
}