BN_add_word.pod 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. =pod
  2. =head1 NAME
  3. BN_add_word, BN_sub_word, BN_mul_word, BN_div_word, BN_mod_word - arithmetic
  4. functions on BIGNUMs with integers
  5. =head1 SYNOPSIS
  6. #include <openssl/bn.h>
  7. int BN_add_word(BIGNUM *a, BN_ULONG w);
  8. int BN_sub_word(BIGNUM *a, BN_ULONG w);
  9. int BN_mul_word(BIGNUM *a, BN_ULONG w);
  10. BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
  11. BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
  12. =head1 DESCRIPTION
  13. These functions perform arithmetic operations on BIGNUMs with unsigned
  14. integers. They are much more efficient than the normal BIGNUM
  15. arithmetic operations.
  16. BN_add_word() adds B<w> to B<a> (C<a+=w>).
  17. BN_sub_word() subtracts B<w> from B<a> (C<a-=w>).
  18. BN_mul_word() multiplies B<a> and B<w> (C<a*=b>).
  19. BN_div_word() divides B<a> by B<w> (C<a/=w>) and returns the remainder.
  20. BN_mod_word() returns the remainder of B<a> divided by B<w> (C<a%m>).
  21. For BN_div_word() and BN_mod_word(), B<w> must not be 0.
  22. =head1 RETURN VALUES
  23. BN_add_word(), BN_sub_word() and BN_mul_word() return 1 for success, 0
  24. on error. The error codes can be obtained by L<ERR_get_error(3)|ERR_get_error(3)>.
  25. BN_mod_word() and BN_div_word() return B<a>%B<w>.
  26. =head1 SEE ALSO
  27. L<bn(3)|bn(3)>, L<err(3)|err(3)>, L<BN_add(3)|BN_add(3)>
  28. =head1 HISTORY
  29. BN_add_word() and BN_mod_word() are available in all versions of
  30. SSLeay and OpenSSL. BN_div_word() was added in SSLeay 0.8, and
  31. BN_sub_word() and BN_mul_word() in SSLeay 0.9.0.
  32. =cut