# Path: oppy/crypto/util.py
# class UnrecognizedCell(Exception):
# def constantStrEqual(str1, str2):
# def constantStrAllZero(s):
# def makeAES128CTRCipher(key, initial_value=0):
# def makeHMACSHA256(msg, key):
# def _makePayloadWithDigest(payload, digest=EMPTY_DIGEST):
# def encryptCell(cell, crypt_path, early=False):
# def _cellRecognized(payload, relay_crypto):
# def decryptCell(cell, crypt_path):
# def verifyCertSig(id_cert, cert_to_verify, algo='sha1'):
# def validCertTime(cert):
#     DIGEST_START = 5
#     DIGEST_END = 9


import hashlib
import mock
import OpenSSL
            import hmac.compare_digest
            import hmac.compare_digest
            import hmac.compare_digest
            import hmac.compare_digest
from Crypto.Cipher import AES
from twisted.trial import unittest
from oppy.crypto import util





class CryptoUtilTest(unittest.TestCase):

    def setUp(self):
        pass

    def test_constantStrEqual_have_compare_digest(self):
        try:
        except ImportError:
            return

        str1 = 'test1'
        str2 = 'test2'
        with mock.patch('hmac.compare_digest', return_value='ret') as mock_cd:

# Path: oppy/crypto/util.py
# class UnrecognizedCell(Exception):
# def constantStrEqual(str1, str2):
# def constantStrAllZero(s):
# def makeAES128CTRCipher(key, initial_value=0):
# def makeHMACSHA256(msg, key):
# def _makePayloadWithDigest(payload, digest=EMPTY_DIGEST):
# def encryptCell(cell, crypt_path, early=False):
# def _cellRecognized(payload, relay_crypto):
# def decryptCell(cell, crypt_path):
# def verifyCertSig(id_cert, cert_to_verify, algo='sha1'):
# def validCertTime(cert):
#     DIGEST_START = 5
#     DIGEST_END = 9


# Path: oppy/tests/unit/crypto/test_util.py
import hashlib
import mock
import OpenSSL
            import hmac.compare_digest
            import hmac.compare_digest
            import hmac.compare_digest
            import hmac.compare_digest
from Crypto.Cipher import AES
from twisted.trial import unittest
from oppy.crypto import util






class CryptoUtilTest(unittest.TestCase):

    def setUp(self):
        pass

    def test_constantStrEqual_have_compare_digest(self):
        try:
        except ImportError:
            return

        str1 = 'test1'
        str2 = 'test2'
        with mock.patch('hmac.compare_digest', return_value='ret') as mock_cd:

            ret = util.constantStrEqual(str1, str2)