SophiaFramework UNIVERSE 5.3 |
BREW 2.0 | BREW 2.1 | BREW 3.1 | BREW 4.0 |
---|---|---|---|
X | X | X | O |
Public Functions | |
---|---|
SFCError |
Add(
SFBBNConstRef param
) Add given BN to self.
|
SFCError |
Cmp(
SFBBNConstRef param
) Compares "me" with Arg and returns the result
|
SFCError |
Copy(
SFBBNRef param
) Copy sets the current BN contents to that of the cpiArg.
|
SFCError |
Div(
SFBBNConstRef divisor
, SFBBNRef quotient
) Divide self with the divisor in resulting quotient. The "me" is set to the remainder.
|
SFCError |
Get(
VoidPtr buf
, SInt32Ptr size
) Copies the contents of the BN to the provided buffer.
|
SFCError |
Get(
SFXBufferPtr buf
) Copies the contents of the BN to the provided buffer.
|
Void |
ModExp(
SFBBNConstRef exp
, SFBBNConstRef modulus
, SInt32Ptr result
, SFXCallbackPtr callback
) Computes the modular exponentiation of the BN and updates itself with the result.
|
SFCError |
ModMul(
SFBBNConstRef multiplier
, SFBBNConstRef modulus
) Computes the modular multiplication of the BN and updates itself with the result.
|
SFCError |
Mul(
SFBBNConstRef param
) Multiply argument with self.
|
SFCError |
New(
VoidConstPtr buf
, SInt32 len
, SFBBNSmpPtr pOut
) Factory method to construct a new SFBBN instead of calling CreateInstance.
|
SFCError |
New(
SFXBufferConstRef buf
, SFBBNSmpPtr pOut
) Factory method to construct a new SFBBN instead of calling CreateInstance.
|
static SFBBNSmp |
NewInstance(
SFCErrorPtr exception = null
) Create a new SFBBN instance.
|
static SFBBNSmp |
NewInstance(
AEECLSID id
, SFCErrorPtr exception = null
) Create a new SFBBN instance.
|
SFCError |
Set(
VoidConstPtr buf
, SInt32 len
) Resets the contents of the BN to the newly provided buffer. If length is zero, the BN is set to zero.
|
SFCError |
Set(
SFXBufferConstRef buf
) Resets the contents of the BN to the newly provided buffer. If length is zero, the BN is set to zero.
|
SFCError |
Sub(
SFBBNConstRef param
) Subtract the argument from self. Only works if Arg is less than or equal to "me" value.
|
SFCError |
QueryInterface(
AEECLSID clsid
, VoidHandle handle
)
(inherits from SFBQuery)
Ask an object for another API contract from the object in question.
|
SFCError |
QueryInterface(
AEECLSID clsid
, SFBBaseSmpPtr handle
)
(inherits from SFBQuery)
Ask an object for another API contract from the object in question.
|
SFBBaseSmp |
QueryInterface(
AEECLSID clsid
)
(inherits from SFBQuery)
Ask an object for another API contract from the object in question.
|
Void |
Self(
AEECLSID clsidReq
, SFBQuerySmpPtr clone
, AEECLSID clsidImp
)
(inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
|
SFBQuerySmp |
Self(
AEECLSID clsidReq
, AEECLSID clsidImp
)
(inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
|
Protected Functions | |
---|---|
static SFBBaseSmp |
FactoryByCreate(
AEECLSID id
, SFCErrorPtr exception = null
)
(inherits from SFBBase)
Create the instance for the specified ClassID's interface.
|
static SFBBaseSmp |
FactoryByQuery(
SFBQuerySmpConstRef query
, AEECLSID id
, SFCErrorPtr exception = null
)
(inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.
|
[ public ] SFCError Add( SFBBNConstRef param // BN to add );
AEE_ENOMEMORY: on lack of memory
[ public ] SFCError Cmp( SFBBNConstRef param // BN to compare with );
AEE_ENOMEMORY: On lack of memory.
[ public ] SFCError Div( SFBBNConstRef divisor // Divisor BN SFBBNRef quotient // Quotient BN; Can be NULL if not interested in the quotient );
AEE_ENOMEMORY: on lack of memory
Side Effects: On failure, the value of "me" is undefined. If "me" is needed, make a copy before calling.
[ public ] SFCError Get( VoidPtr buf // Byte array into which the BN value is copied. SInt32Ptr size // the size of buf );
[ public ] SFCError Get( SFXBufferPtr buf // Byte array into which the BN value is copied. );
Byte array into which the BN value is copied.
On input, set to the size of pubBuf. On output, it is set to the length of the copied buffer. On not enough space, it is set to the buffer size needed.
AEE_EFAILED: If target buffer does not have enough space
Updates the pnSize with the real copies buffer size. On insufficient space, contains the maximum buffer size needed for the operation to succeed. The caller must always provide the pnSize pointer.
[ public ] Void ModExp( SFBBNConstRef exp // Exponent BN SFBBNConstRef modulus // Modulus IBN SInt32Ptr result // contains the result of the operation when done SFXCallbackPtr callback // Callback to be called on completion );
なし.
Modulus must be odd (which is the case for most security related moduli). If the callback is null, the function is executed synchronously. The result is always provided in the pdwResult pointer.
This function SHOULD be used asynchronously because it can take a lot of time to complete depending on key size and if it is used synchronously then the application that uses this can get stuck for a while before it can respond.
[ public ] SFCError ModMul( SFBBNConstRef multiplier // The multiplier BN SFBBNConstRef modulus // Modulus BN );
Use this interface only if the same modulus is used repeatedly with SFBBN::ModMul and SFBBN::ModExp. It is slower than the method described below, due to some precomputation. If this needs to be called only once, construct this call by calling SFBBN::Mul and then calling SFBBN::Mod
[ public ] SFCError Mul( SFBBNConstRef param // BN to multiply with );
AEE_ENOMEMORY: on lack of memory
[ public ] SFCError New( VoidConstPtr buf // Holds the big number in an array, with 0th byte containing the LSB SInt32 len // Length of buf SFBBNSmpPtr pOut // Pointer to newly created SFBBN object );
[ public ] SFCError New( SFXBufferConstRef buf // Holds the big number in an array, with 0th byte containing the LSB SFBBNSmpPtr pOut // Pointer to newly created SFBBN object );
Provides a convenient way to create a BN and set its contents in one step, instead of calling CreateInstance and doing a SFBBN::Set call. On return, piOut contains the new BN or NULL in case of failure due to lack of memory. Note that the resulting IBN always uses the same implementation as the IBN that is used as input.
[ public, static ] SFBBNSmp NewInstance( SFCErrorPtr exception = null // Error );
[ public, static ] SFBBNSmp NewInstance( AEECLSID id // Class ID SFCErrorPtr exception = null // Error );
[ public ] SFCError Set( VoidConstPtr buf // Holds the big number in an array, with 0th byte having LSB SInt32 len // Length of buf );
[ public ] SFCError Set( SFXBufferConstRef buf // Holds the big number in an array, with 0th byte having LSB );
AEE_ENOMEMORY: On lack of memory
[ public ] SFCError Sub( SFBBNConstRef param // BN to subtract );
AEE_EBADPARM: if arg is greater than "me"
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |