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

the DFStart function may has two lines of code implementation that may be incorrect #103

Open
magickli1 opened this issue Nov 1, 2023 · 0 comments

Comments

@magickli1
Copy link

magickli1 commented Nov 1, 2023

Hi ,I feel that the DFStart function has two lines of code implementation that may be wrong, the following shows the code

memcpy(&dfState->iv[0], init, 8);

dfState->contents = 4;

I think the destination parameter of the memcpy function should be dfState->buf, not dfState->iv[0], because the init variable stores inputLength and seedsize. If you copy it to dfState->iv[0], the initial value of dfState->iv[0] will be overwritten. According to the description in step 4 in section 10.3.2 in SP800-90A, the value should be stored in dfState->buf and used as the input parameter of the BCC calculation. In addition, memcpy contains 8 bytes.,so I think dfState->content should be equal to 8, not equal to 4 in the source code.is it a historical error or the current implementation is designed in this way?

In addition, part 4 of the TPM library specification implements only part of Block_Cipher_df (I think steps 10-15 are missing). I would like to ask why the complete DF function is not implemented according to section 10.3.2 (Block_Cipher_df) in SP800-90A.

@magickli1 magickli1 changed the title The DFStart code may be incorrect the DFStart function may has two lines of code implementation that may be incorrect Nov 1, 2023
@magickli1 magickli1 reopened this Nov 1, 2023
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