oa::cryptography::pqc
Module published by the oa::cryptography module.
MdRust public API
Public Types
Public Functions
pub fn verify_batch( messages: &Matrix, msg_offsets: &Matrix, msg_lengths: &Matrix, signatures: &Matrix, public_keys: &Matrix, ) -> Result<Matrix>pub fn verify_batch_with_context( parameters: MlDsaParameters, messages: &Matrix, msg_offsets: &Matrix, msg_lengths: &Matrix, signatures: &Matrix, public_keys: &Matrix, context: Range<usize>, ) -> Result<Matrix>Public Constants & Variables
Function Documentation
Generate a random ML-DSA-65 key pair using the operating-system RNG.
Sign an arbitrary message with ML-DSA-65.
Sign a canonical OA hash with ML-DSA-65.
Verify an ML-DSA-65 message signature. Malformed encodings fail closed.
Verify ML-DSA-65 signatures on the originating Vulkan device, empty context. Each workgroup processes one (message, signature, public_key) triple. Results are device-resident U32 [batch_size]: 1 = valid, 0 = invalid or malformed. Every invalid path in the shader writes 0; no short-circuit path converts an invalid signature to valid. Arguments messages — U8 rank-1 [total_message_bytes] flat byte buffer. msg_offsets — U32 rank-1 [batch_size] byte start of each message. msg_lengths — U32 rank-1 [batch_size] byte length of each message. signatures — U8 rank-1 [batch_size × 3309] packed signatures in FIPS 204 6.4 wire format. public_keys — U8 rank-1 [batch_size × 1952] packed public keys in FIPS 204 6.2 wire format. Errors Returns an error for mismatched shapes, dtypes, engines, address limits, or an unavailable Vulkan pipeline. Out-of-range message offsets and lengths produce 0 for that row without host readback of the offset/length vectors. Status Experimental. Named software Vulkan execution is a correctness checkpoint; physical-device, performance and side-channel qualification remain separate.
Verify a selected ML-DSA batch with one shared FIPS 204 context. context is a byte range within messages, of length at most 255. Message offsets still identify each row independently; the context is a zero-copy view and is framed as 0x00 || len(context) || context || message. The context may overlap a message. Use separate batches for different contexts. All other inputs and results follow verify_batch_with_parameters. Capture retains the message value and records the context range as semantic attributes. Rebinding that input also rebinds its context bytes. This is pure ML-DSA verification, not the distinct HashML-DSA prehash interface. Errors Rejects reversed, out-of-bounds, or longer-than-255-byte context ranges, including for empty batches, plus the errors of verify_batch. This Experimental public-data route does not admit private-key execution.
Verify a batch using the selected FIPS 204 parameter set, empty context. Inputs and results follow verify_batch. Packed key and signature strides are MlDsaParameters::public_key_size and MlDsaParameters::signature_size; selecting a different parameter set never truncates, pads, or converts the encodings. Errors Rejects mismatched shapes, dtypes, engines, address limits, or unavailable Vulkan pipelines. Malformed encodings and out-of-range message rows return zero on the device. This Experimental public-data operation does not admit private-key execution or claim physical-device qualification.
Verify an ML-DSA-65 signature over a canonical OA hash.