X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=blobdiff_plain;f=pygost%2Fgost3413.py;h=ec16f8c6b0903f73d78a3e4ee2602722d6973bc8;hp=5aeaec63ef415091ae3de81b64facb57e0af62bd;hb=5e92533267cb41c42af1243592c530304d18bff5;hpb=2bb1a163d32e4167e6904ff3c6b4cf64ea7287bb diff --git a/pygost/gost3413.py b/pygost/gost3413.py index 5aeaec6..ec16f8c 100644 --- a/pygost/gost3413.py +++ b/pygost/gost3413.py @@ -274,7 +274,7 @@ Rb128 = 0b10000111 def _mac_ks(encrypter, bs): Rb = Rb128 if bs == 16 else Rb64 - _l = encrypter(bs * b'\x00') + _l = encrypter(bs * b"\x00") k1 = _mac_shift(bs, _l, Rb) if bytearray(_l)[0] & 0x80 > 0 else _mac_shift(bs, _l) k2 = _mac_shift(bs, k1, Rb) if bytearray(k1)[0] & 0x80 > 0 else _mac_shift(bs, k1) return k1, k2 @@ -294,7 +294,7 @@ def mac(encrypter, bs, data): tail_offset = len(data) - bs else: tail_offset = len(data) - (len(data) % bs) - prev = bs * b'\x00' + prev = bs * b"\x00" for i in xrange(0, tail_offset, bs): prev = encrypter(strxor(data[i:i + bs], prev)) tail = data[tail_offset:] @@ -337,7 +337,7 @@ def mac_acpkm_master(algo_class, encrypter, key_section_size, section_size, bs, tail_offset = len(data) - bs else: tail_offset = len(data) - (len(data) % bs) - prev = bs * b'\x00' + prev = bs * b"\x00" sections = len(data) // section_size if len(data) % section_size != 0: sections += 1