ó 9(Zc@sJdZddlZddlZddlmZejeƒZd„ZdS(s#Contains data key helper functions.iÿÿÿÿN(tdefault_backendc Csm|}|jdk ri|jd|jƒd|jdddtjd|j|ƒdtƒƒj|ƒ}n|S(sJDerives the data encryption key using the defined algorithm. :param bytes source_key: Raw source key :param algorithm: Algorithm used to encrypt this body :type algorithm: aws_encryption_sdk.identifiers.Algorithm :param bytes message_id: Message ID :returns: Derived data encryption key :rtype: bytes t algorithmtlengthtsalttinfos>H16stbackendN( tkdf_typetNonet kdf_hash_typet data_key_lentstructtpackt algorithm_idRtderive(t source_keyRt message_idtkey((sX/tmp/pip-build-wDUJoH/aws-encryption-sdk/aws_encryption_sdk/internal/crypto/data_keys.pytderive_data_encryption_keys      ( t__doc__tloggingR tcryptography.hazmat.backendsRt getLoggert__name__t_LOGGERR(((sX/tmp/pip-build-wDUJoH/aws-encryption-sdk/aws_encryption_sdk/internal/crypto/data_keys.pyt s