Explorar o código

cosmetic: move some lines

Thomas Waldmann %!s(int64=7) %!d(string=hai) anos
pai
achega
e7228fa3a4
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/borg/crypto/low_level.pyx

+ 3 - 3
src/borg/crypto/low_level.pyx

@@ -373,9 +373,9 @@ cdef class AES256_CTR_BASE:
         if isinstance(iv, int):
             iv = iv.to_bytes(self.iv_len, byteorder='big')
         assert isinstance(iv, bytes) and len(iv) == self.iv_len
-        self.blocks = 0  # how many AES blocks got encrypted with this IV?
         for i in range(self.iv_len):
             self.iv[i] = iv[i]
+        self.blocks = 0  # how many AES blocks got encrypted with this IV?
 
     def next_iv(self):
         # call this after encrypt() to get the next iv (int) for the next encrypt() call
@@ -645,9 +645,9 @@ cdef class _AEAD_BASE:
         if isinstance(iv, int):
             iv = iv.to_bytes(self.iv_len, byteorder='big')
         assert isinstance(iv, bytes) and len(iv) == self.iv_len
-        self.blocks = 0  # number of cipher blocks encrypted with this IV
         for i in range(self.iv_len):
             self.iv[i] = iv[i]
+        self.blocks = 0  # number of cipher blocks encrypted with this IV
 
     def next_iv(self):
         # call this after encrypt() to get the next iv (int) for the next encrypt() call
@@ -809,9 +809,9 @@ cdef class AES:
         if isinstance(iv, int):
             iv = iv.to_bytes(self.iv_len, byteorder='big')
         assert isinstance(iv, bytes) and len(iv) == self.iv_len
-        self.blocks = 0  # number of cipher blocks encrypted with this IV
         for i in range(self.iv_len):
             self.iv[i] = iv[i]
+        self.blocks = 0  # number of cipher blocks encrypted with this IV
 
     def next_iv(self):
         # call this after encrypt() to get the next iv (int) for the next encrypt() call