[Cryptech-Commits] [user/shatov/ecdsa_fpga_model] branch master updated: Updated microcode parser script.

git at cryptech.is git at cryptech.is
Sun Apr 11 18:07:09 UTC 2021


This is an automated email from the git hooks/post-receive script.

meisterpaul1 at yandex.ru pushed a commit to branch master
in repository user/shatov/ecdsa_fpga_model.

The following commit(s) were added to refs/heads/master by this push:
     new c94e882  Updated microcode parser script.
c94e882 is described below

commit c94e882a3bad117fe6c260f8a4012a7305c02915
Author: Pavel V. Shatov (Meister) <meisterpaul1 at yandex.ru>
AuthorDate: Sun Apr 11 21:06:28 2021 +0300

    Updated microcode parser script.
---
 ecdsa_microcode_parser.py | 238 +++++++++++++++++++++++-----------------------
 1 file changed, 118 insertions(+), 120 deletions(-)

diff --git a/ecdsa_microcode_parser.py b/ecdsa_microcode_parser.py
index 56aa94c..293e8a6 100644
--- a/ecdsa_microcode_parser.py
+++ b/ecdsa_microcode_parser.py
@@ -3,7 +3,7 @@
 #
 # Author: Pavel Shatov
 #
-# Copyright (c) 2018, NORDUnet A/S
+# Copyright (c) 2018, 2021 NORDUnet A/S
 #
 # All rights reserved.
 #
@@ -46,28 +46,28 @@ class MICROCODE_PARSER:
     # enumerate microcode pieces
     class MICROCODE_PIECE_ENUM(Enum):
     
-        NONE                    = -1
+        NONE                        = -1
         
-        PREPARE                 =  0
+        PREPARE                     =  0
         
-        CYCLE_DOUBLE            =  1
-        CYCLE_ADD               =  2
+        CYCLE_DOUBLE_R0             =  1
+        CYCLE_DOUBLE_R1             =  2
+        CYCLE_ADD                   =  3
         
-        CYCLE_ADD_AT_INFINITY   =  3
-        CYCLE_ADD_SAME_X_SAME_Y =  4
-        CYCLE_ADD_SAME_X        =  5
-        CYCLE_ADD_REGULAR       =  6
+        CYCLE_ADD_R0_AT_INFINITY    =  4
+        CYCLE_ADD_R1_AT_INFINITY    =  5
+        CYCLE_ADD_REGULAR           =  6
         
-        CYCLE_K0                =  7
-        CYCLE_K1                =  8
+        CYCLE_K0                    =  7
+        CYCLE_K1                    =  8
                 
-        CONVERT                 =  9
+        CONVERT                     =  9
         
-        CONVERT_AT_INFINITY     = 10
-        CONVERT_REGULAR         = 11
+        CONVERT_AT_INFINITY         = 10
+        CONVERT_REGULAR             = 11
         
-        INVERT_P256             = 12
-        INVERT_P384             = 13
+        INVERT_P256                 = 12
+        INVERT_P384                 = 13
 
 
     # magic pair of begin/end markers
