Hpmbcalc Calculator Panel

IntroductionQuick ReferencesHow Do I ... TopicsBuilt-in ToolsScripting and Programming

Hpmbcalc is a calculator designed for multiple-precision unsigned integer arithmetic. It provides a panel for typing and formatting an operand, testing the properties of an operand, and performing basic big number operations.

The panel consists of four Multibyte Hex Edit Boxes (as shown above):

  1. : The first operand edit box. The first operand is used in unary operations, binary operations, and 3-operand operations.
  2. : The second operand edit box. The second operand is used in binary operations and 3-operand operations.
  3. : The third operand edit box. The third operand is used only in 3-operand operations.
  4. : The operation result edit box. The box saves all the operation result except unary operators: Increment, Decrement, Not, Lsh, Rsh, which assign operation result to the source operand.

and more than fifty buttons classified as six groups:

  1. : Used to enter a digit.
  2. : Used to convert active operand (result) between hex, dec, oct, and bin number system.
  3. : Used to change byte order of an operand or swap two operands.
  4. : Used to perform a unary operation, a binary operation, or a 3-operand operation.
  5. : Used to manage calculator memory.
  6. : Used to show current operator and memory status.

Using the panel, you can perform the following operations:

  1. Arithmetic Operations: Increment, Decrement, Add, Subtract, Multiply, Divide, Square, Sqrt;
  2. Bitwise Operations: And, Or, Xor, Not;
  3. Bitwise Shift Operations: Lsh, Rsh;
  4. Number Theory Operations: Mod, GCD, PMod, M^-1, Jn.

within above,

  1. Increment, Decrement, Not, Lsh, Rsh, Square, Sqrt are unary operations;
  2. PMod is a 3-operand operation;
  3. All others are binary operations.

What do you want to know more about?

How to execute a unary operation?

The unary operations Square and Sqrt correspond with the following equation:

  =  
Thus, to perform one of the operations, you need:
  1. Typing a number to .

  2. Clicking the unary that you want to execute.

  3. The result will show in .

Any other unary operations corresponds with the following equations:

  =  
  =  
  =  
To perform one of the operations, you need:
  1. Typing a number to , , or .

  2. Clicking the unary that you want to execute.

  3. The result will show in , , or .

How to execute a binary operation?

A binary operation corresponds with the following equation:

  =   
To perform it, you need:

  1. Typing first number to .

  2. Typing second number to .

  3. Clicking the binary that you want to execute.

  4. The result will show in .

How to execute a 3-operand operation?

A 3-operand operations corresponds with the following equation:

  =    
To perform it, you need:

  1. Typing first number to .

  2. Typing second number to .

  3. Typing third number to .

  4. Clicking the 3-operand that you want to execute.

  5. The result will show in .

How to type an operand?

To type an operand to , , or , you need:

  1. Activating the hex edit box you want to enter operand.

  2. Clicking one of the or type your keyboard to enter a digit.

  3. Repeating the same action until all the digits are entered.

The , , and all are Multibyte Hex Edit Box. For more information about how to list and edit an operand, please refer to Multibyte Hex Edit Box.

How to format an operand?

Using the commands, you can format an operand to its standard presentation or swap its byte order. The followings are the commands that you can use:

How to convert number between Hex/Dec/Oct/Bin systems?

Using the commands, you can convert any big number between hex, dec, oct, and bin number system. The followings are the general steps to do this:

  1. Activating the hex edit box you need to enter operand.

  2. Clicking one of the buttons to toggle to the number system of your original data.

  3. Typing your original data in the edit box.

  4. Clicking another button to convert the operand.

How to calculate square root?

You can use Sqrt operator to calculate the square root of an operand, which will return the integer portion of the root.

  1. Typing your number to .

  2. Clicking Sqrt operator button.

  3. The result will show in .

How to calculate Jacobi (Legendre) symbol?

The Jacobi(Legendre) symbol is a useful tool for keeping track of whether x is a quadratic residue modulo a number(prime) y. You can use Jn operator to calculate Jacobi(Legendre) symbol. The followings are the general steps to do this:

  1. Typing x to (0 <= x < y).

  2. Typing y to (y should be an odd integer and >= 3).

  3. Clicking Jn operator button.

  4. The result will show in . If result is FF FF FF FF, means that Jn(x|y) = -1.

How to calculate modular exponentiation?

One of the most important arithmetic operations for public-key cryptography is modular exponentiation. You can use PMod operator to calculate x^y modulu z. The followings are the general steps to calculate a modular exponentiation:

  1. Typing x to .

  2. Typing y to .

  3. Typing z to .

  4. Clicking PMod operator button.

  5. The modular exponentiation x^y modulu z will show in .

How to calculate modular inverse?

The multiplicative inverse of a modulu y is an integer r such that r*x modulu y = 1. If such a r exists, then it is unique, and x is said to be invertible. The followings are the general steps to calculate a modular inverse:

  1. Typing x to .

  2. Typing y to .

  3. Clicking M^-1 operator button.

  4. The result will show in . If result is 0, means that x is not invertible.