# Path: kale/crypt.py
# BLOCK_SIZE = 16
# def _set_cipher():
# def encrypt(msg):
# def decrypt(msg):
# def urlsafe_encrypt(msg):
# def hex_encrypt(msg):
# def hex_decrypt(msg):
# def urlsafe_decrypt(msg):
# def _pad(msg):
# def _get_padding_bytes(msg_length):
# def _unpad(msg):
# class CryptException(Exception):


import unittest
from kale import crypt
# -*- coding: utf-8 -*-


__author__ = 'Aaron Webber (aaron@nextdoor.com)'


class Crypt2Test(unittest.TestCase):

    def setUp(self):
        self.msgs_encrypt = [
            (b'12345', 'hU6aBS2mJgr0DUrUiHQouA=='),
            (b'adasdfasdfasdfasdf', 'Y/VR7vs4e2arRx8C6EBGxZanBnCrxVik3257tMlqomM='),
            (b'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
             'C9pEG6g8ge76xt2q9XLbpwvaRBuoPIHu+sbdqvVy26ccNo37r4pWAD/7HiC77bI+'),
            (b's', 'gPm/2E+m/YMX16Yxg81wqA=='),
            (b'', '1lcHEDp3HufBy14CHkSlVw=='),
            (b'1616161616161616', 'wqx+H/v7iFtW7acYb9QoQ9ZXBxA6dx7nwcteAh5EpVc='),
            (b'\x8a\x004\xaf\xff', 'cVz2i16U1c3ztu2GwMhtvg=='),
            (b'\xff\xfe\xfa\xee\x014\xab\xff\xfe\xfa\xee\x014\xab\xff\xfe\xfa\xee\x014\xab',
             'I6XMloWUi3GQwjq5kP15Z3EI+LIV3Ygsda2FiSIgtM8='),
            (b'\xe9\x80\x99\xe6\x98\xaf\xe4\xb8\x80\xe5\x80\x8bUnicode\xe6\xb8\xac\xe8\xa9\xa6',
             'XwjwdL+rHdD6pHr/eUckPJUC7jBbc0LUr8g7f7FffBI='),
            (b'\x00\x00\x00\x00\x00\x00\x00', '/b/++aGOO0Kj2e2+YWadsQ==')
        ]

    @property
    def msgs(self):
        return [x[0] for x in self.msgs_encrypt]

    def test_get_padding_bytes(self):

# Path: kale/crypt.py
# BLOCK_SIZE = 16
# def _set_cipher():
# def encrypt(msg):
# def decrypt(msg):
# def urlsafe_encrypt(msg):
# def hex_encrypt(msg):
# def hex_decrypt(msg):
# def urlsafe_decrypt(msg):
# def _pad(msg):
# def _get_padding_bytes(msg_length):
# def _unpad(msg):
# class CryptException(Exception):


# Path: kale/tests/test_crypt.py
import unittest
from kale import crypt

# -*- coding: utf-8 -*-


__author__ = 'Aaron Webber (aaron@nextdoor.com)'


class Crypt2Test(unittest.TestCase):

    def setUp(self):
        self.msgs_encrypt = [
            (b'12345', 'hU6aBS2mJgr0DUrUiHQouA=='),
            (b'adasdfasdfasdfasdf', 'Y/VR7vs4e2arRx8C6EBGxZanBnCrxVik3257tMlqomM='),
            (b'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
             'C9pEG6g8ge76xt2q9XLbpwvaRBuoPIHu+sbdqvVy26ccNo37r4pWAD/7HiC77bI+'),
            (b's', 'gPm/2E+m/YMX16Yxg81wqA=='),
            (b'', '1lcHEDp3HufBy14CHkSlVw=='),
            (b'1616161616161616', 'wqx+H/v7iFtW7acYb9QoQ9ZXBxA6dx7nwcteAh5EpVc='),
            (b'\x8a\x004\xaf\xff', 'cVz2i16U1c3ztu2GwMhtvg=='),
            (b'\xff\xfe\xfa\xee\x014\xab\xff\xfe\xfa\xee\x014\xab\xff\xfe\xfa\xee\x014\xab',
             'I6XMloWUi3GQwjq5kP15Z3EI+LIV3Ygsda2FiSIgtM8='),
            (b'\xe9\x80\x99\xe6\x98\xaf\xe4\xb8\x80\xe5\x80\x8bUnicode\xe6\xb8\xac\xe8\xa9\xa6',
             'XwjwdL+rHdD6pHr/eUckPJUC7jBbc0LUr8g7f7FffBI='),
            (b'\x00\x00\x00\x00\x00\x00\x00', '/b/++aGOO0Kj2e2+YWadsQ==')
        ]

    @property
    def msgs(self):
        return [x[0] for x in self.msgs_encrypt]

    def test_get_padding_bytes(self):

        padding_bytes = crypt._get_padding_bytes(3)