Manual Pages for UNIX Darwin command on man BN_RECP_CTX_free
MyWebUniversity

Manual Pages for UNIX Darwin command on man BN_RECP_CTX_free

BNmodmulreciprocal(3) OpenSSL BNmodmulreciprocal(3)

NAME

BNmodmulreciprocal, BNdivrecp, BNRECPCTXnew, BNRECPCTXinit,

BNRECPCTXfree, BNRECPCTXset - modular multiplication using

reciprocal

SYNOPSIS

#include

BNRECPCTX *BNRECPCTXnew(void); void BNRECPCTXinit(BNRECPCTX *recp); void BNRECPCTXfree(BNRECPCTX *recp); int BNRECPCTXset(BNRECPCTX *recp, const BIGNUM *m, BNCTX *ctx); int BNdivrecp(BIGNUM *dv, BIGNUM *rem, BIGNUM *a, BNRECPCTX *recp, BNCTX *ctx); int BNmodmulreciprocal(BIGNUM *r, BIGNUM *a, BIGNUM *b, BNRECPCTX *recp, BNCTX *ctx);

DESCRIPTION

BNmodmulreciprocal() can be used to perform an efficient BNmodmul(3) operation when the operation will be performed repeatedly

with the same modulus. It computes rr=(aa*bb)%mm using rreeccpp=1/mm, which is

set as described below. ccttxx is a previously allocated BBNNCCTTXX used for temporary variables. BNRECPCTXnew() allocates and initializes a BBNNRREECCPP structure. BNRECPCTXinit() initializes an existing uninitialized BBNNRREECCPP. BNRECPCTXfree() frees the components of the BBNNRREECCPP, and, if it was created by BNRECPCTXnew(), also the structure itself. BNRECPCTXset() stores mm in rreeccpp and sets it up for computing 1/mm and shifting it left by BNnumbits(mm)+1 to make it an integer. The result and the number of bits it was shifted left will later be stored in rreeccpp. BNdivrecp() divides aa by mm using rreeccpp. It places the quotient in ddvv and the remainder in rreemm. The BBNNRREECCPPCCTTXX structure is defined as follows: typedef struct bnrecpctxst { BIGNUM N; /* the divisor */ BIGNUM Nr; /* the reciprocal */ int numbits; int shift; int flags; } BNRECPCTX; It cannot be shared between threads.

RETURN VALUES

BNRECPCTXnew() returns the newly allocated BBNNRREECCPPCCTTXX, and NULL on error. BNRECPCTXinit() and BNRECPCTXfree() have no return values. For the other functions, 1 is returned for success, 0 on error. The error codes can be obtained by ERRgeterror(3).

SEE ALSO

bn(3), ERRgeterror(3), BNadd(3), BNCTXnew(3) HISTORY BBNNRREECCPPCCTTXX was added in SSLeay 0.9.0. Before that, the function BNreciprocal() was used instead, and the BNmodmulreciprocal() arguments were different.

0.9.7l 2002-09-25 BNmodmulreciprocal(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™