Decrypts a block of text with LTC_DES @param ct The input ciphertext (8 bytes) @param pt The output plaintext (8 bytes) @param skey The key as scheduled @return CRYPT_OK if successful */
| 1614 | @return CRYPT_OK if successful |
| 1615 | */ |
| 1616 | int des_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey) |
| 1617 | { |
| 1618 | ulong32 work[2]; |
| 1619 | LTC_ARGCHK(pt != NULL); |
| 1620 | LTC_ARGCHK(ct != NULL); |
| 1621 | LTC_ARGCHK(skey != NULL); |
| 1622 | LOAD32H(work[0], ct+0); |
| 1623 | LOAD32H(work[1], ct+4); |
| 1624 | desfunc(work, skey->des.dk); |
| 1625 | STORE32H(work[0],pt+0); |
| 1626 | STORE32H(work[1],pt+4); |
| 1627 | return CRYPT_OK; |
| 1628 | } |
| 1629 | |
| 1630 | /** |
| 1631 | Encrypts a block of text with 3LTC_DES-EDE |