/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1990 Dennis Ferguson. All rights reserved.
*
* Commercial use is permitted only if products which are derived from
* in Canada. Otherwise, redistribution and use in source and binary
* forms are permitted.
*/
/*
* des_cbc_encrypt.c - an implementation of the DES cipher function in cbc mode
*/
#include "des_int.h"
/*
* des_cbc_encrypt - {en,de}crypt a stream in CBC mode
*/
/* SUNW14resync - sparcv9 cc complained about lack of object init */
/* = all zero */
#ifndef _KERNEL
int
const mit_des_cblock *in;
long length;
int encrypt;
{
/* For the Key Object */
ret = 0;
"mit_des_cbc_encrypt.");
goto cleanup;
}
"mit_des_cbc_encrypt: rv = 0x%x", rv);
goto cleanup;
}
else
mechanism.ulParameterLen = 0;
if (encrypt)
else
"mit_des_cbc_encrypt: rv = 0x%x", rv);
goto cleanup;
}
if (encrypt)
(CK_ULONG_PTR)&length);
else
(CK_ULONG_PTR)&length);
"rv = 0x%x", rv);
}
if (ret)
return(ret);
}
#else
/*
* This routine performs DES cipher-block-chaining operation, either
* encrypting from cleartext to ciphertext, if encrypt != 0 or
* decrypting from ciphertext to cleartext, if encrypt == 0.
*
* The key schedule is passed as an arg, as well as the cleartext or
* ciphertext. The cleartext and ciphertext should be in host order.
*
* NOTE-- the output is ALWAYS an multiple of 8 bytes long. If not
* enough space was provided, your program will get trashed.
*
* For encryption, the cleartext string is null padded, at the end, to
* an integral multiple of eight bytes.
*
* For decryption, the ciphertext will be used in integral multiples
* of 8 bytes, but only the first "length" bytes returned into the
* cleartext.
*/
/* ARGSUSED */
int
const mit_des_cblock *in,
{
ret = 0;
return(ret);
}
#endif /* !_KERNEL */