It is mentioned in the document that loading the secret key is to first calculate M1~M5, and then call the interface to load the secret key. M4_out and M5_out will be returned. By comparing M4, M5 and M4_out M5_out, If both are consistent, it indicates that the key has been successfully loaded, otherwise the loading fails. I found in actual testing that the loading interface returns 0, but M4, M5, M4_out, and M5_out are quite inconsistent. Is this considered a successful or failed loading?
解決済! 解決策の投稿を見る。
Yes, I made a mistake before and printed their addresses, so the values are different. Modify to print numerical values, their values are the same. thank you
CSEc always uses UID when calculating M4 and M5 values which are returned after loading a key. It's given by SHE specification - it says that UID should be used for M4 and M5 calculation. It does not talk about wildcard in case of this functionality. This behavior cannot be changed. 
So, if you used attribute WILDCARD = 0 when calculating M1-M5 values, the M4 and M5 will be really different. 
If 0 was returned, the key was loaded. If you want to double checked that also by comparing M4 and M5, it would be necessary to use UID.
Regards,
Lukas
As shown in the figure below, when I set WILDCARD to 1 and plug it into the calculation interface, the M4 and M4_out, M5 and M5_out obtained are still different. How do I configure them to make them the same?
There's one more option. Please take a look at code examples in application note AN5401.
In calculate_M1_to_M5() function, wildcard and UID=0 is used for M1-M3 calculation. However, M4 and M5 is calculated with UID:
The result is that M4-M5 values are the same after key load even if wildcard is used:
Regards,
Lukas
Yes, I made a mistake before and printed their addresses, so the values are different. Modify to print numerical values, their values are the same. thank you