Example #1
0
    def test_add_round_key_0(self):
        rk=[aes.key_bv('00010203'),aes.key_bv('04050607'),aes.key_bv('08090a0b'),\
            aes.key_bv('0c0d0e0f')]

        sa=aes.init_state_array(aes.key_bv('00112233445566778899aabbccddeeff'))
        self.assertEqual(aes.state_str(aes.add_round_key(sa,rk)),\
                         '00102030405060708090a0b0c0d0e0f0',\
            "Test add round key from FIPS-197 C.1 round[0]")
Example #2
0
    def test_add_round_key_3(self):
        rk=[aes.key_bv('47f7f7bc'),aes.key_bv('95353e03'),aes.key_bv('f96c32bc'),\
            aes.key_bv('fd058dfd')]
        

        sa=aes.init_state_array(aes.key_bv('6385b79ffc538df997be478e7547d691'))
        self.assertEqual(aes.state_str(aes.add_round_key(sa,rk)),\
                         '247240236966b3fa6ed2753288425b6c',\
            "Test add round key from FIPS-197 C.1 round[3]")     
Example #3
0
    def test_add_round_key_1(self):
        rk=[aes.key_bv('d6aa74fd'),aes.key_bv('d2af72fa'),aes.key_bv('daa678f1'),\
            aes.key_bv('d6ab76fe')]

        sa = aes.init_state_array(
            aes.key_bv('5f72641557f5bc92f7be3b291db9f91a'))
        self.assertEqual(aes.state_str(aes.add_round_key(sa,rk)),\
                         '89d810e8855ace682d1843d8cb128fe4',\
            "Test add round key from FIPS-197 C.1 round[1]")
Example #4
0
    def test_add_round_key_2(self):
        rk=[aes.key_bv('b692cf0b'),aes.key_bv('643dbdf1'),aes.key_bv('be9bc500'),\
            aes.key_bv('6830b3fe')]

        sa = aes.init_state_array(
            aes.key_bv('ff87968431d86a51645151fa773ad009'))
        self.assertEqual(aes.state_str(aes.add_round_key(sa,rk)),\
                         '4915598f55e5d7a0daca94fa1f0a63f7',\
            "Test add round key from FIPS-197 C.1 round[2]")
Example #5
0
    def test_add_round_key_3(self):
        rk=[aes.key_bv('47f7f7bc'),aes.key_bv('95353e03'),aes.key_bv('f96c32bc'),\
            aes.key_bv('fd058dfd')]

        sa = aes.init_state_array(
            aes.key_bv('6385b79ffc538df997be478e7547d691'))
        self.assertEqual(aes.state_str(aes.add_round_key(sa,rk)),\
                         '247240236966b3fa6ed2753288425b6c',\
            "Test add round key from FIPS-197 C.1 round[3]")
Example #6
0
    def test_add_round_key_2(self):
        rk=[aes.key_bv('b692cf0b'),aes.key_bv('643dbdf1'),aes.key_bv('be9bc500'),\
            aes.key_bv('6830b3fe')]
    

        sa=aes.init_state_array(aes.key_bv('ff87968431d86a51645151fa773ad009'))
        self.assertEqual(aes.state_str(aes.add_round_key(sa,rk)),\
                         '4915598f55e5d7a0daca94fa1f0a63f7',\
            "Test add round key from FIPS-197 C.1 round[2]")     
Example #7
0
    def test_add_round_key_0(self):
        rk=[aes.key_bv('00010203'),aes.key_bv('04050607'),aes.key_bv('08090a0b'),\
            aes.key_bv('0c0d0e0f')]

        sa = aes.init_state_array(
            aes.key_bv('00112233445566778899aabbccddeeff'))
        self.assertEqual(aes.state_str(aes.add_round_key(sa,rk)),\
                         '00102030405060708090a0b0c0d0e0f0',\
            "Test add round key from FIPS-197 C.1 round[0]")
Example #8
0
    def test_add_round_key_1(self):
        rk=[aes.key_bv('d6aa74fd'),aes.key_bv('d2af72fa'),aes.key_bv('daa678f1'),\
            aes.key_bv('d6ab76fe')]
        

        sa=aes.init_state_array(aes.key_bv('5f72641557f5bc92f7be3b291db9f91a'))
        self.assertEqual(aes.state_str(aes.add_round_key(sa,rk)),\
                         '89d810e8855ace682d1843d8cb128fe4',\
            "Test add round key from FIPS-197 C.1 round[1]")
Example #9
0
 def test_inv_shift_rows_1(self):
     sa = aes.init_state_array(
         aes.key_bv('a7be1a6997ad739bd8c9ca451f618b61'))
     self.assertEqual(aes.state_str(aes.inv_shift_rows(sa)),\
                      'a761ca9b97be8b45d8ad1a611fc97369',\
         "Test shift rows from FIPS-197 C.1 round[2]")
