# Path: pgp/crc24.py
# def crc24(data):
#     result = CRC_24_INITIALIZATION
#     for byte in data:
#         index = ((result >> 16) ^ byte) & 0xff
#         result = (CRC_24_TABLE[index] ^ (result << 8)) & 0x00ffffff
#     return result


from base64 import b64decode
from base64 import b64encode
from pgp.crc24 import crc24
import math
import re
import warnings
            elif header_key == 'Hash':
                hash_algorithms = header_value
            elif header_key == 'Charset':
                charset = header_value
            else:
                # "Unknown keys should be reported to the user, but OpenPGP
                #  should continue to process the message."
                warnings.warn('Unsupported armor header, "{0}"'.format(
                                header_key))
                extra_headers[header_key] = header_value
            line_no += 1

        # blank line
        line_no += 1

        data_lines = []

        while lines[line_no][:1] != '=':
            data_lines.append(lines[line_no])
            line_no += 1

        data = b64decode(''.join(data_lines))
        checksum_data = b64decode(lines[line_no][1:])
        expected_checksum = (
            ((checksum_data[0] << 16)) +
            ((checksum_data[1] << 8)) +
            checksum_data[2]
            )
        line_no += 1


# Path: pgp/crc24.py
# def crc24(data):
#     result = CRC_24_INITIALIZATION
#     for byte in data:
#         index = ((result >> 16) ^ byte) & 0xff
#         result = (CRC_24_TABLE[index] ^ (result << 8)) & 0x00ffffff
#     return result


# Path: pgp/armor.py
from base64 import b64decode
from base64 import b64encode
from pgp.crc24 import crc24
import math
import re
import warnings

            elif header_key == 'Hash':
                hash_algorithms = header_value
            elif header_key == 'Charset':
                charset = header_value
            else:
                # "Unknown keys should be reported to the user, but OpenPGP
                #  should continue to process the message."
                warnings.warn('Unsupported armor header, "{0}"'.format(
                                header_key))
                extra_headers[header_key] = header_value
            line_no += 1

        # blank line
        line_no += 1

        data_lines = []

        while lines[line_no][:1] != '=':
            data_lines.append(lines[line_no])
            line_no += 1

        data = b64decode(''.join(data_lines))
        checksum_data = b64decode(lines[line_no][1:])
        expected_checksum = (
            ((checksum_data[0] << 16)) +
            ((checksum_data[1] << 8)) +
            checksum_data[2]
            )
        line_no += 1


        actual_checksum = crc24(data)