00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef _RTXBIGINT_H_
00029 #define _RTXBIGINT_H_
00030
00031 #include "rtxsrc/rtxContext.h"
00032
00033
00034
00035 typedef struct OSBigInt {
00036 OSSIZE numocts;
00037 OSOCTET *mag;
00038 int sign;
00039 OSSIZE allocated;
00040 OSBOOL dynamic;
00041 } OSBigInt;
00042
00043
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00048
00049
00056 EXTERNRT void rtxBigIntInit (OSBigInt* pInt);
00057
00067 EXTERNRT int rtxBigIntSetStr
00068 (OSCTXT* pctxt, OSBigInt* pInt, const char* value, int radix);
00069
00081 EXTERNRT int rtxBigIntSetStrn
00082 (OSCTXT* pctxt, OSBigInt* pInt, const char* value, OSSIZE len, int radix);
00083
00093 EXTERNRT int rtxBigIntSetInt64 (OSCTXT* pctxt, OSBigInt* pInt, OSINT64 value);
00094
00104 EXTERNRT int rtxBigIntSetUInt64
00105 (OSCTXT* pctxt, OSBigInt* pInt, OSUINT64 value);
00106
00117 EXTERNRT int rtxBigIntSetBytes
00118 (OSCTXT* pctxt, OSBigInt* pInt, OSOCTET* value, OSSIZE vallen);
00119
00127 EXTERNRT OSSIZE rtxBigIntGetDataLen (const OSBigInt* pInt);
00128
00140 EXTERNRT int rtxBigIntGetData
00141 (OSCTXT* pctxt, const OSBigInt* pInt, OSOCTET* buffer, OSSIZE bufSize);
00142
00151 EXTERNRT OSSIZE rtxBigIntDigitsNum (const OSBigInt* pInt, int radix);
00152
00162 EXTERNRT int rtxBigIntCopy
00163 (OSCTXT* pctxt, const OSBigInt* pSrc, OSBigInt* pDst);
00164
00176 EXTERNRT int rtxBigIntFastCopy
00177 (OSCTXT* pctxt, const OSBigInt* pSrc, OSBigInt* pDst);
00178
00189 EXTERNRT int rtxBigIntToString
00190 (OSCTXT* pctxt, const OSBigInt* pInt, int radix, char* str, OSSIZE strSize);
00191
00200 EXTERNRT int rtxBigIntPrint
00201 (const OSUTF8CHAR* name, const OSBigInt* bigint, int radix);
00202
00213 EXTERNRT int rtxBigIntCompare (const OSBigInt* arg1, const OSBigInt* arg2);
00214
00226 EXTERNRT int rtxBigIntStrCompare
00227 (OSCTXT* pctxt, const char* arg1, const char* arg2);
00228
00236 EXTERNRT void rtxBigIntFree (OSCTXT* pctxt, OSBigInt* pInt);
00237
00238
00248 EXTERNRT int rtxBigIntAdd
00249 (OSCTXT* pctxt,
00250 OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2);
00251
00261 EXTERNRT int rtxBigIntSubtract
00262 (OSCTXT* pctxt,
00263 OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2);
00264
00274 EXTERNRT int rtxBigIntMultiply
00275 (OSCTXT* pctxt,
00276 OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2);
00277
00278
00279 EXTERNRT unsigned short rtxBigIntBitsPerDigit (int radix);
00280 EXTERNRT short rtxBigIntByteRadix (int halfRadix);
00281
00282 #ifdef __cplusplus
00283 }
00284 #endif
00285
00286 #endif
00287