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

From WikiTI
Jump to: navigation, search
m
(more details (ha! and you thought we were done with all this silly crypto stuff!))
 
Line 7: Line 7:
 
'''BCALL Address:''' 809F
 
'''BCALL Address:''' 809F
  
Loads the freeware key (or 0104 key) as a [[83Plus:OS:Big Integers|big integer]] into the [[83Plus:RAM:8000|appData]] area.
+
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 [[83Plus:RAM:8000|8000]] contains the freeware key
+
* Memory at [[83Plus:RAM:8000|8000]] contains the corresponding key
  
 
=== Destroys ===
 
=== Destroys ===
Line 20: 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 18: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