How can i put trigger_high into the mbedTLS?

Sorry to ask a stupid question, but I spend nuch time ti figure this problem and always failed.

When I put the trigger_high and #include “hal.h” into rsa.c, it seems something error when exeute in the chip?

Why this happened, and how should I do?
Thank you very much!

Hi,

Can you post some code where you’re inserting the trigger_high call?

Alex

Hi Alex,

Thank you very much!

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.

luffy

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?

Alex

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.