oqs_sys::sig

Struct OQS_SIG

source
#[repr(C)]
pub struct OQS_SIG {
Show 13 fields pub method_name: *const c_char, pub alg_version: *const c_char, pub claimed_nist_level: u8, pub euf_cma: bool, pub sig_with_ctx_support: bool, pub length_public_key: usize, pub length_secret_key: usize, pub length_signature: usize, pub keypair: Option<unsafe extern "C" fn(public_key: *mut u8, secret_key: *mut u8) -> OQS_STATUS>, pub sign: Option<unsafe extern "C" fn(signature: *mut u8, signature_len: *mut usize, message: *const u8, message_len: usize, secret_key: *const u8) -> OQS_STATUS>, pub sign_with_ctx_str: Option<unsafe extern "C" fn(signature: *mut u8, signature_len: *mut usize, message: *const u8, message_len: usize, ctx_str: *const u8, ctx_str_len: usize, secret_key: *const u8) -> OQS_STATUS>, pub verify: Option<unsafe extern "C" fn(message: *const u8, message_len: usize, signature: *const u8, signature_len: usize, public_key: *const u8) -> OQS_STATUS>, pub verify_with_ctx_str: Option<unsafe extern "C" fn(message: *const u8, message_len: usize, signature: *const u8, signature_len: usize, ctx_str: *const u8, ctx_str_len: usize, public_key: *const u8) -> OQS_STATUS>,
}
Expand description

Signature schemes object

Fields§

§method_name: *const c_char

Printable string representing the name of the signature scheme.

§alg_version: *const c_char

Printable string representing the version of the cryptographic algorithm.

Implementations with the same method_name and same alg_version will be interoperable. See README.md for information about algorithm compatibility.

§claimed_nist_level: u8

The NIST security level (1, 2, 3, 4, 5) claimed in this algorithm’s original NIST submission.

§euf_cma: bool

Whether the signature offers EUF-CMA security (TRUE) or not (FALSE).

§sig_with_ctx_support: bool

Whether the signature supports signing with a context string (TRUE) or not (FALSE).

§length_public_key: usize

The length, in bytes, of public keys for this signature scheme.

§length_secret_key: usize

The length, in bytes, of secret keys for this signature scheme.

§length_signature: usize

The (maximum) length, in bytes, of signatures for this signature scheme.

§keypair: Option<unsafe extern "C" fn(public_key: *mut u8, secret_key: *mut u8) -> OQS_STATUS>

Keypair generation algorithm.

Caller is responsible for allocating sufficient memory for public_key and secret_key, based on the length_* members in this object or the per-scheme compile-time macros OQS_SIG_*_length_*.

@param[out] public_key The public key represented as a byte string. @param[out] secret_key The secret key represented as a byte string. @return OQS_SUCCESS or OQS_ERROR

§sign: Option<unsafe extern "C" fn(signature: *mut u8, signature_len: *mut usize, message: *const u8, message_len: usize, secret_key: *const u8) -> OQS_STATUS>

Signature generation algorithm.

Caller is responsible for allocating sufficient memory for signature, based on the length_* members in this object or the per-scheme compile-time macros OQS_SIG_*_length_*.

@param[out] signature The signature on the message represented as a byte string. @param[out] signature_len The actual length of the signature. May be smaller than length_signature for some algorithms since some algorithms have variable length signatures. @param[in] message The message to sign represented as a byte string. @param[in] message_len The length of the message to sign. @param[in] secret_key The secret key represented as a byte string. @return OQS_SUCCESS or OQS_ERROR

§sign_with_ctx_str: Option<unsafe extern "C" fn(signature: *mut u8, signature_len: *mut usize, message: *const u8, message_len: usize, ctx_str: *const u8, ctx_str_len: usize, secret_key: *const u8) -> OQS_STATUS>

Signature generation algorithm, with custom context string.

Caller is responsible for allocating sufficient memory for signature, based on the length_* members in this object or the per-scheme compile-time macros OQS_SIG_*_length_*.

@param[out] signature The signature on the message represented as a byte string. @param[out] signature_len The actual length of the signature. May be smaller than length_signature for some algorithms since some algorithms have variable length signatures. @param[in] message The message to sign represented as a byte string. @param[in] message_len The length of the message to sign. @param[in] ctx_str The context string used for the signature. This value can be set to NULL if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used). @param[in] ctx_str_len The context string used for the signature. This value can be set to 0 if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used). @param[in] secret_key The secret key represented as a byte string. @return OQS_SUCCESS or OQS_ERROR

§verify: Option<unsafe extern "C" fn(message: *const u8, message_len: usize, signature: *const u8, signature_len: usize, public_key: *const u8) -> OQS_STATUS>

Signature verification algorithm.

@param[in] message The message represented as a byte string. @param[in] message_len The length of the message. @param[in] signature The signature on the message represented as a byte string. @param[in] signature_len The length of the signature. @param[in] public_key The public key represented as a byte string. @return OQS_SUCCESS or OQS_ERROR

§verify_with_ctx_str: Option<unsafe extern "C" fn(message: *const u8, message_len: usize, signature: *const u8, signature_len: usize, ctx_str: *const u8, ctx_str_len: usize, public_key: *const u8) -> OQS_STATUS>

Signature verification algorithm, with custom context string.

@param[in] message The message represented as a byte string. @param[in] message_len The length of the message. @param[in] signature The signature on the message represented as a byte string. @param[in] signature_len The length of the signature. @param[in] ctx_str The context string for the signature. This value can be set to NULL if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used). @param[in] ctx_str_len The length of the context string. This value can be set to 0 if a context string is not needed (i.e., for algorithms that do not support context strings or if an empty context string is used). @param[in] public_key The public key represented as a byte string. @return OQS_SUCCESS or OQS_ERROR

Trait Implementations§

source§

impl Clone for OQS_SIG

source§

fn clone(&self) -> OQS_SIG

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for OQS_SIG

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for OQS_SIG

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.