void des(unsigned char *inblock, unsigned char *outblock) { unsigned long work[2]; scrunch(inblock, work); desfunc(work, KnL); unscrun(work, outblock); return; }
void D3DES::des(const uint8_t * inblock, uint8_t * outblock) { unsigned long work[2]; scrunch(inblock, work); desfunc(work, KnL); unscrun(work, outblock); return; }
// ----------------------------------------------------------------------- // des_block // Encrpts/Decrypts(according to the key currently loaded int the // internal key register) one block of eight bytes at address 'in' // into the block at address 'out'. They can be the same. // // "in" // "out" // ----------------------------------------------------------------------- void DES::des_block(unsigned char *in, unsigned char *out) { unsigned long work[2]; scrunch(in, work); desfunc(work, KnL); unscrun(work, out); }
void des (DESContext * ctx, unsigned char *inblock, unsigned char *outblock) { unsigned long work[2]; scrunch (inblock, work); desfunc (work, ctx->KnL); unscrun (work, outblock); return; }
/*! 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 */ static void ltc_des_ecb_decrypt(const ccecb_ctx *skey, unsigned long nblocks, const void *in, void *out) { uint32_t work[2]; const ltc_des_keysched *des; const unsigned char *ct=in; unsigned char *pt=out; des = (const ltc_des_keysched *)skey; while(nblocks--) { CC_LOAD32_BE(work[0], ct+0); CC_LOAD32_BE(work[1], ct+4); desfunc(work, des->dk); CC_STORE32_BE(work[0],pt+0); CC_STORE32_BE(work[1],pt+4); ct+=8; pt+=8; } }