Skip to content
Snippets Groups Projects
Select Git revision
  • 408a93a2bb4f276f28059b51fbe0bbd06be350fc
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

decompress_unlzma.c

Blame
  • crypto_null.c 5.32 KiB
    /*
     * Cryptographic API.
     *
     * Null algorithms, aka Much Ado About Nothing.
     *
     * These are needed for IPsec, and may be useful in general for
     * testing & debugging.
     *
     * The null cipher is compliant with RFC2410.
     *
     * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License, or
     * (at your option) any later version.
     *
     */
    
    #include <crypto/null.h>
    #include <crypto/internal/hash.h>
    #include <crypto/internal/skcipher.h>
    #include <linux/init.h>
    #include <linux/module.h>
    #include <linux/mm.h>
    #include <linux/string.h>
    
    static DEFINE_MUTEX(crypto_default_null_skcipher_lock);
    static struct crypto_skcipher *crypto_default_null_skcipher;
    static int crypto_default_null_skcipher_refcnt;
    
    static int null_compress(struct crypto_tfm *tfm, const u8 *src,
    			 unsigned int slen, u8 *dst, unsigned int *dlen)
    {
    	if (slen > *dlen)
    		return -EINVAL;
    	memcpy(dst, src, slen);
    	*dlen = slen;
    	return 0;
    }
    
    static int null_init(struct shash_desc *desc)
    {
    	return 0;
    }
    
    static int null_update(struct shash_desc *desc, const u8 *data,
    		       unsigned int len)
    {
    	return 0;
    }
    
    static int null_final(struct shash_desc *desc, u8 *out)
    {
    	return 0;
    }
    
    static int null_digest(struct shash_desc *desc, const u8 *data,
    		       unsigned int len, u8 *out)
    {
    	return 0;
    }
    
    static int null_hash_setkey(struct crypto_shash *tfm, const u8 *key,
    			    unsigned int keylen)
    { return 0; }
    
    static int null_setkey(struct crypto_tfm *tfm, const u8 *key,
    		       unsigned int keylen)
    { return 0; }