bigint.h

来自「信息安全的RSA与DES加解密算法的实现」· C头文件 代码 · 共 41 行

H
41
字号

#ifndef BI_MAXLEN
#define BI_MAXLEN 35
#define DEC 10
#define HEX 16

class CBigInt
{
public:
 
    unsigned m_nLength;

    unsigned long m_ulValue[BI_MAXLEN];
	
    CBigInt();
    ~CBigInt();

    void Mov(unsigned __int64 A);
    void Mov(CBigInt& A);
    CBigInt Add(CBigInt& A);
    CBigInt Sub(CBigInt& A);
    CBigInt Mul(CBigInt& A);
    CBigInt Div(CBigInt& A);
    CBigInt Mod(CBigInt& A);
    CBigInt Add(unsigned long A);
    CBigInt Sub(unsigned long A);
    CBigInt Mul(unsigned long A);
    CBigInt Div(unsigned long A);
    unsigned long Mod(unsigned long A); 
    int Cmp(CBigInt& A); 

    void Get(CString& str, unsigned int system=HEX);
    void Put(CString& str, unsigned int system=HEX);

    int Rab();
    CBigInt Euc(CBigInt& A);
    CBigInt RsaTrans(CBigInt& A, CBigInt& B);
    void GetPrime(int bits);
};
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?