Ejemplo n.º 1
0
    def cipher_ctx_init(self):
        """
        Need init cipher context after EVP_CipherFinal_ex to reuse context
        :return: None
        """
        iv_ptr = c_char_p(self._nonce.raw)
        r = libcrypto.EVP_CipherInit_ex(self._ctx, None, None, None, iv_ptr,
                                        c_int(CIPHER_ENC_UNCHANGED))
        if not r:
            self.clean()
            raise Exception('can not initialize cipher context')

        AeadCryptoBase.nonce_increment(self)
Ejemplo n.º 2
0
    def cipher_ctx_init(self):
        """
        Need init cipher context after EVP_CipherFinal_ex to reuse context
        :return: None
        """
        iv_ptr = c_char_p(self._nonce.raw)
        r = libcrypto.EVP_CipherInit_ex(
            self._ctx,
            None,
            None,
            None, iv_ptr,
            c_int(CIPHER_ENC_UNCHANGED)
        )
        if not r:
            self.clean()
            raise Exception('can not initialize cipher context')

        AeadCryptoBase.nonce_increment(self)
Ejemplo n.º 3
0
 def cipher_ctx_init(self):
     """
     Nonce + 1
     :return: None
     """
     AeadCryptoBase.nonce_increment(self)
Ejemplo n.º 4
0
 def cipher_ctx_init(self):
     """
     Nonce + 1
     :return: None
     """
     AeadCryptoBase.nonce_increment(self)