BN_zero.pod 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. unsigned BN_ULONG BN_get_word(BIGNUM *a);
  12. =head1 DESCRIPTION
  13. B<BN_ULONG> is a macro that will be an unsigned integral type optimized
  14. for the most efficient implementation on the local platform.
  15. BN_zero(), BN_one() and BN_set_word() set B<a> to the values 0, 1 and
  16. B<w> respectively. BN_zero() and BN_one() are macros.
  17. BN_value_one() returns a B<BIGNUM> constant of value 1. This constant
  18. is useful for use in comparisons and assignment.
  19. BN_get_word() returns B<a>, if it can be represented as a B<BN_ULONG>.
  20. =head1 RETURN VALUES
  21. BN_get_word() returns the value B<a>, or all-bits-set if B<a> cannot
  22. be represented as a single integer.
  23. BN_one() and BN_set_word() return 1 on success, 0 otherwise.
  24. BN_value_one() returns the constant.
  25. BN_zero() never fails and returns no value.
  26. =head1 BUGS
  27. If a B<BIGNUM> is equal to the value of all-bits-set, it will collide
  28. with the error condition returned by BN_get_word() which uses that
  29. as an error value.
  30. B<BN_ULONG> should probably be a typedef.
  31. =head1 SEE ALSO
  32. L<BN_bn2bin(3)>
  33. =head1 HISTORY
  34. In OpenSSL 0.9.8, BN_zero() was changed to not return a value; previous
  35. versions returned an int.
  36. =head1 COPYRIGHT
  37. Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
  38. Licensed under the Apache License 2.0 (the "License"). You may not use
  39. this file except in compliance with the License. You can obtain a copy
  40. in the file LICENSE in the source distribution or at
  41. L<https://www.openssl.org/source/license.html>.
  42. =cut