-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
memcpy rather than loop? #39
Comments
Hi Michael, Thanks for the kinds words :) I appreciate your interest in my project. Your guess is correct, it is to save a function call and avoid the dependency on memcpy. |
Very interesting :D , I do love it how you can start to refine C down so much to save on ASM instructions! I have never had to work in an embedded environment but I still love to worry about each byte and instruction being pointlessly wasted. |
The project started out because I needed the algorithm but didn't have enough space for what I could download on the web :) There are smaller implementations, which I haven't had the time to review. |
Hey,
Great bit of code, should save me from using openssl (hopefully)! Just curious, on this section what made you use a loop rather than just memcpy(output,input,KEYLEN) ?:
static void BlockCopy(uint8_t* output, uint8_t* input) { uint8_t i; for (i=0;i<KEYLEN;++i) { output[i] = input[i]; } }
Of course memcpy itself is a call and then another loop but it might on some computers/compilers it might be more optimised then byte by byte copying
The text was updated successfully, but these errors were encountered: