OK, I'll print out the algorithm from a crypto site, and see if I can follow your code
to find the error.
I'll work on this after dinner tonight, but probably will not have an answer until tomorrow.
One suggestion. I don't don't know if you use an IDE for editing your code, but if so and
it has a debugger, you can run your code step by step, watching selected variables as they change.
I use PyCharm and it has a very good debugger. Most IDE's do.
By the way, your code is very neat and well organized,
perhaps you have found your career.
to find the error.
I'll work on this after dinner tonight, but probably will not have an answer until tomorrow.
One suggestion. I don't don't know if you use an IDE for editing your code, but if so and
it has a debugger, you can run your code step by step, watching selected variables as they change.
I use PyCharm and it has a very good debugger. Most IDE's do.
By the way, your code is very neat and well organized,
perhaps you have found your career.