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