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
00069 EXTERNRT int rtxBigIntSetStr
00070 (OSCTXT* pctxt, OSBigInt* pInt, const char* value, int radix);
00071
00085 EXTERNRT int rtxBigIntSetStrn
00086 (OSCTXT* pctxt, OSBigInt* pInt, const char* value, OSSIZE len, int radix);
00087
00097 EXTERNRT int rtxBigIntSetInt64 (OSCTXT* pctxt, OSBigInt* pInt, OSINT64 value);
00098
00108 EXTERNRT int rtxBigIntSetUInt64
00109 (OSCTXT* pctxt, OSBigInt* pInt, OSUINT64 value);
00110
00121 EXTERNRT int rtxBigIntSetBytes
00122 (OSCTXT* pctxt, OSBigInt* pInt, OSOCTET* value, OSSIZE vallen);
00123
00131 EXTERNRT OSSIZE rtxBigIntGetDataLen (const OSBigInt* pInt);
00132
00144 EXTERNRT int rtxBigIntGetData
00145 (OSCTXT* pctxt, const OSBigInt* pInt, OSOCTET* buffer, OSSIZE bufSize);
00146
00155 EXTERNRT OSSIZE rtxBigIntDigitsNum (const OSBigInt* pInt, int radix);
00156
00166 EXTERNRT int rtxBigIntCopy
00167 (OSCTXT* pctxt, const OSBigInt* pSrc, OSBigInt* pDst);
00168
00180 EXTERNRT int rtxBigIntFastCopy
00181 (OSCTXT* pctxt, const OSBigInt* pSrc, OSBigInt* pDst);
00182
00193 EXTERNRT int rtxBigIntToString
00194 (OSCTXT* pctxt, const OSBigInt* pInt, int radix, char* str, OSSIZE strSize);
00195
00204 EXTERNRT int rtxBigIntPrint
00205 (const OSUTF8CHAR* name, const OSBigInt* bigint, int radix);
00206
00217 EXTERNRT int rtxBigIntCompare (const OSBigInt* arg1, const OSBigInt* arg2);
00218
00230 EXTERNRT int rtxBigIntStrCompare
00231 (OSCTXT* pctxt, const char* arg1, const char* arg2);
00232
00240 EXTERNRT void rtxBigIntFree (OSCTXT* pctxt, OSBigInt* pInt);
00241
00242
00252 EXTERNRT int rtxBigIntAdd
00253 (OSCTXT* pctxt,
00254 OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2);
00255
00265 EXTERNRT int rtxBigIntSubtract
00266 (OSCTXT* pctxt,
00267 OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2);
00268
00278 EXTERNRT int rtxBigIntMultiply
00279 (OSCTXT* pctxt,
00280 OSBigInt* result, const OSBigInt* arg1, const OSBigInt* arg2);
00281
00282
00283 EXTERNRT unsigned short rtxBigIntBitsPerDigit (int radix);
00284 EXTERNRT short rtxBigIntByteRadix (int halfRadix);
00285
00286 #ifdef __cplusplus
00287 }
00288 #endif
00289
00290 #endif
00291