示例#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)
示例#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)
示例#3
0
 def cipher_ctx_init(self):
     """
     Nonce + 1
     :return: None
     """
     AeadCryptoBase.nonce_increment(self)
示例#4
0
 def cipher_ctx_init(self):
     """
     Nonce + 1
     :return: None
     """
     AeadCryptoBase.nonce_increment(self)