Lines Matching refs:ct
334 int saferp_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) in saferp_ecb_encrypt() argument
340 LTC_ARGCHK(ct != NULL); in saferp_ecb_encrypt()
347 ROUND(b, 0); LT(b, ct); in saferp_ecb_encrypt()
348 ROUND(ct, 2); LT(ct, b); in saferp_ecb_encrypt()
349 ROUND(b, 4); LT(b, ct); in saferp_ecb_encrypt()
350 ROUND(ct, 6); LT(ct, b); in saferp_ecb_encrypt()
351 ROUND(b, 8); LT(b, ct); in saferp_ecb_encrypt()
352 ROUND(ct, 10); LT(ct, b); in saferp_ecb_encrypt()
353 ROUND(b, 12); LT(b, ct); in saferp_ecb_encrypt()
354 ROUND(ct, 14); LT(ct, b); in saferp_ecb_encrypt()
357 ROUND(b, 16); LT(b, ct); in saferp_ecb_encrypt()
358 ROUND(ct, 18); LT(ct, b); in saferp_ecb_encrypt()
359 ROUND(b, 20); LT(b, ct); in saferp_ecb_encrypt()
360 ROUND(ct, 22); LT(ct, b); in saferp_ecb_encrypt()
364 ROUND(b, 24); LT(b, ct); in saferp_ecb_encrypt()
365 ROUND(ct, 26); LT(ct, b); in saferp_ecb_encrypt()
366 ROUND(b, 28); LT(b, ct); in saferp_ecb_encrypt()
367 ROUND(ct, 30); LT(ct, b); in saferp_ecb_encrypt()
369 ct[0] = b[0] ^ skey->saferp.K[skey->saferp.rounds*2][0]; in saferp_ecb_encrypt()
370 ct[1] = (b[1] + skey->saferp.K[skey->saferp.rounds*2][1]) & 255; in saferp_ecb_encrypt()
371 ct[2] = (b[2] + skey->saferp.K[skey->saferp.rounds*2][2]) & 255; in saferp_ecb_encrypt()
372 ct[3] = b[3] ^ skey->saferp.K[skey->saferp.rounds*2][3]; in saferp_ecb_encrypt()
373 ct[4] = b[4] ^ skey->saferp.K[skey->saferp.rounds*2][4]; in saferp_ecb_encrypt()
374 ct[5] = (b[5] + skey->saferp.K[skey->saferp.rounds*2][5]) & 255; in saferp_ecb_encrypt()
375 ct[6] = (b[6] + skey->saferp.K[skey->saferp.rounds*2][6]) & 255; in saferp_ecb_encrypt()
376 ct[7] = b[7] ^ skey->saferp.K[skey->saferp.rounds*2][7]; in saferp_ecb_encrypt()
377 ct[8] = b[8] ^ skey->saferp.K[skey->saferp.rounds*2][8]; in saferp_ecb_encrypt()
378 ct[9] = (b[9] + skey->saferp.K[skey->saferp.rounds*2][9]) & 255; in saferp_ecb_encrypt()
379 ct[10] = (b[10] + skey->saferp.K[skey->saferp.rounds*2][10]) & 255; in saferp_ecb_encrypt()
380 ct[11] = b[11] ^ skey->saferp.K[skey->saferp.rounds*2][11]; in saferp_ecb_encrypt()
381 ct[12] = b[12] ^ skey->saferp.K[skey->saferp.rounds*2][12]; in saferp_ecb_encrypt()
382 ct[13] = (b[13] + skey->saferp.K[skey->saferp.rounds*2][13]) & 255; in saferp_ecb_encrypt()
383 ct[14] = (b[14] + skey->saferp.K[skey->saferp.rounds*2][14]) & 255; in saferp_ecb_encrypt()
384 ct[15] = b[15] ^ skey->saferp.K[skey->saferp.rounds*2][15]; in saferp_ecb_encrypt()
398 int saferp_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) in saferp_ecb_decrypt() argument
404 LTC_ARGCHK(ct != NULL); in saferp_ecb_decrypt()
408 b[0] = ct[0] ^ skey->saferp.K[skey->saferp.rounds*2][0]; in saferp_ecb_decrypt()
409 b[1] = (ct[1] - skey->saferp.K[skey->saferp.rounds*2][1]) & 255; in saferp_ecb_decrypt()
410 b[2] = (ct[2] - skey->saferp.K[skey->saferp.rounds*2][2]) & 255; in saferp_ecb_decrypt()
411 b[3] = ct[3] ^ skey->saferp.K[skey->saferp.rounds*2][3]; in saferp_ecb_decrypt()
412 b[4] = ct[4] ^ skey->saferp.K[skey->saferp.rounds*2][4]; in saferp_ecb_decrypt()
413 b[5] = (ct[5] - skey->saferp.K[skey->saferp.rounds*2][5]) & 255; in saferp_ecb_decrypt()
414 b[6] = (ct[6] - skey->saferp.K[skey->saferp.rounds*2][6]) & 255; in saferp_ecb_decrypt()
415 b[7] = ct[7] ^ skey->saferp.K[skey->saferp.rounds*2][7]; in saferp_ecb_decrypt()
416 b[8] = ct[8] ^ skey->saferp.K[skey->saferp.rounds*2][8]; in saferp_ecb_decrypt()
417 b[9] = (ct[9] - skey->saferp.K[skey->saferp.rounds*2][9]) & 255; in saferp_ecb_decrypt()
418 b[10] = (ct[10] - skey->saferp.K[skey->saferp.rounds*2][10]) & 255; in saferp_ecb_decrypt()
419 b[11] = ct[11] ^ skey->saferp.K[skey->saferp.rounds*2][11]; in saferp_ecb_decrypt()
420 b[12] = ct[12] ^ skey->saferp.K[skey->saferp.rounds*2][12]; in saferp_ecb_decrypt()
421 b[13] = (ct[13] - skey->saferp.K[skey->saferp.rounds*2][13]) & 255; in saferp_ecb_decrypt()
422 b[14] = (ct[14] - skey->saferp.K[skey->saferp.rounds*2][14]) & 255; in saferp_ecb_decrypt()
423 b[15] = ct[15] ^ skey->saferp.K[skey->saferp.rounds*2][15]; in saferp_ecb_decrypt()
466 unsigned char key[32], pt[16], ct[16]; in saferp_test()
510 if (XMEMCMP(tmp[0], tests[i].ct, 16) || XMEMCMP(tmp[1], tests[i].pt, 16)) { in saferp_test()