Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SHA1 & MD5 update functions #1

Open
emoose opened this issue Aug 10, 2019 · 0 comments
Open

Improve SHA1 & MD5 update functions #1

emoose opened this issue Aug 10, 2019 · 0 comments

Comments

@emoose
Copy link
Owner

emoose commented Aug 10, 2019

(SHA1 & MD5 both seem to be able to use the same update code, since the block size for both is 64 bytes, only the transform algorithm is different between them)

Right now the ExCryptShaUpdate function code is a little bit dumb, handling inputs one byte at a time, which slows things down immensely.

XeCryptShaUpdate on the other hand uses much more optimised code, checking against the input size to see if the input could be memcpy'd directly, etc. Probably worth trying to reverse this and replacing our update function with it.

Once the Update function is more optimised it might be worth looking into using "Intel SHA Extensions" to get even more out of it.

E: It seems ShaUpdate currently isn't updating the SHA_STATE properly after being ran neither, ditto for ShaFinal IIRC. It might be worth disassembling the actual XeCrypt functions and using those instead of a third-party lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant