~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/crypto/morus1280-avx2-glue.c

Version: ~ [ linux-5.8-rc4 ] ~ [ linux-5.7.7 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.50 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.131 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.187 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.229 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.229 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * The MORUS-1280 Authenticated-Encryption Algorithm
  3  *   Glue for AVX2 implementation
  4  *
  5  * Copyright (c) 2016-2018 Ondrej Mosnacek <omosnacek@gmail.com>
  6  * Copyright (C) 2017-2018 Red Hat, Inc. All rights reserved.
  7  *
  8  * This program is free software; you can redistribute it and/or modify it
  9  * under the terms of the GNU General Public License as published by the Free
 10  * Software Foundation; either version 2 of the License, or (at your option)
 11  * any later version.
 12  */
 13 
 14 #include <crypto/internal/aead.h>
 15 #include <crypto/morus1280_glue.h>
 16 #include <linux/module.h>
 17 #include <asm/fpu/api.h>
 18 #include <asm/cpu_device_id.h>
 19 
 20 asmlinkage void crypto_morus1280_avx2_init(void *state, const void *key,
 21                                            const void *iv);
 22 asmlinkage void crypto_morus1280_avx2_ad(void *state, const void *data,
 23                                          unsigned int length);
 24 
 25 asmlinkage void crypto_morus1280_avx2_enc(void *state, const void *src,
 26                                           void *dst, unsigned int length);
 27 asmlinkage void crypto_morus1280_avx2_dec(void *state, const void *src,
 28                                           void *dst, unsigned int length);
 29 
 30 asmlinkage void crypto_morus1280_avx2_enc_tail(void *state, const void *src,
 31                                                void *dst, unsigned int length);
 32 asmlinkage void crypto_morus1280_avx2_dec_tail(void *state, const void *src,
 33                                                void *dst, unsigned int length);
 34 
 35 asmlinkage void crypto_morus1280_avx2_final(void *state, void *tag_xor,
 36                                             u64 assoclen, u64 cryptlen);
 37 
 38 MORUS1280_DECLARE_ALGS(avx2, "morus1280-avx2", 400);
 39 
 40 static int __init crypto_morus1280_avx2_module_init(void)
 41 {
 42         if (!boot_cpu_has(X86_FEATURE_AVX2) ||
 43             !boot_cpu_has(X86_FEATURE_OSXSAVE) ||
 44             !cpu_has_xfeatures(XFEATURE_MASK_SSE | XFEATURE_MASK_YMM, NULL))
 45                 return -ENODEV;
 46 
 47         return crypto_register_aeads(crypto_morus1280_avx2_algs,
 48                                      ARRAY_SIZE(crypto_morus1280_avx2_algs));
 49 }
 50 
 51 static void __exit crypto_morus1280_avx2_module_exit(void)
 52 {
 53         crypto_unregister_aeads(crypto_morus1280_avx2_algs,
 54                                 ARRAY_SIZE(crypto_morus1280_avx2_algs));
 55 }
 56 
 57 module_init(crypto_morus1280_avx2_module_init);
 58 module_exit(crypto_morus1280_avx2_module_exit);
 59 
 60 MODULE_LICENSE("GPL");
 61 MODULE_AUTHOR("Ondrej Mosnacek <omosnacek@gmail.com>");
 62 MODULE_DESCRIPTION("MORUS-1280 AEAD algorithm -- AVX2 implementation");
 63 MODULE_ALIAS_CRYPTO("morus1280");
 64 MODULE_ALIAS_CRYPTO("morus1280-avx2");
 65 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp