BN_ADD_WORD(3SSL)
๐ BN_ADD_WORD ๐
okay so bestie, this is the BN_ADD_WORD(3SSL)</p> page from the OpenSSL manual, and it's literally the glow-up of BIGNUM math. instead of doing whole big-number arithmetic like a peasant, you just do math with plain old integers. so efficient. so slay. โจ
๐ธ NAME ๐ธ
BN_add_word, BN_sub_word, BN_mul_word, BN_div_word, BN_mod_word โ arithmetic functions on BIGNUMs with integers ๐งฎ๐
โจ SYNOPSIS โจ
#include <openssl/bn.h>
int BN_add_word(BIGNUM *a, BN_ULONG w);
int BN_sub_word(BIGNUM *a, BN_ULONG w);
int BN_mul_word(BIGNUM *a, BN_ULONG w);
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
๐ฆ DESCRIPTION ๐ฆ
so these functions do arithmetic on BIGNUMs with unsigned integers. and the way that they're so much more efficient than the normal BIGNUM arithmetic operations?? iconic. no cap. ๐
BN_add_word()โ adds w to a ("a+=w") โBN_sub_word()โ subtracts w from a ("a-=w") โBN_mul_word()โ multiplies a and w ("a*=w") โ๏ธBN_div_word()โ divides a by w ("a/=w") and returns the remainder โBN_mod_word()โ returns the remainder of a divided by w ("a%w") ๐
๐ GIRL. LISTEN. ForBN_div_word()andBN_mod_word(), w must not be 0. zero. not a vibe. do not.
๐ RETURN VALUES ๐
BN_add_word(),BN_sub_word()andBN_mul_word()return1for success,0on error. and if you're like "okay but which error ๐ฅบ", you can go get the error codes withERR_get_error(3). periodt.BN_mod_word()andBN_div_word()returna%won success and(BN_ULONG)-1if an error occurred. yeah bestie, that's the screaming number ๐ญ
๐ SEE ALSO ๐
๐ COPYRIGHT ๐
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. ๐ซถ
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>. ๐
and that's the whole page bestie, no crumbs left ๐ this was OpenSSL version 4.0.3, dated 2026-09-29, filed under BN_ADD_WORD(3SSL). go forth and do tiny integer math on your giant numbers, you absolute main character. mwah ๐งโจ
๐ฆ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms