Lines Matching refs:rounds
36 def mksalt(method=None, *, rounds=None):
44 if rounds is not None and not isinstance(rounds, int):
45 raise TypeError(f'{rounds.__class__.__name__} object cannot be '
53 if rounds is None:
56 log_rounds = int.bit_length(rounds-1)
57 if rounds != 1 << log_rounds:
58 raise ValueError('rounds must be a power of 2')
60 raise ValueError('rounds out of the range 2**4 to 2**31')
63 if rounds is not None:
64 if not 1000 <= rounds <= 999_999_999:
65 raise ValueError('rounds out of the range 1000 to 999_999_999')
66 s += f'rounds={rounds}$'
67 elif rounds is not None:
68 raise ValueError(f"{method} doesn't support the rounds argument")
92 def _add_method(name, *args, rounds=None):
95 salt = mksalt(method, rounds=rounds)
118 if _add_method('BLOWFISH', '2' + _v, 22, 59 + len(_v), rounds=1<<4):