changeset 100:dc772132b5c9

doc/GrcardSIM2-WEKI-file: document mechanism and policy changes regarding the upper 6 bits of the mystery byte
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 05 May 2021 05:22:28 +0000
parents 97ba63d9361a
children 1888d88478c4
files doc/GrcardSIM2-WEKI-file
diffstat 1 files changed, 27 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/doc/GrcardSIM2-WEKI-file	Wed May 05 04:26:07 2021 +0000
+++ b/doc/GrcardSIM2-WEKI-file	Wed May 05 05:22:28 2021 +0000
@@ -63,15 +63,34 @@
 Even if we never learn the function of the other mysterious fields of EF.WEKI,
 we must be able to program our own Ki and make our own selection of COMP128
 algorithm version in order to use these programmable SIM cards with our own GSM
-networks.  The following solution has been implemented for immediate use:
+networks.  The following solution has been implemented in the absence of better
+documentation:
 
-* Our grcard2-set-comp128 command takes a single argument of 1, 2 or 3,
-  selecting COMP128 algorithm version.  The implementation of this command
-  selects EF.WEKI, reads the previous content of the magic byte at offset 2,
-  keeps the upper 6 bits unchanged, and writes the new COMP128 algorithm
-  selection into the low 2 bits.  If we ever learn the meaning of other bits,
-  we'll be able to add new orthogonal commands that manipulate those other bits,
-  but leave COMP128 selection unchanged.
+* Our grcard2-set-comp128 command takes one or two arguments; the first argument
+  must be 1, 2 or 3, selecting COMP128 algorithm version, whereas the second
+  optional argument gives the value to be written into the upper 6 bits of the
+  mystery byte.  The operation of this command always begins with selecting
+  EF.WEKI, but then differs depending on whether or not the optional second
+  argument was given.  If only the COMP128 version argument was given, our
+  command reads the previous content of the magic byte at offset 2, keeps the
+  upper 6 bits unchanged, and writes the new COMP128 algorithm selection into
+  the low 2 bits.  OTOH, if two arguments are given, then our command writes
+  the whole byte without reading its previous value; the first argument sets
+  the COMP128 algorithm version and the second argument sets the non-understood
+  upper 6 bits.  The second argument is always interpreted as hex and must be
+  in the range between 00 and FC, with the low 2 bits clear.
 
 * Our grcard2-set-ki command writes 16 bytes at offset 3, leaving all other
   bytes untouched.
+
+Practical choice for the upper 6 bits of the mystery byte
+=========================================================
+
+Following the principle of separation of mechanism and policy, our
+grcard2-set-comp128 command allows the upper 6 bits of the mystery byte to be
+either set explicitly or left unchanged.  However, for actual operational use
+of our FCSIM1 cards with our own GSM networks with COMP128v3, should we set the
+complete byte to 0x02 or to 0x22?  Based on the official "personalization"
+script from Grcard, I (Mother Mychaela) have decided to write zeros into the
+non-understood upper 6 bits, and this policy choice is embodied in our
+fcsim1-defprog command script.