MCPcopy Create free account
hub / github.com/apache/nuttx / cipher_init

Function cipher_init

tools/cxd56/clefia.c:392–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390 ****************************************************************************/
391
392struct cipher *cipher_init(uint8_t * key, uint8_t * iv)
393{
394 struct cipher *c;
395
396 c = malloc(sizeof(*c));
397 if (!c)
398 {
399 return NULL;
400 }
401
402 c->round = clefiakeyset(c->rk, key);
403
404 gen_subkey(c);
405 memset(c->vector, 0, 16);
406
407 return c;
408}
409
410void cipher_deinit(struct cipher *c)
411{

Callers 1

mainFunction · 0.85

Calls 4

clefiakeysetFunction · 0.85
gen_subkeyFunction · 0.85
mallocFunction · 0.50
memsetFunction · 0.50

Tested by

no test coverage detected