@@ -99,21 +99,19 @@ class MICROCODE_PARSER:
     MICROCODE_C_NAMES_OPERANDS = [  "CONST_ZERO",  "CONST_ONE",
                                     "CONST_DELTA",
                                     "CONST_GX",    "CONST_GY",
-                                    "CONST_HX",    "CONST_HY",
                                     "INVERT_R1",   "INVERT_R2",
-                                    "INVERT_X2",   "INVERT_X3",  "INVERT_X6",
-                                    "INVERT_X12",  "INVERT_X15", "INVERT_X30",
-                                    "INVERT_X32",  "INVERT_X60", "INVERT_X120",
+                                    "INVERT_X2",   "INVERT_X3",   "INVERT_X6",
+                                    "INVERT_X12",  "INVERT_X15",  "INVERT_X30",
+                                    "INVERT_X32",  "INVERT_X60",  "INVERT_X120",
                                     "INVERT_A2",   "INVERT_A3",
-                                    "CYCLE_RX",    "CYCLE_RY",   "CYCLE_RZ",
-                                    "CYCLE_SX",    "CYCLE_SY",   "CYCLE_SZ",
-                                    "CYCLE_A",     "CYCLE_A2",   "CYCLE_B",
-                                    "CYCLE_C",     "CYCLE_C2",   "CYCLE_C2_2",
-                                    "CYCLE_D",     "CYCLE_E",    "CYCLE_F",
-                                    "CYCLE_G",     "CYCLE_H",    "CYCLE_J",
-                                    "CYCLE_Z2",
+                                    "CYCLE_R0X",   "CYCLE_R0Y",   "CYCLE_R0Z",
+                                    "CYCLE_R1X",   "CYCLE_R1Y",   "CYCLE_R1Z",
+                                    "CYCLE_SX",    "CYCLE_SY",    "CYCLE_SZ",
+                                    "CYCLE_TX",    "CYCLE_TY",    "CYCLE_TZ",
                                     "CYCLE_T1",    "CYCLE_T2",
-                                    "CYCLE_T3",    "CYCLE_T4"]
+                                    "CYCLE_T3",    "CYCLE_T4",
+                                    "CYCLE_T5",    "CYCLE_T6",
+                                    "CYCLE_T7",    "CYCLE_T8"]
 
     # names of banks in Verilog source
     MICROCODE_V_NAME_BANKS_DUMMY = "UOP_BANKS_DUMMY"
@@ -149,26 +147,26 @@ class MICROCODE_PARSER:
     MATCH_GROUP_CALC        = "(" + MICROCODE_C_NAME_UOP_CALC + "|" + MICROCODE_C_NAME_UOP_CALC_EVEN + "|" + MICROCODE_C_NAME_UOP_CALC_ODD + ")"
     
     # map string microcode piece names to enum values
-    MICROCODE_PIECE_DICT    = {     "PREPARE":                 MICROCODE_PIECE_ENUM.PREPARE,
+    MICROCODE_PIECE_DICT    = {     "PREPARE":                  MICROCODE_PIECE_ENUM.PREPARE,
                                     
-                                    "CYCLE_DOUBLE":            MICROCODE_PIECE_ENUM.CYCLE_DOUBLE,
-                                    "CYCLE_ADD":               MICROCODE_PIECE_ENUM.CYCLE_ADD,
+                                    "CYCLE_DOUBLE_R0":          MICROCODE_PIECE_ENUM.CYCLE_DOUBLE_R0,
+                                    "CYCLE_DOUBLE_R1":          MICROCODE_PIECE_ENUM.CYCLE_DOUBLE_R1,
                                     
-                                    "CYCLE_ADD_AT_INFINITY":   MICROCODE_PIECE_ENUM.CYCLE_ADD_AT_INFINITY,
-                                    "CYCLE_ADD_SAME_X_SAME_Y": MICROCODE_PIECE_ENUM.CYCLE_ADD_SAME_X_SAME_Y,
-                                    "CYCLE_ADD_SAME_X":        MICROCODE_PIECE_ENUM.CYCLE_ADD_SAME_X,
-                                    "CYCLE_ADD_REGULAR":       MICROCODE_PIECE_ENUM.CYCLE_ADD_REGULAR,
+                                    "CYCLE_ADD":                MICROCODE_PIECE_ENUM.CYCLE_ADD,                                    
+                                    "CYCLE_ADD_R0_AT_INFINITY": MICROCODE_PIECE_ENUM.CYCLE_ADD_R0_AT_INFINITY,
+                                    "CYCLE_ADD_R1_AT_INFINITY": MICROCODE_PIECE_ENUM.CYCLE_ADD_R1_AT_INFINITY,
+                                    "CYCLE_ADD_REGULAR":        MICROCODE_PIECE_ENUM.CYCLE_ADD_REGULAR,
                                     
-                                    "CYCLE_K0":                MICROCODE_PIECE_ENUM.CYCLE_K0,
-                                    "CYCLE_K1":                MICROCODE_PIECE_ENUM.CYCLE_K1,
+                                    "CYCLE_K0":                 MICROCODE_PIECE_ENUM.CYCLE_K0,
+                                    "CYCLE_K1":                 MICROCODE_PIECE_ENUM.CYCLE_K1,
                                     
-                                    "INVERT_P256":             MICROCODE_PIECE_ENUM.INVERT_P256,
-                                    "INVERT_P384":             MICROCODE_PIECE_ENUM.INVERT_P384,
+                                    "INVERT_P256":              MICROCODE_PIECE_ENUM.INVERT_P256,
+                                    "INVERT_P384":              MICROCODE_PIECE_ENUM.INVERT_P384,
                                     
-                                    "CONVERT":                 MICROCODE_PIECE_ENUM.CONVERT,
+                                    "CONVERT":                  MICROCODE_PIECE_ENUM.CONVERT,
                                     
-                                    "CONVERT_AT_INFINITY":     MICROCODE_PIECE_ENUM.CONVERT_AT_INFINITY,
-                                    "CONVERT_REGULAR":         MICROCODE_PIECE_ENUM.CONVERT_REGULAR}
+                                    "CONVERT_AT_INFINITY":      MICROCODE_PIECE_ENUM.CONVERT_AT_INFINITY,
+                                    "CONVERT_REGULAR":          MICROCODE_PIECE_ENUM.CONVERT_REGULAR}
                                     
                                     
     # map C bank names to Verilog bank names
