ia64/linux-2.6.18-xen.hg

diff crypto/compress.c @ 0:831230e53067

Import 2.6.18 from kernel.org tarball.
author Ian Campbell <ian.campbell@xensource.com>
date Wed Apr 11 14:15:44 2007 +0100 (2007-04-11)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/crypto/compress.c	Wed Apr 11 14:15:44 2007 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +/*
     1.5 + * Cryptographic API.
     1.6 + *
     1.7 + * Compression operations.
     1.8 + *
     1.9 + * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
    1.10 + *
    1.11 + * This program is free software; you can redistribute it and/or modify it
    1.12 + * under the terms of the GNU General Public License as published by the Free
    1.13 + * Software Foundation; either version 2 of the License, or (at your option) 
    1.14 + * any later version.
    1.15 + *
    1.16 + */
    1.17 +#include <linux/types.h>
    1.18 +#include <linux/crypto.h>
    1.19 +#include <linux/errno.h>
    1.20 +#include <asm/scatterlist.h>
    1.21 +#include <linux/string.h>
    1.22 +#include "internal.h"
    1.23 +
    1.24 +static int crypto_compress(struct crypto_tfm *tfm,
    1.25 +                            const u8 *src, unsigned int slen,
    1.26 +                            u8 *dst, unsigned int *dlen)
    1.27 +{
    1.28 +	return tfm->__crt_alg->cra_compress.coa_compress(tfm, src, slen, dst,
    1.29 +	                                                 dlen);
    1.30 +}
    1.31 +
    1.32 +static int crypto_decompress(struct crypto_tfm *tfm,
    1.33 +                             const u8 *src, unsigned int slen,
    1.34 +                             u8 *dst, unsigned int *dlen)
    1.35 +{
    1.36 +	return tfm->__crt_alg->cra_compress.coa_decompress(tfm, src, slen, dst,
    1.37 +	                                                   dlen);
    1.38 +}
    1.39 +
    1.40 +int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags)
    1.41 +{
    1.42 +	return flags ? -EINVAL : 0;
    1.43 +}
    1.44 +
    1.45 +int crypto_init_compress_ops(struct crypto_tfm *tfm)
    1.46 +{
    1.47 +	struct compress_tfm *ops = &tfm->crt_compress;
    1.48 +
    1.49 +	ops->cot_compress = crypto_compress;
    1.50 +	ops->cot_decompress = crypto_decompress;
    1.51 +	
    1.52 +	return 0;
    1.53 +}
    1.54 +
    1.55 +void crypto_exit_compress_ops(struct crypto_tfm *tfm)
    1.56 +{
    1.57 +}