# coding: utf-8
# PyGOST -- Pure Python GOST cryptographic functions library
-# Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
+# Copyright (C) 2015-2018 Sergey Matveev <stargrave@stargrave.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
:type kek: bytes, 32 bytes
:param cek: content encryption key
:type cek: bytes, 32 bytes
- :return: wrapped key
+ :returns: wrapped key
:rtype: bytes, 44 bytes
"""
cek_mac = MAC(kek, data=cek, iv=ukm).digest()[:4]
:type kek: bytes, 32 bytes
:param data: wrapped key
:type data: bytes, 44 bytes
- :return: unwrapped CEK
+ :returns: unwrapped CEK
:rtype: 32 bytes
"""
if len(data) != 44:
:type kek: bytes, 32 bytes
:param cek: content encryption key
:type cek: bytes, 32 bytes
- :return: wrapped key
+ :returns: wrapped key
:rtype: bytes, 44 bytes
"""
return wrap_gost(ukm, diversify(kek, bytearray(ukm)), cek)
:type kek: bytes, 32 bytes
:param data: wrapped key
:type data: bytes, 44 bytes
- :return: unwrapped CEK
+ :returns: unwrapped CEK
:rtype: 32 bytes
"""
if len(data) < 8: