Changeset View
Changeset View
Standalone View
Standalone View
head/sys/opencrypto/cast.c
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | u_int32_t t, l, r; | ||||
outblock[7] = U_INT8_Td(r); | outblock[7] = U_INT8_Td(r); | ||||
/* Wipe clean */ | /* Wipe clean */ | ||||
t = l = r = 0; | t = l = r = 0; | ||||
} | } | ||||
/***** Key Schedule *****/ | /***** Key Schedule *****/ | ||||
void cast_setkey(cast_key* key, u_int8_t* rawkey, int keybytes) | void cast_setkey(cast_key* key, const u_int8_t* rawkey, int keybytes) | ||||
{ | { | ||||
u_int32_t t[4] = {0, 0, 0, 0}, z[4] = {0, 0, 0, 0}, x[4]; | u_int32_t t[4] = {0, 0, 0, 0}, z[4] = {0, 0, 0, 0}, x[4]; | ||||
int i; | int i; | ||||
/* Set number of rounds to 12 or 16, depending on key length */ | /* Set number of rounds to 12 or 16, depending on key length */ | ||||
key->rounds = (keybytes <= 10 ? 12 : 16); | key->rounds = (keybytes <= 10 ? 12 : 16); | ||||
/* Copy key to workspace x */ | /* Copy key to workspace x */ | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |