コード例 #1
0
ファイル: main.c プロジェクト: juhnowski/DES
void des(unsigned char *inblock, unsigned char *outblock)
{
    unsigned long work[2];
    scrunch(inblock, work);
    desfunc(work, KnL);
    unscrun(work, outblock);
    return;
}
コード例 #2
0
ファイル: d3des.cpp プロジェクト: 12019/libraries
void D3DES::des(const uint8_t * inblock, uint8_t * outblock) {
	unsigned long work[2];

	scrunch(inblock, work);
	desfunc(work, KnL);
	unscrun(work, outblock);
	return;
}
コード例 #3
0
ファイル: DES.cpp プロジェクト: wangweichaogit/exc
	// -----------------------------------------------------------------------
	// 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);
	}
コード例 #4
0
ファイル: d3des.c プロジェクト: Distrotech/gst-plugins-bad
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;
}
コード例 #5
0
/*!
 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;
    }
}