Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Why RTM is failing constantly?

Alam__Shariful
New Contributor I
1,140 Views

I'm new in using Intel-TSX. So, please correct me on any terminological/conceptional mistake.

I'm trying to write a custom rsa engine using a polarssl library from here. I have the following code,

 

result=-1;
unsigned block;

int key_len= 128;

while(result!=1){
    if ((block = _xbegin()) == _XBEGIN_STARTED) {
        if( rsa_pkcs1_decrypt( &rsa_polar, &myrand, NULL, RSA_PRIVATE, &key_len, from, decrypt_plaintext, sizeof(decrypt_plaintext) ) != 0 )
            exit(0);
        result=1;
        _xend();
    }else{
        printf("RTM 2: Transaction failed\n");
        printf("status is %ld\n", block);
       
    }
    printf("Block 2: Result is %d\n", result);
}


The code inside the rtm block doesn't work. However, the same code works outside rtm block. Upon running the code I'm getting the following output,
.
.
RTM 2: Transaction failed
status is 0
Block 2: Result is -1
. 
. 
0 Kudos
0 Replies
Reply