STRUCT SIG_ALG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct sig_alg(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual page for struct sig_alg(9) β€” it’s giving generic public key signature algorithm energy, and honestly? iconic. πŸ‘‘ This is the struct that lays out the function pointers for public key signature algorithms, and we’re gonna go through every single one, no skipping. periodt. πŸ’…


✨ NAME ✨

struct sig_alg β€” generic public key signature algorithm


🌈 SYNOPSIS 🌈

       struct sig_alg {
           int (*sign)(struct crypto_sig *tfm, const void *src, unsigned int
       slen, void *dst, unsigned int dlen);
           int (*verify)(struct crypto_sig *tfm, const void *src, unsigned int
       slen, const void *digest, unsigned int dlen);
           int (*set_pub_key)(struct crypto_sig *tfm, const void *key, unsigned
       int keylen);
           int (*set_priv_key)(struct crypto_sig *tfm, const void *key,
       unsigned int keylen);
           unsigned int (*key_size)(struct crypto_sig *tfm);
           unsigned int (*digest_size)(struct crypto_sig *tfm);
           unsigned int (*max_size)(struct crypto_sig *tfm);
           int (*init)(struct crypto_sig *tfm);
           void (*exit)(struct crypto_sig *tfm);
           struct crypto_alg base;
        };

🫢 Members 🫢

  • sign β€” this function performs a sign operation as defined by the public key algorithm. On success, the signature size is returned. Optional, bestie. ✨
  • verify β€” this function performs a complete verify operation as defined by the public key algorithm, returning verification status. Optional. πŸ¦‹
  • set_pub_key β€” this function invokes the algorithm specific set public key function, which knows how to decode and interpret the BER encoded public key and parameters. Mandatory β€” like, you literally need this one. πŸ’€
  • set_priv_key β€” this function invokes the algorithm specific set private key function, which knows how to decode and interpret the BER encoded private key and parameters. Optional. πŸ™ˆ
  • key_size β€” this function returns key size. Mandatory. πŸ”₯
  • digest_size β€” this function returns maximum digest size. Optional. πŸ“
  • max_size β€” this function returns maximum signature size. Optional. 🌸
  • init β€” initializes the cryptographic transformation object. This function is used to initialize the cryptographic transformation object. This function is called only once at the instantiation time, right after the transformation context was allocated. In case the cryptographic hardware has some special requirements which need to be handled by software, this function shall check for the precise requirement of the transformation and put any software fallbacks in place. 🧚
  • exit β€” deinitializes the cryptographic transformation object. This is a counterpart to init, used to remove various changes set in init. πŸŽ€
  • base β€” common crypto API algorithm data structure. 🫢

πŸ‘€ SEE ALSO πŸ‘€


That’s the whole vibe, bestie β€” source path ./include/crypto, date October 2026, page title struct sig_alg(9). byeee, go sign something cute! πŸ’œπŸŽ€

πŸ“¦ where this page comes from