obj = rx_SecurityObjectOf(conn);
tp = (struct rxkad_cprivate *)obj->privateData;
- LOCK_RXKAD_STATS rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] +=
- len;
- UNLOCK_RXKAD_STATS memcpy((void *)xor, (void *)ivec, sizeof(xor));
+ LOCK_RXKAD_STATS;
+ rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] += len;
+ UNLOCK_RXKAD_STATS;
+ memcpy((void *)xor, (void *)ivec, sizeof(xor));
for (i = 0; len; i++) {
data = rx_data(packet, i, tlen);
if (!data || !tlen)
obj = rx_SecurityObjectOf(conn);
tp = (struct rxkad_cprivate *)obj->privateData;
- LOCK_RXKAD_STATS rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] +=
- len;
- UNLOCK_RXKAD_STATS
- /*
- * afs_int32 cksum;
- * cksum = htonl(0);
- * * Future option to add cksum here, but for now we just put 0
- */
- rx_PutInt32(packet, 1 * sizeof(afs_int32), 0);
+ LOCK_RXKAD_STATS;
+ rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] += len;
+ UNLOCK_RXKAD_STATS;
+ /*
+ * afs_int32 cksum;
+ * cksum = htonl(0);
+ * * Future option to add cksum here, but for now we just put 0
+ */
+ rx_PutInt32(packet, 1 * sizeof(afs_int32), 0);
memcpy((void *)xor, (void *)ivec, sizeof(xor));
for (i = 0; len; i++) {
kword[1] = (kword[1] >> 11) | (temp << (56 - 32 - 11));
schedule[i] = kword[0];
}
- LOCK_RXKAD_STATS rxkad_stats.fc_key_scheds++;
- UNLOCK_RXKAD_STATS return 0;
+ LOCK_RXKAD_STATS;
+ rxkad_stats.fc_key_scheds++;
+ UNLOCK_RXKAD_STATS;
+ return 0;
}
/* IN int encrypt; * 0 ==> decrypt, else encrypt */
#endif
if (encrypt) {
- LOCK_RXKAD_STATS rxkad_stats.fc_encrypts[ENCRYPT]++;
- UNLOCK_RXKAD_STATS for (i = 0; i < (ROUNDS / 2); i++) {
+ LOCK_RXKAD_STATS;
+ rxkad_stats.fc_encrypts[ENCRYPT]++;
+ UNLOCK_RXKAD_STATS;
+ for (i = 0; i < (ROUNDS / 2); i++) {
S = *schedule++ ^ R; /* xor R with key bits from schedule */
Pchar[Byte2] = sbox0[Schar[Byte0]]; /* do 8-bit S Box subst. */
Pchar[Byte3] = sbox1[Schar[Byte1]]; /* and permute the result */
R ^= P;
}
} else {
- LOCK_RXKAD_STATS rxkad_stats.fc_encrypts[DECRYPT]++;
- UNLOCK_RXKAD_STATS schedule = &schedule[ROUNDS - 1]; /* start at end of key schedule */
+ LOCK_RXKAD_STATS;
+ rxkad_stats.fc_encrypts[DECRYPT]++;
+ UNLOCK_RXKAD_STATS;
+ schedule = &schedule[ROUNDS - 1]; /* start at end of key schedule */
for (i = 0; i < (ROUNDS / 2); i++) {
S = *schedule-- ^ L; /* xor R with key bits from schedule */
Pchar[Byte2] = sbox0[Schar[Byte0]]; /* do 8-bit S Box subst. and */