⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 type_gbignumber.html

📁 一个非常有用的开源代码
💻 HTML
字号:
<html><head><title>Generated Documentation</title></head><body>	<image src="headerimage.png">	<br><br><table><tr><td><big><big><big style="font-family: arial;"><b>GBigNumber</b></big></big></big><br><br></td><td></td></tr></table><br><br><big><big><i>Constructors (public)</i></big></big><br><div style="margin-left: 40px;"><big><b>GBigNumber</b></big>()<br></div><br><big><big><i>Destructors</i></big></big><br><div style="margin-left: 40px;"><big><b>~GBigNumber</b></big>()<br></div><br><big><big><i>Public</i></big></big><br><div style="margin-left: 40px;">void <big><b>Add</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pBigNumber)<br><div style="margin-left: 80px;"><font color=brown> Add another big number to this one</font></div><br>void <big><b>And</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pBigNumber)<br><div style="margin-left: 80px;"><font color=brown> bitwise and</font></div><br>void <big><b>CalculatePrivateKey</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pPublicKey, <a href="type_GBigNumber.html">GBigNumber</a>* pProd)<br><div style="margin-left: 80px;"><font color=brown> Input:  pProd is the product of (p - 1) * (q - 1) where p and q are prime         pPublicKey is a number that has no common factors with pProd Output: this will become a private key to go with the public key</font></div><br>int <big><b>CompareTo</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pBigNumber)<br><div style="margin-left: 80px;"><font color=brown> Returns -1 if this is less than pBigNumber Returns 0 if this is equal to pBigNumber Returns 1 if this is greater than pBigNumber</font></div><br>void <big><b>Copy</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pBigNumber)<br><div style="margin-left: 80px;"><font color=brown> Copies the value of pBigNumber into this object</font></div><br>void <big><b>Decrement</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Subtracts one from the number</font></div><br>void <big><b>Divide</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pInNominator, <a href="type_GBigNumber.html">GBigNumber</a>* pInDenominator, <a href="type_GBigNumber.html">GBigNumber</a>* pOutRemainder)<br><div style="margin-left: 80px;"><font color=brown> Set this value to the ratio of two big numbers and return the remainder</font></div><br>void <big><b>Euclid</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pA1, <a href="type_GBigNumber.html">GBigNumber</a>* pB1, <a href="type_GBigNumber.html">GBigNumber</a>* pOutX, <a href="type_GBigNumber.html">GBigNumber</a>* pOutY)<br><div style="margin-left: 80px;"><font color=brown> Input:  integers a, b Output: this will be set to the greatest common divisor of a,b.         (If pOutX and pOutY are not NULL, they will be values such          that "this" = ax + by.)</font></div><br>void <big><b>FromBuffer</b></big>(const unsigned int* pBuffer, int nBufferSize)<br><div style="margin-left: 80px;"><font color=brown> Deserializes the number. little-Endian (first bit in buffer will be LSB)</font></div><br>void <big><b>FromByteBuffer</b></big>(const unsigned char* pBuffer, int nBufferChars)<br><div style="margin-left: 80px;"><font color=brown> Deserializes the number.</font></div><br>bool <big><b>FromHex</b></big>(const char* szHexValue)<br><div style="margin-left: 80px;"><font color=brown> Extract a value from a big endian hexadecimal string</font></div><br>bool <big><b>GetBit</b></big>(unsigned int n)<br><div style="margin-left: 80px;"><font color=brown> Returns the value of the nth bit where 0 represents the least significant bit (little endian)</font></div><br>int <big><b>GetBitCount</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Returns the number of bits in the number</font></div><br>bool <big><b>GetSign</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Returns true if the number is positive and false if it is negative</font></div><br>int <big><b>GetUInt</b></big>(unsigned int nPos)<br><div style="margin-left: 80px;"><font color=brown> Returns the nth unsigned integer used to represent this number</font></div><br>int <big><b>GetUIntCount</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Returns the number of unsigned integers required to represent this number</font></div><br>void <big><b>Increment</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Adds one to the number</font></div><br>void <big><b>Invert</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Multiplies the number by -1</font></div><br>bool <big><b>IsPrime</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Output: true = pretty darn sure (like 99.999%) it's prime         false = definately (100%) not prime</font></div><br>bool <big><b>IsZero</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Returns true if the number is zero</font></div><br>bool <big><b>MillerRabin</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pA)<br><div style="margin-left: 80px;"><font color=brown> Input:  "this" must be >= 3, and 2 <= a < "this" Output: "true" if this is either prime or a strong pseudoprime to base a,         "false" otherwise</font></div><br>void <big><b>Multiply</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pFirst, <a href="type_GBigNumber.html">GBigNumber</a>* pSecond)<br><div style="margin-left: 80px;"><font color=brown> Set this value to the product of two big numbers</font></div><br>void <big><b>Multiply</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pBigNumber, unsigned int nUInt)<br><div style="margin-left: 80px;"><font color=brown> Set this value to the product of another big number and an unsigned integer</font></div><br>void <big><b>Or</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pBigNumber)<br><div style="margin-left: 80px;"><font color=brown> bitwise or</font></div><br>void <big><b>PowerMod</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pA, <a href="type_GBigNumber.html">GBigNumber</a>* pK, <a href="type_GBigNumber.html">GBigNumber</a>* pN)<br><div style="margin-left: 80px;"><font color=brown> Input:  a, k>=0, n>=2 Output: this will be set to ((a raised to the power of k) modulus n)</font></div><br>void <big><b>SelectPublicKey</b></big>(const unsigned int* pRandomData, int nRandomDataUInts, <a href="type_GBigNumber.html">GBigNumber</a>* pProd)<br><div style="margin-left: 80px;"><font color=brown> Input:  pProd is the product of (p - 1) * (q - 1) where p and q are prime         pRandomData is some random data that will be used to pick the key. Output: It will return a key that has no common factors with pProd.  It starts         with the random data you provide and increments it until it fits this         criteria.</font></div><br>void <big><b>SetBit</b></big>(unsigned int nPos, bool bVal)<br><div style="margin-left: 80px;"><font color=brown> Sets the value of the nth bit where 0 represents the least significant bit (little endian)</font></div><br>void <big><b>SetRandom</b></big>(unsigned int nBits)<br><div style="margin-left: 80px;"><font color=brown> DO NOT use for crypto--This is NOT a cryptographic random number generator</font></div><br>void <big><b>SetSign</b></big>(bool bSign)<br><div style="margin-left: 80px;"><font color=brown> Makes the number positive if bSign is true and negative if bSign is false</font></div><br>void <big><b>SetToRand</b></big>(<a href="type_GRand.html">GRand</a>* pRand)<br><div style="margin-left: 80px;"><font color=brown> Cryptographic random number</font></div><br>void <big><b>SetToZero</b></big>()<br><div style="margin-left: 80px;"><font color=brown> Sets the number to zero</font></div><br>void <big><b>SetUInt</b></big>(unsigned int nPos, unsigned int nVal)<br><div style="margin-left: 80px;"><font color=brown> Sets the value of the nth unsigned integer used to represent this number</font></div><br>void <big><b>ShiftLeft</b></big>(unsigned int nBits)<br><div style="margin-left: 80px;"><font color=brown> Shift left (multiply by 2)</font></div><br>void <big><b>ShiftRight</b></big>(unsigned int nBits)<br><div style="margin-left: 80px;"><font color=brown> Shift right (divide by 2 and round down)</font></div><br>void <big><b>Subtract</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pBigNumber)<br><div style="margin-left: 80px;"><font color=brown> Subtract another big number from this one</font></div><br>bool <big><b>ToBuffer</b></big>(unsigned int* pBuffer, int nBufferSize)<br><div style="margin-left: 80px;"><font color=brown> Serializes the number. little-Endian (first bit in buffer will be LSB)</font></div><br>int <big><b>ToBufferGiveOwnership</b></big>()<br><div style="margin-left: 80px;"><font color=brown> This gives you ownership of the buffer.  (You must delete it.)  It also sets the value to zero.</font></div><br>bool <big><b>ToHex</b></big>(char* szBuff, int nBufferSize)<br><div style="margin-left: 80px;"><font color=brown> Produces a big endian hexadecimal representation of this number</font></div><br>void <big><b>Xor</b></big>(<a href="type_GBigNumber.html">GBigNumber</a>* pBigNumber)<br><div style="margin-left: 80px;"><font color=brown> bitwise xor</font></div><br></div><br><big><big><i>Protected</i></big></big><br><div style="margin-left: 40px;">void <big><b>Resize</b></big>(unsigned int nBits)<br>void <big><b>ShiftLeftBits</b></big>(unsigned int nBits)<br>void <big><b>ShiftLeftUInts</b></big>(unsigned int nBits)<br>void <big><b>ShiftRightBits</b></big>(unsigned int nBits)<br>void <big><b>ShiftRightUInts</b></big>(unsigned int nBits)<br></div><br></body></html>

⌨️ 快捷键说明

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