continued reorganisation
This commit is contained in:
parent
6f8a7322f2
commit
0a2d9a5694
22 changed files with 190 additions and 61 deletions
18
bcrypter/debug/constituents.py
Normal file
18
bcrypter/debug/constituents.py
Normal 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}')
|
||||
Loading…
Add table
Add a link
Reference in a new issue