@@ -188,26 +186,26 @@ class MICROCODE_PARSER:
     MICROCODE_FORMAT_OFFSET = "localparam [UOP_ADDR_WIDTH-1:0] %s = " + MICROCODE_FORMAT_ADDR + ";"
                             
     # pieces of microcode
-    MICROCODE_LINES_PREPARE                 = []
+    MICROCODE_LINES_PREPARE                  = []
     
-    MICROCODE_LINES_CYCLE_DOUBLE            = []
-    MICROCODE_LINES_CYCLE_ADD               = []
+    MICROCODE_LINES_CYCLE_DOUBLE_R0          = []
+    MICROCODE_LINES_CYCLE_DOUBLE_R1          = []
     
-    MICROCODE_LINES_CYCLE_ADD_AT_INFINITY   = []
-    MICROCODE_LINES_CYCLE_ADD_SAME_X_SAME_Y = []
-    MICROCODE_LINES_CYCLE_ADD_SAME_X        = []
-    MICROCODE_LINES_CYCLE_ADD_REGULAR       = []
+    MICROCODE_LINES_CYCLE_ADD                = []
+    MICROCODE_LINES_CYCLE_ADD_R0_AT_INFINITY = []
+    MICROCODE_LINES_CYCLE_ADD_R1_AT_INFINITY = []
+    MICROCODE_LINES_CYCLE_ADD_REGULAR        = []
     
-    MICROCODE_LINES_CYCLE_K0                = []
-    MICROCODE_LINES_CYCLE_K1                = []
+    MICROCODE_LINES_CYCLE_K0                 = []
+    MICROCODE_LINES_CYCLE_K1                 = []
     
-    MICROCODE_LINES_INVERT_P256             = []
-    MICROCODE_LINES_INVERT_P384             = []
+    MICROCODE_LINES_INVERT_P256              = []
+    MICROCODE_LINES_INVERT_P384              = []
     
-    MICROCODE_LINES_CONVERT                 = []
+    MICROCODE_LINES_CONVERT                  = []
     
