Crypto AES Driver

Hi,

I am working on a S3A7 project with aes crypto. I am working on SSP 1.6.0 and e2 Studio 7.5.0.

I have configured it like this:

When I initialize the cryptographic driver it doesn't return from the function and it gets stuck.

In this function it stops: err = g_sce.p_api->open(g_sce.p_ctrl, g_sce.p_cfg);
This is my code:

err = g_sce.p_api->statusGet(&cryptoStatus);
if(cryptoStatus == CRYPTO_SCE_COMMON_MODULE_CLOSED)
{
err = g_sce.p_api->open(g_sce.p_ctrl, g_sce.p_cfg);
}
err = g_sce_aes_0.p_api->open(g_sce_aes_0.p_ctrl, g_sce_aes_0.p_cfg);

err = g_sce_aes_0.p_api->encrypt( g_sce_aes_0.p_ctrl, key, init_enc, new_message_len, (uint32_t*) data, (uint32_t*) msg_enc );

err = g_sce_aes_0.p_api->close(g_sce_aes_0.p_ctrl);
err = g_sce.p_api->close(g_sce.p_ctrl);

I have also read this document: SCE HAL Module Guide - Application Project.

I don't know what is causing the problem.

Thanks for the help.

  • Hi,

    You are calling SCE crypto API - statusGet() - before opening the driver. Try opening the driver as the first API call.

    Ian.

  • Hi, 

    That doesn't work either:

    err = g_sce.p_api->open(g_sce.p_ctrl, g_sce.p_cfg);
    err = g_sce_aes_0.p_api->open(g_sce_aes_0.p_ctrl, g_sce_aes_0.p_cfg);
    err = g_sce_aes_0.p_api->encrypt( g_sce_aes_0.p_ctrl, key, init_enc, new_message_len, (uint32_t*) data, (uint32_t*) msg_enc );
    err = g_sce_aes_0.p_api->close(g_sce_aes_0.p_ctrl);
    err = g_sce.p_api->close(g_sce.p_ctrl);

    I have also tried putting  err = R_SCE_Open(g_sce.p_ctrl, g_sce.p_cfg); with the same result.

    The g_sce configuration is this:

    could it be memory problem?

  • It was not opening the controller in the startup process and that caused the failure.
    I have already solved.

    Thanks.