continued reorganisation

This commit is contained in:
Emile Clark-Boman 2025-06-21 21:29:00 +10:00
parent 6f8a7322f2
commit 0a2d9a5694
22 changed files with 190 additions and 61 deletions

View file

@ -0,0 +1,18 @@
'''
This file provides various "disint" (display internal) methods
regarding the "constituent functions" that exist in "bcrypt".
'''
from bcrypt.lib.format import lpad, lpadbin
'''
Display internal calculations of Rb(b: int) for bcrypt/hashrev.py
'''
def disint_Rb(b: int):
Rb = 0
for j in range(8):
j_sq = j**2
Rjb = b << j_sq
Rb ^= Rjb
print(f'{lpad(j_sq, 2)}: {lpadbin(Rjb, 64)} {Rjb}')
print(f'Rb: {lpadbin(Rb, 64)} {Rb}')