2
0

BN_mod_inverse.pod 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. =pod
  2. =head1 NAME
  3. BN_mod_inverse - compute inverse modulo n
  4. =head1 SYNOPSIS
  5. #include <openssl/bn.h>
  6. BIGNUM *BN_mod_inverse(BIGNUM *r, BIGNUM *a, const BIGNUM *n,
  7. BN_CTX *ctx);
  8. =head1 DESCRIPTION
  9. BN_mod_inverse() computes the inverse of B<a> modulo B<n>
  10. places the result in B<r> (C<(a*r)%n==1>). If B<r> is NULL,
  11. a new B<BIGNUM> is created.
  12. B<ctx> is a previously allocated B<BN_CTX> used for temporary
  13. variables. B<r> may be the same B<BIGNUM> as B<a>.
  14. =head1 NOTES
  15. It is an error to use the same B<BIGNUM> as B<n>.
  16. =head1 RETURN VALUES
  17. BN_mod_inverse() returns the B<BIGNUM> containing the inverse, and
  18. NULL on error. The error codes can be obtained by L<ERR_get_error(3)>.
  19. =head1 SEE ALSO
  20. L<ERR_get_error(3)>, L<BN_add(3)>
  21. =head1 COPYRIGHT
  22. Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
  23. Licensed under the Apache License 2.0 (the "License"). You may not use
  24. this file except in compliance with the License. You can obtain a copy
  25. in the file LICENSE in the source distribution or at
  26. L<https://www.openssl.org/source/license.html>.
  27. =cut