Claims
- 1. A method, comprising:
providing a table of residues in accordance with a first value of a modular product and powers of a base with respect to a modulus; multiplying each digit of a second value of the modular product by a corresponding entry in the table; and adding the product of each multiplication together to provide a modular equivalent to the modular product.
- 2. The method as recited in claim 1, wherein providing the table comprises building the table by multiplying the first value by powers of the base; performing a modular reduction of the product of the multiplication with respect to the modulus; and storing the remainder of the modular reduction in the table.
- 3. The method as recited in claim 1, further comprising:
performing a modular reduction on the modular equivalent.
- 4. The method as recited in claim 3, wherein the table of residues comprises a first table of residues, the modular equivalent comprises a first modular equivalent, and wherein performing the modular reduction comprises:
providing a second table of residues in accordance with a modular reduction of powers of the base with respect to the modulus; multiplying each digit of the first modular equivalent having a base power larger than the modulus by a corresponding entry in the second table; and adding a portion of the first modular equivalent having base powers less than or equal to the modulus together with the product of each multiplication to provide a second modular equivalent to the modular product.
- 5. The method as recited in claim 4, further comprising:
performing a modular reduction of the second modular equivalent.
- 6. The method as recited in claim 1, wherein the adding is performed using a delayed carry.
- 7. A method of performing at least one of encrypting a message and decrypting a message, comprising:
providing a modulus in association with a message; providing a table of residues in accordance with a first value of a modular product and powers of a base with respect to the modulus; performing at least one of encrypting the message and decrypting the message using the table of residues.
- 8. The method as recited in claim 7, wherein the modular product is associated with the message and the performing includes determining the modular product using the table of residues.
- 9. The method as recited in claim 8, wherein the determining the modular product comprises:
multiplying each digit of a second value of the modular product by a corresponding entry in the table; and adding the product of each multiplication together to provide a modular equivalent to the modular product.
- 10. The method as recited in claim 9, wherein providing the table comprises building the table by multiplying the first value by powers of the base; performing a modular reduction of the product of the multiplication with respect to the modulus; and storing the remainder of the modular reduction in the table.
- 11. The method as recited in claim 9, further comprising:
performing a modular reduction on the modular equivalent.
- 12. The method as recited in claim 11, wherein the table of residues comprises a first table of residues, the modular equivalent comprises a first modular equivalent, and wherein performing the modular reduction comprises:
providing a second table of residues in accordance with a modular reduction of powers of the base with respect to the modulus; multiplying each digit of the first modular equivalent having a base power larger than the modulus by a corresponding entry in the second table; and adding a portion of the first modular equivalent having base powers less than or equal to the modulus together with the product of each multiplication to provide a second modular equivalent to the modular product.
- 13. The method as recited in claim 12, further comprising:
performing a modular reduction of the second modular equivalent.
- 14. The method as recited in claim 9, wherein the adding is performed using a delayed carry.
- 15. An electronic system, comprising:
a processor; a storage device connected to the processor; and a communication device adapted to exchange a message with another electronic system, the communication device being operatively coupled to the storage device and processor, wherein the storage device is adapted to store a modulus in association with the message and also to store a table of residues in accordance with a first value of a modular product and powers of a base with respect to the modulus; and the processor is adapted to perform at least one of encrypting the message and decrypting the message using the table of residues.
- 16. The system as recited in claim 15, wherein the modular product is associated with the message and the processor is adapted to determine the modular product using the table of residues.
- 17. The system as recited in claim 16, wherein the processor is adapted to:
multiply each digit of a second value of the modular product by a corresponding entry in the table; and add the product of each multiplication together to provide a modular equivalent to the modular product.
- 18. The system as recited in claim 17, wherein the processor is adapted to build the table by multiplying the first value by powers of the base; performing a modular reduction of the product of the multiplication with respect to the modulus; and storing the remainder of the modular reduction in the storage device as an entry in the table in association with respective powers of the base.
- 19. The system as recited in claim 17, wherein the processor is further adapted to perform a modular reduction on the modular equivalent.
- 20. The system as recited in claim 19, wherein the table of residues comprises a first table of residues, the modular equivalent comprises a first modular equivalent, and wherein the processor is adapted to perform the modular reduction by accessing a second table of residues having entries in accordance with a modular reduction of powers of the base with respect to the modulus; multiplying each digit of the first modular equivalent having a base power larger than the modulus by a corresponding entry in the second table; and adding a portion of the first modular equivalent having base powers less than or equal to the modulus together with the product of each multiplication to provide a second modular equivalent to the modular product.
- 21. The system as recited in claim 20, wherein the processor is further adapted to perform a modular reduction of the second modular equivalent.
- 22. The system as recited in claim 17, wherein the processor is adapted to add using a delayed carry.
- 23. A storage media including data and instructions which when executed on an electronic system perform the following process:
store a table of residues in accordance with a first value of a modular product and powers of a base with respect to a modulus; multiply each digit of a second value of the modular product by a corresponding entry in the table; and add the product of each multiplication together to provide a modular equivalent to the modular product.
- 24. The media as recited in claim 23, wherein the storage media includes data and instructions to determine each entry of the table by multiplying the first value by a power of the base; performing a modular reduction of the product of the multiplication with respect to the modulus; and storing the remainder of the modular reduction in the table in association with the power of the base.
- 25. The media as recited in claim 23, further comprising data and instructions to perform a modular reduction on the modular equivalent.
- 26. The media as recited in claim 25, wherein the table of residues comprises a first table of residues, the modular equivalent comprises a first modular equivalent, and wherein the media further comprises data and instructions to:
store a second table of residues in accordance with a modular reduction of powers of the base with respect to the modulus; multiply each digit of the first modular equivalent having a base power larger than the modulus by a corresponding entry in the second table; and add a portion of the first modular equivalent having base powers less than or equal to the modulus together with the product of each multiplication to provide a second modular equivalent to the modular product.
- 27. The media as recited in claim 26, further comprising data and instructions to perform a modular reduction on the second modular equivalent.
- 28. The media as recited in claim 23, further comprising data and instructions to perform the add using a delayed carry.
CROSS REFERENCE TO RELATED APPLICATIONS
[0001] This application is related to co-pending U.S. patent application Ser. No. 10/______, (attorney docket no. 42P14851) filed on an even date herewith and entitled MODULAR REDUCTION OF MULTI-PRECISION NUMBERS, which is herein incorporated by reference in its entirety.