Closed JohnChain closed 2 years ago
I change the achipher na code as bellow, and I find the two time "Encrypted buffer:" printed is different.
Likely due to pkcs#1 v1.5 padding. See these post: why-does-adding-pkcs1-v1-5-padding-make-rsa-encryption-non-deterministic whats-so-special-about-pkcs-1-v1-5-and-the-attack-that-just-won-t-go-away.
And in the original code, why will you call TEEC_InvokeCommand twice ? Is the first one for getting output buffer size ?
Yes.
@etienne-lms thanks and you are right. After changing the algr from TEE_ALG_RSAES_PKCS1_V1_5 to TEE_ALG_RSA_NOPAD in TA side, I can get the same output now :)
I change the achipher na code as bellow, and I find the two time "Encrypted buffer:" printed is different.
And in the original code, why will you call TEEC_InvokeCommand twice ? Is the first one for getting output buffer size ?
print info: