Difference between revisions of "83Plus:BCALLs:809F"

From WikiTI
Jump to: navigation, search
m (Changed official name and added destroys information)
(more details (ha! and you thought we were done with all this silly crypto stuff!))
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:83Plus:BCALLs:By Name:Math|SetupAppPubKey]]
+
[[Category:83Plus:BCALLs:By Name:Cryptography|SetupAppPubKey]] [[Category:83Plus:BCALLs:By Name:Math:Big Integer|SetupAppPubKey]] [[Category:83Plus:BCALLs:By Name:Math|SetupAppPubKey]] [[Category:83Plus:BCALLs:By Name|SetupAppPubKey]] [[Category:83Plus:BCALLs:By Address|809F - SetupAppPubKey]]
[[Category:83Plus:BCALLs:By Name|SetupAppPubKey]]
+
[[Category:83Plus:BCALLs:By Address|809F - SetupAppPubKey]]
+
 
== Synopsis ==
 
== Synopsis ==
 
'''Official Name:''' SetupAppPubKey
 
'''Official Name:''' SetupAppPubKey
Line 9: Line 7:
 
'''BCALL Address:''' 809F
 
'''BCALL Address:''' 809F
  
Loads the freeware key (or 0104 key) as a large integer into ram at address 8000h.
+
Loads an application public key as a [[83Plus:OS:Big Integers|big integer]] into the [[83Plus:RAM:8000|appData]] area.
  
 
=== Inputs ===
 
=== Inputs ===
* None
+
* A = base page of the application to be validated (must be in Flash)
  
 
=== Outputs ===
 
=== Outputs ===
* Memory at 8000h contains the freeware key
+
* Memory at [[83Plus:RAM:8000|8000]] contains the corresponding key
  
 
=== Destroys ===
 
=== Destroys ===
Line 22: Line 20:
 
== Comments ==
 
== Comments ==
 
The large integer loaded to 8000h is the 512 bit modulus used for decrypting Rabin signatures in Apps.  The first byte of the integer is the length of the large integer followed by the integer in little endian.
 
The large integer loaded to 8000h is the 512 bit modulus used for decrypting Rabin signatures in Apps.  The first byte of the integer is the length of the large integer followed by the integer in little endian.
 +
 +
This routine will always work if a freeware key (0104, or 010A on the TI-84 Plus) is requested.  Loading non-freeware keys requires Flash to be [[83Plus:Ports:14|write-enabled]] first.  (If Flash is write-disabled and a non-freeware key is requested, the routine will fall back to key 0104, but it is not clear that this is intentional.)
  
 
== Example ==
 
== Example ==
   B_CALL GetFreewareKey
+
  ld a,69h
 +
   B_CALL SetupAppPubKey

Latest revision as of 17:35, 25 December 2005

Synopsis

Official Name: SetupAppPubKey

Other Name: GetFreewareKey

BCALL Address: 809F

Loads an application public key as a big integer into the appData area.

Inputs

  • A = base page of the application to be validated (must be in Flash)

Outputs

  • Memory at 8000 contains the corresponding key

Destroys

  • BC, DE

Comments

The large integer loaded to 8000h is the 512 bit modulus used for decrypting Rabin signatures in Apps. The first byte of the integer is the length of the large integer followed by the integer in little endian.

This routine will always work if a freeware key (0104, or 010A on the TI-84 Plus) is requested. Loading non-freeware keys requires Flash to be write-enabled first. (If Flash is write-disabled and a non-freeware key is requested, the routine will fall back to key 0104, but it is not clear that this is intentional.)

Example

 ld a,69h
 B_CALL SetupAppPubKey