-    MICROCODE_LINES_CONVERT_AT_INFINITY     = []
-    MICROCODE_LINES_CONVERT_REGULAR         = []
+    MICROCODE_LINES_CONVERT_AT_INFINITY      = []
+    MICROCODE_LINES_CONVERT_REGULAR          = []
     
     MICROCODE_LINE_STOP = "{%s, %s, %s, %s, %s}" % (    MICROCODE_V_NAME_OPCODE_STOP,
                                                         MICROCODE_V_NAME_BANKS_DUMMY,
@@ -251,36 +249,36 @@ class MICROCODE_PARSER:
         if mode == 0:
             sys.exit("sys.exit(): Usage: ecdsa_microcode_parser.py <P256|P384>!")
     
-        if len(self.MICROCODE_LINES_PREPARE)                 == 0: sys.exit("sys.exit(): Empty PREPARE piece!")
+        if len(self.MICROCODE_LINES_PREPARE)                  == 0: sys.exit("sys.exit(): Empty PREPARE piece!")
         
-        if len(self.MICROCODE_LINES_CYCLE_DOUBLE)            == 0: sys.exit("sys.exit(): Empty CYCLE_DOUBLE piece!")
-        if len(self.MICROCODE_LINES_CYCLE_ADD)               == 0: sys.exit("sys.exit(): Empty CYCLE_ADD piece!")
-        
-        if len(self.MICROCODE_LINES_CYCLE_ADD_AT_INFINITY)   == 0: sys.exit("sys.exit(): Empty CYCLE_ADD_AT_INFINITY piece!")
-        if len(self.MICROCODE_LINES_CYCLE_ADD_SAME_X_SAME_Y) == 0: sys.exit("sys.exit(): Empty CYCLE_ADD_SAME_X_SAME_Y piece!")
-        if len(self.MICROCODE_LINES_CYCLE_ADD_SAME_X)        == 0: sys.exit("sys.exit(): Empty CYCLE_ADD_SAME_X piece!")
-        if len(self.MICROCODE_LINES_CYCLE_ADD_REGULAR)       == 0: sys.exit("sys.exit(): Empty CYCLE_ADD_REGULAR piece!")
+        if len(self.MICROCODE_LINES_CYCLE_DOUBLE_R0)          == 0: sys.exit("sys.exit(): Empty CYCLE_DOUBLE_R0 piece!")
+        if len(self.MICROCODE_LINES_CYCLE_DOUBLE_R1)          == 0: sys.exit("sys.exit(): Empty CYCLE_DOUBLE_R1 piece!")
+                
+        if len(self.MICROCODE_LINES_CYCLE_ADD)                == 0: sys.exit("sys.exit(): Empty CYCLE_ADD piece!")
+        if len(self.MICROCODE_LINES_CYCLE_ADD_R0_AT_INFINITY) == 0: sys.exit("sys.exit(): Empty CYCLE_ADD_R0_AT_INFINITY piece!")
+        if len(self.MICROCODE_LINES_CYCLE_ADD_R1_AT_INFINITY) == 0: sys.exit("sys.exit(): Empty CYCLE_ADD_R1_AT_INFINITY piece!")
+        if len(self.MICROCODE_LINES_CYCLE_ADD_REGULAR)        == 0: sys.exit("sys.exit(): Empty CYCLE_ADD_REGULAR piece!")
         
-        if len(self.MICROCODE_LINES_CYCLE_K0)                == 0: sys.exit("sys.exit(): Empty CYCLE_K0 piece!")
-        if len(self.MICROCODE_LINES_CYCLE_K1)                == 0: sys.exit("sys.exit(): Empty CYCLE_K1 piece!")
+        if len(self.MICROCODE_LINES_CYCLE_K0)                 == 0: sys.exit("sys.exit(): Empty CYCLE_K0 piece!")
+        if len(self.MICROCODE_LINES_CYCLE_K1)                 == 0: sys.exit("sys.exit(): Empty CYCLE_K1 piece!")
         
-        if len(self.MICROCODE_LINES_INVERT_P256)             == 0: sys.exit("sys.exit(): Empty INVERT_P256 piece!")
-        if len(self.MICROCODE_LINES_INVERT_P384)             == 0: sys.exit("sys.exit(): Empty INVERT_P384 piece!")
+        if len(self.MICROCODE_LINES_INVERT_P256)              == 0: sys.exit("sys.exit(): Empty INVERT_P256 piece!")
+        if len(self.MICROCODE_LINES_INVERT_P384)              == 0: sys.exit("sys.exit(): Empty INVERT_P384 piece!")
         
-        if len(self.MICROCODE_LINES_CONVERT)                 == 0: sys.exit("sys.exit(): Empty CONVERT piece!")
+        if len(self.MICROCODE_LINES_CONVERT)                  == 0: sys.exit("sys.exit(): Empty CONVERT piece!")
         
-        if len(self.MICROCODE_LINES_CONVERT_AT_INFINITY)     == 0: sys.exit("sys.exit(): Empty CONVERT_AT_INFINITY piece!")
-        if len(self.MICROCODE_LINES_CONVERT_REGULAR)         == 0: sys.exit("sys.exit(): Empty CONVERT_REGULAR piece!")
+        if len(self.MICROCODE_LINES_CONVERT_AT_INFINITY)      == 0: sys.exit("sys.exit(): Empty CONVERT_AT_INFINITY piece!")
+        if len(self.MICROCODE_LINES_CONVERT_REGULAR)          == 0: sys.exit("sys.exit(): Empty CONVERT_REGULAR piece!")
         
         length = 0
         length += len(self.MICROCODE_LINES_PREPARE)
 
-        length += len(self.MICROCODE_LINES_CYCLE_DOUBLE)
+        length += len(self.MICROCODE_LINES_CYCLE_DOUBLE_R0)
+        length += len(self.MICROCODE_LINES_CYCLE_DOUBLE_R1)
+        
         length += len(self.MICROCODE_LINES_CYCLE_ADD)
-
-        length += len(self.MICROCODE_LINES_CYCLE_ADD_AT_INFINITY)
-        length += len(self.MICROCODE_LINES_CYCLE_ADD_SAME_X_SAME_Y)
-        length += len(self.MICROCODE_LINES_CYCLE_ADD_SAME_X)
+        length += len(self.MICROCODE_LINES_CYCLE_ADD_R0_AT_INFINITY)
+        length += len(self.MICROCODE_LINES_CYCLE_ADD_R1_AT_INFINITY)
         length += len(self.MICROCODE_LINES_CYCLE_ADD_REGULAR)
 
         length += len(self.MICROCODE_LINES_CYCLE_K0)
@@ -311,9 +309,15 @@ class MICROCODE_PARSER:
             self.__format_line(line)
         self.__format_line(self.MICROCODE_LINE_STOP)
 
-        offset_cycle_double = self.__addr;
-        print("// CYCLE_DOUBLE");
-        for line in self.MICROCODE_LINES_CYCLE_DOUBLE:
+        offset_cycle_double_r0 = self.__addr;
+        print("// CYCLE_DOUBLE_R0");
+        for line in self.MICROCODE_LINES_CYCLE_DOUBLE_R0:
+            num_mul_cycle += self.__format_line(line)
+        self.__format_line(self.MICROCODE_LINE_STOP)
+        
+        offset_cycle_double_r1 = self.__addr;
+        print("// CYCLE_DOUBLE_R1");
+        for line in self.MICROCODE_LINES_CYCLE_DOUBLE_R1:
             num_mul_cycle += self.__format_line(line)
         self.__format_line(self.MICROCODE_LINE_STOP)
 
@@ -323,23 +327,17 @@ class MICROCODE_PARSER:
             num_mul_cycle += self.__format_line(line)
         self.__format_line(self.MICROCODE_LINE_STOP)
 
-        offset_cycle_add_at_infinity = self.__addr;
-        print("// CYCLE_ADD_AT_INFINITY");
-        for line in self.MICROCODE_LINES_CYCLE_ADD_AT_INFINITY:
+        offset_cycle_add_r0_at_infinity = self.__addr;
+        print("// CYCLE_ADD_R0_AT_INFINITY");
+        for line in self.MICROCODE_LINES_CYCLE_ADD_R0_AT_INFINITY:
             self.__format_line(line)
         self.__format_line(self.MICROCODE_LINE_STOP)
         
-        offset_cycle_add_same_x_same_y = self.__addr;
-        print("// CYCLE_ADD_SAME_X_SAME_Y");
-        for line in self.MICROCODE_LINES_CYCLE_ADD_SAME_X_SAME_Y:
+        offset_cycle_add_r1_at_infinity = self.__addr;
+        print("// CYCLE_ADD_R1_AT_INFINITY");
+        for line in self.MICROCODE_LINES_CYCLE_ADD_R1_AT_INFINITY:
             self.__format_line(line)
-        self.__format_line(self.MICROCODE_LINE_STOP)
-        
-        offset_cycle_add_same_x = self.__addr;
-        print("// CYCLE_ADD_SAME_X");
-        for line in self.MICROCODE_LINES_CYCLE_ADD_SAME_X:
-            self.__format_line(line)
-        self.__format_line(self.MICROCODE_LINE_STOP)
+        self.__format_line(self.MICROCODE_LINE_STOP)        
 
         offset_cycle_add_regular = self.__addr;
         print("// CYCLE_ADD_REGULAR");
@@ -392,20 +390,20 @@ class MICROCODE_PARSER:
             self.__format_line(self.MICROCODE_LINE_STOP)
 
         print("\n")
-        self.__format_offset("UOP_OFFSET_PREPARE                ", offset_prepare)
-        self.__format_offset("UOP_OFFSET_CYCLE_DOUBLE           ", offset_cycle_double)
-        self.__format_offset("UOP_OFFSET_CYCLE_ADD              ", offset_cycle_add)
-        self.__format_offset("UOP_OFFSET_CYCLE_ADD_AT_INFINITY  ", offset_cycle_add_at_infinity)
-        self.__format_offset("UOP_OFFSET_CYCLE_ADD_SAME_X_SAME_Y", offset_cycle_add_same_x_same_y)
-        self.__format_offset("UOP_OFFSET_CYCLE_ADD_SAME_X       ", offset_cycle_add_same_x)
-        self.__format_offset("UOP_OFFSET_CYCLE_ADD_REGULAR      ", offset_cycle_add_regular)
-        self.__format_offset("UOP_OFFSET_CYCLE_K0               ", offset_cycle_k0)
-        self.__format_offset("UOP_OFFSET_CYCLE_K1               ", offset_cycle_k1)
-        self.__format_offset("UOP_OFFSET_CONVERT                ", offset_convert)
-        self.__format_offset("UOP_OFFSET_CONVERT_AT_INFINITY    ", offset_convert_at_infinity)
-        self.__format_offset("UOP_OFFSET_CONVERT_REGULAR        ", offset_convert_regular)
-        if mode == 1: self.__format_offset("UOP_OFFSET_INVERT_P256            ", offset_invert_p256)
-        if mode == 2: self.__format_offset("UOP_OFFSET_INVERT_P384            ", offset_invert_p384)
+        self.__format_offset("UOP_OFFSET_PREPARE                   ", offset_prepare)
+        self.__format_offset("UOP_OFFSET_CYCLE_DOUBLE_R0           ", offset_cycle_double_r0)
+        self.__format_offset("UOP_OFFSET_CYCLE_DOUBLE_R1           ", offset_cycle_double_r1)
+        self.__format_offset("UOP_OFFSET_CYCLE_ADD                 ", offset_cycle_add)
+        self.__format_offset("UOP_OFFSET_CYCLE_ADD_R0_AT_INFINITY  ", offset_cycle_add_r0_at_infinity)
+        self.__format_offset("UOP_OFFSET_CYCLE_ADD_R1_AT_INFINITY  ", offset_cycle_add_r1_at_infinity)
+        self.__format_offset("UOP_OFFSET_CYCLE_ADD_REGULAR         ", offset_cycle_add_regular)
+        self.__format_offset("UOP_OFFSET_CYCLE_K0                  ", offset_cycle_k0)
+        self.__format_offset("UOP_OFFSET_CYCLE_K1                  ", offset_cycle_k1)
+        self.__format_offset("UOP_OFFSET_CONVERT                   ", offset_convert)
+        self.__format_offset("UOP_OFFSET_CONVERT_AT_INFINITY       ", offset_convert_at_infinity)
+        self.__format_offset("UOP_OFFSET_CONVERT_REGULAR           ", offset_convert_regular)
+        if mode == 1: self.__format_offset("UOP_OFFSET_INVERT_P256               ", offset_invert_p256)
+        if mode == 2: self.__format_offset("UOP_OFFSET_INVERT_P384               ", offset_invert_p384)
         
         print("")
         print("num_mul_cycle = %d" % num_mul_cycle)
@@ -655,20 +653,20 @@ class MICROCODE_PARSER:
         
     def __store_uop(self, data):
         #print("\t" + data)
-        if   self.__current_piece == self.MICROCODE_PIECE_ENUM.PREPARE:                 self.MICROCODE_LINES_PREPARE.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_DOUBLE:            self.MICROCODE_LINES_CYCLE_DOUBLE.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD:               self.MICROCODE_LINES_CYCLE_ADD.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD_AT_INFINITY:   self.MICROCODE_LINES_CYCLE_ADD_AT_INFINITY.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD_SAME_X_SAME_Y: self.MICROCODE_LINES_CYCLE_ADD_SAME_X_SAME_Y.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD_SAME_X:        self.MICROCODE_LINES_CYCLE_ADD_SAME_X.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD_REGULAR:       self.MICROCODE_LINES_CYCLE_ADD_REGULAR.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_K0:                self.MICROCODE_LINES_CYCLE_K0.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_K1:                self.MICROCODE_LINES_CYCLE_K1.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.INVERT_P256:             self.MICROCODE_LINES_INVERT_P256.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.INVERT_P384:             self.MICROCODE_LINES_INVERT_P384.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CONVERT:                 self.MICROCODE_LINES_CONVERT.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CONVERT_AT_INFINITY:     self.MICROCODE_LINES_CONVERT_AT_INFINITY.append(data)
-        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CONVERT_REGULAR:         self.MICROCODE_LINES_CONVERT_REGULAR.append(data)
+        if   self.__current_piece == self.MICROCODE_PIECE_ENUM.PREPARE:                  self.MICROCODE_LINES_PREPARE.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_DOUBLE_R0:          self.MICROCODE_LINES_CYCLE_DOUBLE_R0.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_DOUBLE_R1:          self.MICROCODE_LINES_CYCLE_DOUBLE_R1.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD:                self.MICROCODE_LINES_CYCLE_ADD.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD_R0_AT_INFINITY: self.MICROCODE_LINES_CYCLE_ADD_R0_AT_INFINITY.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD_R1_AT_INFINITY: self.MICROCODE_LINES_CYCLE_ADD_R1_AT_INFINITY.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_ADD_REGULAR:        self.MICROCODE_LINES_CYCLE_ADD_REGULAR.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_K0:                 self.MICROCODE_LINES_CYCLE_K0.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CYCLE_K1:                 self.MICROCODE_LINES_CYCLE_K1.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.INVERT_P256:              self.MICROCODE_LINES_INVERT_P256.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.INVERT_P384:              self.MICROCODE_LINES_INVERT_P384.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CONVERT:                  self.MICROCODE_LINES_CONVERT.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CONVERT_AT_INFINITY:      self.MICROCODE_LINES_CONVERT_AT_INFINITY.append(data)
+        elif self.__current_piece == self.MICROCODE_PIECE_ENUM.CONVERT_REGULAR:          self.MICROCODE_LINES_CONVERT_REGULAR.append(data)
 
     def __print_parse_error(self, msg):
         print("PARSE ERROR: %s" % (msg))

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list