Example #10
0
 def test_inv_shift_rows_0(self):
     sa = aes.init_state_array(
         aes.key_bv('6353e08c0960e104cd70b751bacad0e7'))
     self.assertEqual(aes.state_str(aes.inv_shift_rows(sa)),\
                      '63cab7040953d051cd60e0e7ba70e18c',\
         "Test shift rows from FIPS-197 C.1 round[1]")
Example #11
0
 def test_inv_sub_bytes_3(self):
     sa = aes.init_state_array(
         aes.key_bv('2dfb02343f6d12dd09337ec75b36e3f0'))
     self.assertEqual(aes.state_str(aes.inv_sub_bytes(sa)),\
                      'fa636a2825b339c940668a3157244d17',\
                      "testing inv_sub_bytes from FIPS-197 C.1 round[1]")
Example #12
0
 def test_inv_sub_bytes_2(self):
     sa = aes.init_state_array(
         aes.key_bv('3b59cb73fcd90ee05774222dc067fb68'))
     self.assertEqual(aes.state_str(aes.inv_sub_bytes(sa)),\
                      '4915598f55e5d7a0daca94fa1f0a63f7',\
                      "testing inv_sub_bytes from FIPS-197 C.1 round[4]")
Example #13
0
 def test_inv_sub_bytes_1(self):
     sa = aes.init_state_array(
         aes.key_bv('a761ca9b97be8b45d8ad1a611fc97369'))
     self.assertEqual(aes.state_str(aes.inv_sub_bytes(sa)),\
                      '89d810e8855ace682d1843d8cb128fe4',\
                      "testing inv_sub_bytes from FIPS-197 C.1 round[3]")
Example #14
0
 def test_inv_shift_rows_2(self):
     sa=aes.init_state_array(aes.key_bv('3bd92268fc74fb735767cbe0c0590e2d'))
     self.assertEqual(aes.state_str(aes.inv_shift_rows(sa)),\
                      '3b59cb73fcd90ee05774222dc067fb68',\
         "Test shift rows from FIPS-197 C.1 round[3]")
Example #15
0
 def test_inv_mix_columns_0(self):
     sa=aes.init_state_array(aes.key_bv('5f72641557f5bc92f7be3b291db9f91a'))
     self.assertEqual(aes.state_str(aes.inv_mix_columns(sa)),\
                      '6353e08c0960e104cd70b751bacad0e7',\
         "Test inv mix columns from FIPS-197 C.1 round[1]")
Example #16
0
 def test_inv_mix_columns_0(self):
     sa = aes.init_state_array(
         aes.key_bv('5f72641557f5bc92f7be3b291db9f91a'))
     self.assertEqual(aes.state_str(aes.inv_mix_columns(sa)),\
                      '6353e08c0960e104cd70b751bacad0e7',\
         "Test inv mix columns from FIPS-197 C.1 round[1]")
Example #17
0
 def test_inv_sub_bytes_2(self):
         sa=aes.init_state_array(aes.key_bv('3b59cb73fcd90ee05774222dc067fb68'))
         self.assertEqual(aes.state_str(aes.inv_sub_bytes(sa)),\
                          '4915598f55e5d7a0daca94fa1f0a63f7',\
                          "testing inv_sub_bytes from FIPS-197 C.1 round[4]")
Example #18
0
 def test_inv_mix_columns_3(self):
     sa=aes.init_state_array(aes.key_bv('6385b79ffc538df997be478e7547d691'))
     self.assertEqual(aes.state_str(aes.inv_mix_columns(sa)),\
                      '2d6d7ef03f33e334093602dd5bfb12c7',\
         "Test inv mix columns from FIPS-197 C.1 round[4]")
Example #19
0
 def test_inv_mix_columns_2(self):
     sa=aes.init_state_array(aes.key_bv('4c9c1e66f771f0762c3f868e534df256'))
     self.assertEqual(aes.state_str(aes.inv_mix_columns(sa)),\
                      '3bd92268fc74fb735767cbe0c0590e2d',\
         "Test inv mix columns from FIPS-197 C.1 round[3]")
Example #20
0
 def test_inv_mix_columns_1(self):
     sa=aes.init_state_array(aes.key_bv('ff87968431d86a51645151fa773ad009'))
     self.assertEqual(aes.state_str(aes.inv_mix_columns(sa)),\
                      'a7be1a6997ad739bd8c9ca451f618b61',\
         "Test inv mix columns from FIPS-197 C.1 round[2]")
