���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /lib64/python2.7/site-packages/cryptography/hazmat/backends/openssl/ |
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import six from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric.utils import Prehashed def _truncate_digest(digest, order_bits): digest_len = len(digest) if 8 * digest_len > order_bits: digest_len = (order_bits + 7) // 8 digest = digest[:digest_len] if 8 * digest_len > order_bits: rshift = 8 - (order_bits & 0x7) assert 0 < rshift < 8 mask = 0xFF >> rshift << rshift # Set the bottom rshift bits to 0 digest = digest[:-1] + six.int2byte(six.indexbytes(digest, -1) & mask) return digest def _calculate_digest_and_algorithm(backend, data, algorithm): if not isinstance(algorithm, Prehashed): hash_ctx = hashes.Hash(algorithm, backend) hash_ctx.update(data) data = hash_ctx.finalize() else: algorithm = algorithm._algorithm if len(data) != algorithm.digest_size: raise ValueError( "The provided data must be the same length as the hash " "algorithm's digest size." ) return (data, algorithm)