Skip to content

stdlib/crypto_bindView source ↗

crypto_bind

40 items · generated by scribe fromstdlib/crypto_bind.fd· synced 2026-11-15

stdlib/crypto_bind40 items

Contents

cb_gcm_encrypt

AES-GCM encrypt: returns ciphertext || 16-byte tag, empty Vec on failure. key is 16 or 32 bytes; nonce 12 bytes recommended; aad may be empty.

pub fn cb_gcm_encrypt(key: & Vec, nonce: & Vec, aad: & Vec, pt: & Vec) -> Vec<i64> {

Parameters:

  • key: & Vec
  • nonce: & Vec
  • aad: & Vec
  • pt: & Vec

Returns: Vec<i64>

Defined at line 240


cb_gcm_decrypt

AES-GCM decrypt: input is ciphertext || 16-byte tag; empty Vec on failure (tag mismatch included).

pub fn cb_gcm_decrypt(key: & Vec, nonce: & Vec, aad: & Vec, ct_tag: & Vec) -> Vec<i64> {

Parameters:

  • key: & Vec
  • nonce: & Vec
  • aad: & Vec
  • ct_tag: & Vec

Returns: Vec<i64>

Defined at line 287


cb_pbkdf2_derive

PBKDF2-HMAC-SHA256: derives out_len bytes; empty Vec on failure.

pub fn cb_pbkdf2_derive(password: & Vec, salt: & Vec, iters: i64, out_len: i64) -> Vec<i64> {

Parameters:

  • password: & Vec
  • salt: & Vec
  • iters: i64
  • out_len: i64

Returns: Vec<i64>

Defined at line 331


cb_ecdsa_generate

Generate a P-256 key pair into priv_blob/pub_blob. 0 on success.

pub fn cb_ecdsa_generate(priv_blob: & mut Vec, pub_blob: & mut Vec) -> i64 {

Parameters:

  • priv_blob: & mut Vec
  • pub_blob: & mut Vec

Returns: i64

Defined at line 398


cb_ecdsa_sign

Sign a 32-byte hash with the private blob: 64-byte r||s, empty on error.

pub fn cb_ecdsa_sign(priv_blob: & Vec, hash: & Vec) -> Vec<i64> {

Parameters:

  • priv_blob: & Vec
  • hash: & Vec

Returns: Vec<i64>

Defined at line 456


cb_ecdsa_verify

Verify a 64-byte r||s signature over a 32-byte hash with the public blob.

pub fn cb_ecdsa_verify(pub_blob: & Vec, hash: & Vec, sig: & Vec) -> bool {

Parameters:

  • pub_blob: & Vec
  • hash: & Vec
  • sig: & Vec

Returns: bool

Defined at line 480


Generated by scribe, the Fides documentation generator