MCPcopy Create free account
hub / github.com/F-Stack/f-stack / prepare_key

Function prepare_key

dpdk/drivers/crypto/ccp/ccp_crypto.c:585–597  ·  view source on GitHub ↗

prepare temporary keys K1 and K2 */

Source from the content-addressed store, hash-verified

583
584/* prepare temporary keys K1 and K2 */
585static void prepare_key(unsigned char *k, unsigned char *l, int bl)
586{
587 int i;
588 /* Shift block to left, including carry */
589 for (i = 0; i < bl; i++) {
590 k[i] = l[i] << 1;
591 if (i < bl - 1 && l[i + 1] & 0x80)
592 k[i] |= 1;
593 }
594 /* If MSB set fixup with R */
595 if (l[0] & 0x80)
596 k[bl - 1] ^= bl == 16 ? 0x87 : 0x1b;
597}
598
599/* subkeys K1 and K2 generation for CMAC */
600static int

Callers 1

generate_cmac_subkeysFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected