Lines Matching refs:skey
309 symmetric_key *skey) in blowfish_setup() argument
315 LTC_ARGCHK(skey != NULL); in blowfish_setup()
336 skey->blowfish.K[x] = ORIG_P[x] ^ A; in blowfish_setup()
342 skey->blowfish.S[x][y] = ORIG_S[x][y]; in blowfish_setup()
353 blowfish_ecb_encrypt(B, B, skey); in blowfish_setup()
355 LOAD32H(skey->blowfish.K[x], &B[0]); in blowfish_setup()
356 LOAD32H(skey->blowfish.K[x+1], &B[4]); in blowfish_setup()
363 blowfish_ecb_encrypt(B, B, skey); in blowfish_setup()
365 LOAD32H(skey->blowfish.S[x][y], &B[0]); in blowfish_setup()
366 LOAD32H(skey->blowfish.S[x][y+1], &B[4]); in blowfish_setup()
380 #define F(x) ((skey->blowfish.S[0][byte(x,3)] + skey->blowfish.S[1][byte(x,2)]) ^ skey->blowfish.S[…
391 static int _blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) in _blowfish_ecb_encrypt() argument
393 int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) in _blowfish_ecb_encrypt()
404 LTC_ARGCHK(skey != NULL); in _blowfish_ecb_encrypt()
407 S1 = skey->blowfish.S[0]; in _blowfish_ecb_encrypt()
408 S2 = skey->blowfish.S[1]; in _blowfish_ecb_encrypt()
409 S3 = skey->blowfish.S[2]; in _blowfish_ecb_encrypt()
410 S4 = skey->blowfish.S[3]; in _blowfish_ecb_encrypt()
419 L ^= skey->blowfish.K[r++]; R ^= F(L); in _blowfish_ecb_encrypt()
420 R ^= skey->blowfish.K[r++]; L ^= F(R); in _blowfish_ecb_encrypt()
421 L ^= skey->blowfish.K[r++]; R ^= F(L); in _blowfish_ecb_encrypt()
422 R ^= skey->blowfish.K[r++]; L ^= F(R); in _blowfish_ecb_encrypt()
426 R ^= skey->blowfish.K[17]; in _blowfish_ecb_encrypt()
427 L ^= skey->blowfish.K[16]; in _blowfish_ecb_encrypt()
437 int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey) in blowfish_ecb_encrypt() argument
439 int err = _blowfish_ecb_encrypt(pt, ct, skey); in blowfish_ecb_encrypt()
453 static int _blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) in _blowfish_ecb_decrypt() argument
455 int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) in _blowfish_ecb_decrypt()
466 LTC_ARGCHK(skey != NULL); in _blowfish_ecb_decrypt()
469 S1 = skey->blowfish.S[0]; in _blowfish_ecb_decrypt()
470 S2 = skey->blowfish.S[1]; in _blowfish_ecb_decrypt()
471 S3 = skey->blowfish.S[2]; in _blowfish_ecb_decrypt()
472 S4 = skey->blowfish.S[3]; in _blowfish_ecb_decrypt()
480 R ^= skey->blowfish.K[17]; in _blowfish_ecb_decrypt()
481 L ^= skey->blowfish.K[16]; in _blowfish_ecb_decrypt()
485 L ^= F(R); R ^= skey->blowfish.K[r--]; in _blowfish_ecb_decrypt()
486 R ^= F(L); L ^= skey->blowfish.K[r--]; in _blowfish_ecb_decrypt()
487 L ^= F(R); R ^= skey->blowfish.K[r--]; in _blowfish_ecb_decrypt()
488 R ^= F(L); L ^= skey->blowfish.K[r--]; in _blowfish_ecb_decrypt()
498 int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) in blowfish_ecb_decrypt() argument
500 int err = _blowfish_ecb_decrypt(ct, pt, skey); in blowfish_ecb_decrypt()
568 void blowfish_done(symmetric_key *skey) in blowfish_done() argument