bign96.h(3)
okay bestie, you opened bign96.h(3) from the Library Functions Manual 💖
✨ NAME ✨
bign96.h — Подпись Bign уровня 96 / Bign signature at level 96 💅
🦋 SYNOPSIS 🦋
#include 'bee2/crypto/bign.h'
🎀 Функции 🎀
err_t bign96ParamsStd (bign_params *params, const char *name)
err_t bign96ParamsVal (const bign_params *params)
err_t bign96KeypairGen (octet privkey[24], octet pubkey[48], const
bign_params *params, gen_i rng, void *rng_state)
err_t bign96KeypairVal (const bign_params *params, const octet
privkey[24], const octet pubkey[48])
err_t bign96PubkeyVal (const bign_params *params, const octet
pubkey[48])
err_t bign96PubkeyCalc (octet pubkey[48], const bign_params *params,
const octet privkey[24])
err_t bign96Sign (octet sig[34], const bign_params *params, const octet
oid_der[], size_t oid_len, const octet hash[24], const octet
privkey[24], gen_i rng, void *rng_state)
err_t bign96Sign2 (octet sig[34], const bign_params *params, const octet
oid_der[], size_t oid_len, const octet hash[24], const octet
privkey[24], const void *t, size_t t_len)
err_t bign96Verify (const bign_params *params, const octet oid_der[],
size_t oid_len, const octet hash[24], const octet sig[34], const
octet pubkey[48])
bign96ParamsStd— loads the standard long-term parameters ✨bign96ParamsVal— validates the long-term parameters 💖bign96KeypairGen— generates a key pair 🔥bign96KeypairVal— validates a key pair 💅bign96PubkeyVal— validates a public key 🦋bign96PubkeyCalc— builds the public key from the private key 🌸bign96Sign— produces a digital signature (ЭЦП) 👑bign96Sign2— deterministic digital signature generation 💀bign96Verify— verifies a digital signature ⭐
💅 ПОДРОБНОЕ ОПИСАНИЕ 💅
okay so Bign96 is literally the Bign signature when the security level is lowered to l = 96, and it comes with these corrections, bestie:
- the length of
s0, the first part of the signature, is reduced from 96 bits to 80 bits — shorter signature energy, periodt. - in the deterministic signature generation mode (the
bign96Sign2function, iykyk), for constructing the one-time private key, instead of thebelt-wblockalgorithm, thebelt-32blockalgorithm is used (encryption of one and a half blocks). The latter algorithm is defined in СТБ 34.101.31-2020 as auxiliary for thebelt-fmtalgorithm.
The conventions and interfaces of the bee2/crypto/bign module are repeated.
Expected [ERR_BAD_INPUT] — all input pointers are correct.
✨ Функции ✨
okay bestie, this is the part where we meet the actual functions 💖 eight of them, all returning err_t, all doing their lil cryptographic thing. let's go 🦋
err_t bign96KeypairGen (octet privkey[24], octet pubkey[48], const bign_params * params, gen_i rng, void * rng_state)
so like, given the long-term params params, we generate a private key privkey and a public key pubkey. and for the generation we use the RNG rng and its state rng_state ✨
Ожидается (aka what you gotta make sure is true, or it's a whole thing):
[ERR_BAD_PARAMS]— the paramsparamsare valid 💅[ERR_BAD_RNG]— the RNGrng(with its staterng_state) is valid- (no code, just vibes) — the RNG
rngyou're passing is a cryptographically strong one 🔥 like actually, don't skimp here
Возвращает: ERR_OK if the keys generated successfully, otherwise the error code 😭
Аргументы:
privkey— the private keypubkey— the public keyparams— the long-term paramsrng— the random number generatorrng_state—[in/out]the state of the generator
err_t bign96KeypairVal (const bign_params * params, const octet privkey[24], const octet pubkey[48])
vibe check time 🎀 given the long-term params params, this checks that the private key privkey is valid and that the public key pubkey actually matches it. like, are they a matching set or is one of them lying 😭
Ожидается:
[ERR_BAD_PARAMS]— the paramsparamsare valid
Возвращает: ERR_OK if the pair is valid, otherwise the error code 💜
Аргументы:
params— the long-term paramsprivkey— the private keypubkey— the public key
err_t bign96ParamsStd (bign_params * params, const char * name)
loads the standard long-term params with the name name into params. and bestie, there's literally only ONE name supported: "1.2.112.0.2.0.34.101.45.3.0" 👑 no cap, that's the only one, don't come at me with other strings.
Возвращает: ERR_OK if the params loaded successfully, otherwise the error code ✨
Аргументы:
params— the standard paramsname— the name of the params
err_t bign96ParamsVal (const bign_params * params)
checks whether the long-term params params are valid. that's it, that's the whole job 🧚
Возвращает: ERR_OK if the params are valid, otherwise the error code 🌸
Аргументы:
params— the long-term params
err_t bign96PubkeyCalc (octet pubkey[48], const bign_params * params, const octet privkey[24])
okay so given the long-term params params, this builds the public key pubkey from the private key privkey. like a little key glow-up ✨ private key in, public key out 💅
Ожидается:
[ERR_BAD_PARAMS]— the paramsparamsare valid[ERR_BAD_PRIVKEY]— the private keyprivkeyis valid
Возвращает: ERR_OK if the public key was built successfully, otherwise the error code 💖
Аргументы:
pubkey— the public keyparams— the long-term paramsprivkey— the private key
err_t bign96PubkeyVal (const bign_params * params, const octet pubkey[48])
given the long-term params params, checks whether the public key pubkey is valid. is this key giving what it's supposed to give or nah 🔍
Ожидается:
[ERR_BAD_PARAMS]— the paramsparamsare valid
Возвращает: ERR_OK if the key is valid, otherwise the error code 🌈
Аргументы:
params— the long-term paramspubkey— the key being checked
err_t bign96Sign (octet sig[34], const bign_params * params, const octet oid_der[], size_t oid_len, const octet hash[24], const octet privkey[24], gen_i rng, void * rng_state)
bestie this one produces the signature sig for a message whose hash value is hash, where that hash was made using the algorithm with identifier [oid_len]oid_der, given as a DER encoding. the signature is produced on the private key privkey. and to produce this digital signature (ЭЦП) we use the long-term params params plus the RNG rng with its state rng_state 🔥
Ожидается:
[ERR_BAD_PARAMS]— the paramsparamsare valid[ERR_BAD_OID]— the identifieroid_deris valid[ERR_BAD_INPUT]— the bufferssigandhashdon't overlap 🚨 (like they must NOT intersect, fr fr)[ERR_BAD_PRIVKEY]— the private keyprivkeyis valid[ERR_BAD_RNG]— the RNGrng(with its staterng_state) is valid- (no code) — the RNG
rngis cryptographically strong
Возвращает: ERR_OK if the signature was produced, otherwise the error code 😭
Аргументы:
sig— the signatureparams— the long-term paramsoid_der— the hash algorithm identifieroid_len— the length ofoid_derin octetshash— the hash valueprivkey— the private keyrng— the random number generatorrng_state—[in/out]the state of the generator
err_t bign96Sign2 (octet sig[34], const bign_params * params, const octet oid_der[], size_t oid_len, const octet hash[24], const octet privkey[24], const void * t, size_t t_len)
the sequel 🎬 same deal as above: produces the signature sig for a message with hash value hash, made with the algorithm whose identifier is [oid_len]oid_der as a DER encoding, on the private key privkey, using the long-term params params. BUT — and here's the plot twist — the one-time private key is generated using the extra data [t_len]t. and if t == 0, then no extra data is used at all 🫶
Ожидается:
[ERR_BAD_PARAMS]— the paramsparamsare valid[ERR_BAD_OID]— the identifieroid_deris valid[ERR_BAD_INPUT]— the bufferssigandhashdon't overlap[ERR_BAD_PRIVKEY]— the private keyprivkeyis valid
Возвращает: ERR_OK if the signature was produced, otherwise the error code ✨
Аргументы:
sig— the signatureparams— the long-term paramsoid_der— the hash algorithm identifieroid_len— the length ofoid_derin octetshash— the hash valueprivkey— the private keyt— the extra datat_len— the size of the extra data
err_t bign96Verify (const bign_params * params, const octet oid_der[], size_t oid_len, const octet hash[24], const octet sig[34], const octet pubkey[48])
the moment of truth 💅 this verifies the digital signature (ЭЦП) sig for a message with hash value hash. the verification uses the long-term params params and the public key pubkey. and it's assumed that the hash value hash was made using the algorithm with identifier [oid_len]oid_der, given as a DER encoding 🔍
Ожидается:
[ERR_BAD_PARAMS]— the paramsparamsare valid[ERR_BAD_OID]— the identifieroid_deris valid[ERR_BAD_PUBKEY]— the public keypubkeyis valid
Возвращает: ERR_OK if the signature is valid, otherwise the error code 🎀
Прим. (note bestie 📌) — if the restrictions on the digital signature (ЭЦП) are violated, the code ERR_BAD_SIG is returned.
Аргументы:
params— the long-term paramsoid_der— the hash algorithm identifieroid_len— the length ofoid_derin octetshash— the hash valuesig— the signaturepubkey— the public key
✨ Автор ✨
automatically generated by Doxygen for the Bee2 library, straight from the source text 🦋 (not me being a bot-generated manpage, it's giving iconic honestly 👑)
and that's a wrap on bign96.h(3) bestie 💖 this lil page lives in the Bee2 library, dated Вс 25 Янв 2026 00:00:00 (that's Sunday, January 25, 2026, midnight — very main character of it). go forth and sign responsibly, no cap 🌸🫶
📦 where this page comes from
- fedora 44: bee2-devel 2.2.0-1.fc44 · GPL-3.0-only and GPL-3.0-or-later
- fedora 44: bee2-devel 2.2.0-1.fc44 · GPL-3.0-only and GPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms