1.Dd $Mdocdate: July 5 2016 $ 2.Dt BN_ADD_WORD 3 3.Os 4.Sh NAME 5.Nm BN_add_word , 6.Nm BN_sub_word , 7.Nm BN_mul_word , 8.Nm BN_div_word , 9.Nm BN_mod_word 10.Nd arithmetic functions on BIGNUMs with integers 11.Sh SYNOPSIS 12.In openssl/bn.h 13.Ft int 14.Fo BN_add_word 15.Fa "BIGNUM *a" 16.Fa "BN_ULONG w" 17.Fc 18.Ft int 19.Fo BN_sub_word 20.Fa "BIGNUM *a" 21.Fa "BN_ULONG w" 22.Fc 23.Ft int 24.Fo BN_mul_word 25.Fa "BIGNUM *a" 26.Fa "BN_ULONG w" 27.Fc 28.Ft BN_ULONG 29.Fo BN_div_word 30.Fa "BIGNUM *a" 31.Fa "BN_ULONG w" 32.Fc 33.Ft BN_ULONG 34.Fo BN_mod_word 35.Fa "const BIGNUM *a" 36.Fa "BN_ULONG w" 37.Fc 38.Sh DESCRIPTION 39These functions perform arithmetic operations on BIGNUMs with unsigned 40integers. 41They are much more efficient than the normal BIGNUM arithmetic 42operations. 43.Pp 44.Fn BN_add_word 45adds 46.Fa w 47to 48.Fa a 49.Pq Li a+=w . 50.Pp 51.Fn BN_sub_word 52subtracts 53.Fa w 54from 55.Fa a 56.Pq Li a-=w . 57.Pp 58.Fn BN_mul_word 59multiplies 60.Fa a 61and 62.Fa w 63.Pq Li a*=w . 64.Pp 65.Fn BN_div_word 66divides 67.Fa a 68by 69.Fa w 70.Pq Li a/=w 71and returns the remainder. 72.Pp 73.Fn BN_mod_word 74returns the remainder of 75.Fa a 76divided by 77.Fa w 78.Pq Li a%w 79or (BN_ULONG)-1 on error. 80.Pp 81For 82.Fn BN_div_word 83and 84.Fn BN_mod_word , 85.Fa w 86must not be 0. 87.Sh RETURN VALUES 88.Fn BN_add_word , 89.Fn BN_sub_word , 90and 91.Fn BN_mul_word 92return 1 for success, 0 on error. 93The error codes can be obtained by 94.Xr ERR_get_error 3 . 95.Pp 96.Fn BN_mod_word 97and 98.Fn BN_div_word 99return 100.Fa a Ns % Ns Fa w 101on success and 102.Pq Vt BN_ULONG Ns -1 103if an error occurred. 104.Sh SEE ALSO 105.Xr bn 3 , 106.Xr BN_add 3 , 107.Xr ERR_get_error 3 108.Sh HISTORY 109.Fn BN_add_word 110and 111.Fn BN_mod_word 112are available in all versions of SSLeay and OpenSSL. 113.Fn BN_div_word 114was added in SSLeay 0.8, and 115.Fn BN_sub_word 116and 117.Fn BN_mul_word 118in SSLeay 0.9.0. 119.Pp 120Before 0.9.8a, the return value for 121.Fn BN_div_word 122and 123.Fn BN_mod_word 124in case of an error was 0. 125