Difference between revisions of "83Plus:BCALLs:80A5"

From WikiTI
Jump to: navigation, search
m
 
Line 1: Line 1:
'''Note:''' Do not take the information on this template page as actual documentation!
+
[[Category:83Plus:BCALLs:By_Name|TransformHash]]
 
+
[[Category:83Plus:BCALLs:By_Name:Math|TransformHash]]
Use this template for ROMCalls on calculators that don't use banked OS calls. Simply replace every occurance of bcall/BCALL/b_call with romcall/ROMCall/call.
+
[[Category:83Plus:BCALLs:By_Address|80A5 - TransformHash]]
 
+
The BCALLs are named by their b_call address, in hexadecimal. An example is [[83Plus:BCALLs:4009]].
+
 
+
Also, please put the following code (edited to reflect your call) in your page:
+
NaodW29-nowiki47e5414c14acfb4500000001
+
This will cause your page to show in the appropriate categories. (Change the ProveTheRiemannHypothesis, 0042, and Utility to match your call. Also, change the 83Plus to whatever category, and change the BCALLs to ROMCalls if needed.) You may put a BCALL in any number of "By Name" categories. Put it in all the ones that make sense.
+
 
+
----
+
 
+
 
== Synopsis ==
 
== Synopsis ==
'''Official Name:''' ProveTheRiemannHypothesis
+
'''Official Name:''' TransformHash
  
'''BCALL Address:''' 0042
+
'''BCALL Address:''' 80A5
''Use "Call Address" for regular 83.''
+
  
Proves the Riemann Hypothesis, storing the proof in an AppVar.
+
Applies one of the four ''f''-transformations as appropriate for the application to be validated.
  
 
=== Inputs ===
 
=== Inputs ===
* [[83Plus:RAM:8478|OP1]]: AppVar to save proof into
+
* [[83Plus:RAM:8291|8291]]: The MD5 hash as a big integer
* HL: Maximum length of proof, in pages (must be at least 200)
+
* [[83Plus:RAM:83E6|83E6]]: The parameter ''f'' as a big integer
* bit proofCorrect, (iy + proofFlags): Set to generate a correct proof
+
* [[83Plus:RAM:8000|8000]]: The modulus
  
 
=== Outputs ===
 
=== Outputs ===
* Proof stored in AppVar
+
* [[83Plus:RAM:83A5|MD5Buffer]]: The MD5 hash appropriately transformed.
* Zero Flag: Set if successful
+
  
 
=== Destroys ===
 
=== Destroys ===
* af
+
* [[83Plus:RAM:8100|8100]]: 130-byte area which the multiplication routine uses to store its result
 +
* [[83Plus:RAM:8182|8182]]: 65-byte area used as the first argument to the multiplication routine
 +
* [[83Plus:RAM:81C3|81C3]]: 65-byte area used as the second argument to the multiplication routine
  
 
== Comments ==
 
== Comments ==
This B_CALL proves the Riemann Hypothesis, giving a proof under the required number of pages. It does this by randomly guessing proofs until it finds one that works. Needless to say, the calculator's batteries will run out before this B_CALL completes.
+
Given ''p'', ''q'' prime, ''p'' = 3 mod 8, ''q'' = 7 mod 8, and ''m'' and relatively prime to both, exactly one of the following is a quadratic residue modulo ''pq'':
 +
* ''pq''-2''m''
 +
* ''pq''-''m''
 +
* ''m''
 +
* 2''m''
  
== Example ==
+
Which of the transformations is used is specified by the parameter ''f''.  In order to insure that the message is nonzero, or perhaps just to make life difficult, ''m'' is defined to be the MD5 of the application, multiplied by 256, plus 1.  Therefore:
NaodW29-nowiki47e5414c14acfb4500000002
+
* If f=0, the result is ''n''-2*(''MD5''*256+1)
 +
* If f=1, the result is ''n''-(''MD5''*256+1)
 +
* If f=2, the result is ''MD5''*256+1
 +
* If f=3, the result is 2*(''MD5''*256+1)
  
== Credits and Contributions ==
+
If the signature is valid, that number is a quadratic residue mod ''n'', and more to the point, it is the square of the Rabin signature.  That square is computed by the [[83Plus:BCALLs:80A2|Rabin]] B_CALL, and only if the two numbers match is the application considered valid.
* '''/dev/null:''' For not answering my questions about this B_CALL
+

Revision as of 08:38, 29 March 2005

Synopsis

Official Name: TransformHash

BCALL Address: 80A5

Applies one of the four f-transformations as appropriate for the application to be validated.

Inputs

  • 8291: The MD5 hash as a big integer
  • 83E6: The parameter f as a big integer
  • 8000: The modulus

Outputs

  • MD5Buffer: The MD5 hash appropriately transformed.

Destroys

  • 8100: 130-byte area which the multiplication routine uses to store its result
  • 8182: 65-byte area used as the first argument to the multiplication routine
  • 81C3: 65-byte area used as the second argument to the multiplication routine

Comments

Given p, q prime, p = 3 mod 8, q = 7 mod 8, and m and relatively prime to both, exactly one of the following is a quadratic residue modulo pq:

  • pq-2m
  • pq-m
  • m
  • 2m

Which of the transformations is used is specified by the parameter f. In order to insure that the message is nonzero, or perhaps just to make life difficult, m is defined to be the MD5 of the application, multiplied by 256, plus 1. Therefore:

  • If f=0, the result is n-2*(MD5*256+1)
  • If f=1, the result is n-(MD5*256+1)
  • If f=2, the result is MD5*256+1
  • If f=3, the result is 2*(MD5*256+1)

If the signature is valid, that number is a quadratic residue mod n, and more to the point, it is the square of the Rabin signature. That square is computed by the Rabin B_CALL, and only if the two numbers match is the application considered valid.