I insert trigger_high in /hardware/victims/firmeware/crypto/mbedTLS/library/rsa.c: line 509(function:mbedtls_rsa_private) to measure the power consumption of “T = (T1 - T2) * (Q^-1 mod P) mod P” and call this function in the /hardware/victims/firmware/simpleserial-rsa/simpleserial-rsa-arm.c.
That line is still in simpleserial_mbedtls_rsa_private(). Have you tried inserting the trigger_high() there instead and keeping the rest of the code the same as the original simpleserial_rsa?
Yes, it works!
And the reason why I don’t do that is because my experiment needs control the plaintext,but when I used the “mbedtls_rsa_pkcs1_encrypt” to encrypt and used the “simpleserial_mbedtls_rsa_private” to decrypt, I got wrong plaintext!
update:
Sorry!I have solved this problem. But I still don’t understand why it didn’t work in my original way.