BN_zero.pod 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word - BIGNUM assignment
  4. operations
  5. =head1 SYNOPSIS
  6. #include <openssl/bn.h>
  7. void BN_zero(BIGNUM *a);
  8. int BN_one(BIGNUM *a);
  9. const BIGNUM *BN_value_one(void);
  10. int BN_set_word(BIGNUM *a, BN_ULONG w);
  11. BN_ULONG BN_get_word(BIGNUM *a);
  12. Deprecated:
  13. #if OPENSSL_API_COMPAT < 0x00908000L
  14. int BN_zero(BIGNUM *a);
  15. #endif
  16. =head1 DESCRIPTION
  17. B<BN_ULONG> is a macro that will be an unsigned integral type optimied
  18. for the most efficient implementation on the local platform.
  19. BN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and
  20. B<w> respectively. BN_zero() and BN_one() are macros.
  21. BN_value_one() returns a B<BIGNUM> constant of value 1. This constant
  22. is useful for use in comparisons and assignment.
  23. BN_get_word() returns B<a>, if it can be represented as a B<BN_ULONG>.
  24. =head1 RETURN VALUES
  25. BN_get_word() returns the value B<a>, or all-bits-set if B<a> cannot
  26. be represented as a B<BN_ULONG>.
  27. BN_one(), BN_set_word() and the deprecated version of BN_zero()
  28. return 1 on success, 0 otherwise.
  29. BN_value_one() returns the constant.
  30. The preferred version of BN_zero() never fails and returns no value.
  31. =head1 BUGS
  32. If a B<BIGNUM> is equal to the value of all-bits-set, it will collide
  33. with the error condition returned by BN_get_word() which uses that
  34. as an error value.
  35. B<BN_ULONG> should probably be a typedef.
  36. =head1 SEE ALSO
  37. L<BN_bn2bin(3)>
  38. =head1 COPYRIGHT
  39. Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
  40. Licensed under the OpenSSL license (the "License"). You may not use
  41. this file except in compliance with the License. You can obtain a copy
  42. in the file LICENSE in the source distribution or at
  43. L<https://www.openssl.org/source/license.html>.
  44. =cut