MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / des_ecb_decrypt

Function des_ecb_decrypt

extern/libtomcrypt/src/ciphers/des.c:1616–1628  ·  view source on GitHub ↗

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 */

Source from the content-addressed store, hash-verified

1614 @return CRYPT_OK if successful
1615*/
1616int 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

Callers 1

des_testFunction · 0.85

Calls 1

desfuncFunction · 0.85

Tested by

no test coverage detected