Example #21
0
 def test_inv_shift_rows_2(self):
     sa = aes.init_state_array(
         aes.key_bv('3bd92268fc74fb735767cbe0c0590e2d'))
     self.assertEqual(aes.state_str(aes.inv_shift_rows(sa)),\
                      '3b59cb73fcd90ee05774222dc067fb68',\
         "Test shift rows from FIPS-197 C.1 round[3]")
Example #22
0
 def test_inv_mix_columns_2(self):
     sa = aes.init_state_array(
         aes.key_bv('4c9c1e66f771f0762c3f868e534df256'))
     self.assertEqual(aes.state_str(aes.inv_mix_columns(sa)),\
                      '3bd92268fc74fb735767cbe0c0590e2d',\
         "Test inv mix columns from FIPS-197 C.1 round[3]")
Example #23
0
 def test_inv_shift_rows_3(self):
     sa = aes.init_state_array(
         aes.key_bv('2d6d7ef03f33e334093602dd5bfb12c7'))
     self.assertEqual(aes.state_str(aes.inv_shift_rows(sa)),\
                      '2dfb02343f6d12dd09337ec75b36e3f0',\
         "Test shift rows from FIPS-197 C.1 round[4]")
Example #24
0
 def test_inv_shift_rows_3(self):
     sa=aes.init_state_array(aes.key_bv('2d6d7ef03f33e334093602dd5bfb12c7'))
     self.assertEqual(aes.state_str(aes.inv_shift_rows(sa)),\
                      '2dfb02343f6d12dd09337ec75b36e3f0',\
         "Test shift rows from FIPS-197 C.1 round[4]")
Example #25
0
 def test_inv_mix_columns_1(self):
     sa = aes.init_state_array(
         aes.key_bv('ff87968431d86a51645151fa773ad009'))
     self.assertEqual(aes.state_str(aes.inv_mix_columns(sa)),\
                      'a7be1a6997ad739bd8c9ca451f618b61',\
         "Test inv mix columns from FIPS-197 C.1 round[2]")
Example #26
0
 def test_inv_shift_rows_0(self):
     sa=aes.init_state_array(aes.key_bv('6353e08c0960e104cd70b751bacad0e7'))
     self.assertEqual(aes.state_str(aes.inv_shift_rows(sa)),\
                      '63cab7040953d051cd60e0e7ba70e18c',\
         "Test shift rows from FIPS-197 C.1 round[1]")
Example #27
0
 def test_inv_mix_columns_3(self):
     sa = aes.init_state_array(
         aes.key_bv('6385b79ffc538df997be478e7547d691'))
     self.assertEqual(aes.state_str(aes.inv_mix_columns(sa)),\
                      '2d6d7ef03f33e334093602dd5bfb12c7',\
         "Test inv mix columns from FIPS-197 C.1 round[4]")
Example #28
0
 def test_inv_shift_rows_1(self):
     sa=aes.init_state_array(aes.key_bv('a7be1a6997ad739bd8c9ca451f618b61'))
     self.assertEqual(aes.state_str(aes.inv_shift_rows(sa)),\
                      'a761ca9b97be8b45d8ad1a611fc97369',\
         "Test shift rows from FIPS-197 C.1 round[2]")
Example #29
0
 def test_inv_sub_bytes_1(self):
         sa=aes.init_state_array(aes.key_bv('a761ca9b97be8b45d8ad1a611fc97369'))
         self.assertEqual(aes.state_str(aes.inv_sub_bytes(sa)),\
                          '89d810e8855ace682d1843d8cb128fe4',\
                          "testing inv_sub_bytes from FIPS-197 C.1 round[3]")
Example #30
0
 def test_inv_sub_bytes_3(self):
         sa=aes.init_state_array(aes.key_bv('2dfb02343f6d12dd09337ec75b36e3f0'))
         self.assertEqual(aes.state_str(aes.inv_sub_bytes(sa)),\
                          'fa636a2825b339c940668a3157244d17',\
                          "testing inv_sub_bytes from FIPS-197 C.1 round[1]")
Example #31
0
 def test_inv_sub_bytes_0(self):
     sa = aes.init_state_array(
         aes.key_bv('63cab7040953d051cd60e0e7ba70e18c'))
     self.assertEqual(aes.state_str(aes.inv_sub_bytes(sa)),\
                      '00102030405060708090a0b0c0d0e0f0',\
                      "testing inv_sub_bytes from FIPS-197 C.1 round[2]")
Example #32
0
 def test_inv_sub_bytes_0(self):
     sa=aes.init_state_array(aes.key_bv('63cab7040953d051cd60e0e7ba70e18c'))
     self.assertEqual(aes.state_str(aes.inv_sub_bytes(sa)),\
                      '00102030405060708090a0b0c0d0e0f0',\
                      "testing inv_sub_bytes from FIPS-197 C.1 round[2]")