My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
crypto_task.c File Reference
#include <monitor.h>
#include <sw_debug.h>
#include <cpu_data.h>
#include <global.h>
#include <task.h>
#include <page_table.h>
#include <sw_string_functions.h>
#include <sw_mem_functions.h>
#include <sw_buddy.h>
#include <otz_id.h>
#include <otz_common.h>
#include <cpu.h>
#include <task_control.h>
#include <crypto_task.h>
#include <crypto_tests.h>
#include <otz_app_eg.h>
#include "otz_tee_crypto_api.h"
#include "sw_types.h"

Functions

int otzone_rc4_algorithm (char *input_buf, int input_len, char *output_buf, int *output_len)
 the function to encode and decode a buffer using rc4 algorithm. The output buffer has to be atleast the same length as the input buffer. Expect segmentation faults if not. More...
 
void process_otz_crypto_load_libs ()
 Adds all digest and encryption algorithms to internal table. More...
 
void process_otz_crypto_unload_libs ()
 Removes all ciphers and digests from the table. More...
 
void crypto_task (int task_id, sw_tls *tls)
 MD5 and SHA Algorithm tests. More...
 
int crypto_task_init (sa_config_t *psa_config)
 : Crypto task init More...
 
int crypto_task_exit (void *data)
 Crypto task exit. More...
 

Function Documentation

void crypto_task ( int  task_id,
sw_tls tls 
)

MD5 and SHA Algorithm tests.

Crypto task entry point.

Parameters
req_buf
req_buf_len
res_buf
res_buf_len
meta_data
ret_res_buf_len
svc_cmd_id
Returns
HMAC algorithm tests
Parameters
req_buf
req_buf_len
res_buf
res_buf_len
meta_data
ret_res_buf_len
svc_cmd_id
Returns
Cipher algorithm tests
Parameters
req_buf
req_buf_len
res_buf
res_buf_len
meta_data
ret_res_buf_len
svc_cmd_id
Returns
Process crypto service

This function process the crypto service commands

Parameters
svc_cmd_idCommand identifer to process the crypto service command
req_bufVirtual address of the request buffer
req_buf_lenRequest buffer length
resp_bufVirtual address of the response buffer
res_buf_lenResponse buffer length
meta_dataVirtual address of the meta data of the encoded data
ret_res_buf_lenReturn length of the response buffer
Returns
SMC return codes: SMC_SUCCESS: Crypto service command processed successfully.
SMC_*: An implementation-defined error code for any other error. Crypto task entry point

This function implements the processing of crypto commands

Parameters
task_id- task identifier
tls- Pointer to task local storage
int crypto_task_exit ( void *  data)

Crypto task exit.

This function gets called before the task deletion

Parameters
dataPrivate data which need to be freed.
Returns
otz_return_t: OTZ_OK
OTZ_FAIL
int crypto_task_init ( sa_config_t psa_config)

: Crypto task init

This function initializes crypto task parameters

Parameters
psa_configConfiguration parameter for the task and its get called before the task creation
Returns
otz_return_t: OTZ_OK
OTZ_* - An implementation-defined error code for any other error.
int otzone_rc4_algorithm ( char *  input_buf,
int  input_len,
char *  output_buf,
int *  output_len 
)

the function to encode and decode a buffer using rc4 algorithm. The output buffer has to be atleast the same length as the input buffer. Expect segmentation faults if not.

Parameters
input_buf
input_len
output_buf
output_len
Returns
Parameters
input_bufthe input buffer that needs to be converted
input_lenthe length of the input buffer
output_bufthe output buffer into which the data needs to be filled. The size has to be atleast the same size as the input buffer.
output_lenthe length of the converted data
Returns
0 if successful. No other return values are expected for now
void process_otz_crypto_load_libs ( )

Adds all digest and encryption algorithms to internal table.

void process_otz_crypto_unload_libs ( )

Removes all ciphers and digests from the table.