2 * The MORUS-1280 Authenticated-Encryption Algorithm
3 * Glue for SSE2 implementation
5 * Copyright (c) 2016-2018 Ondrej Mosnacek <omosnacek@gmail.com>
6 * Copyright (C) 2017-2018 Red Hat, Inc. All rights reserved.
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)
14 #include <crypto/internal/aead.h>
15 #include <crypto/internal/simd.h>
16 #include <crypto/morus1280_glue.h>
17 #include <linux/module.h>
18 #include <asm/fpu/api.h>
19 #include <asm/cpu_device_id.h>
21 asmlinkage void crypto_morus1280_sse2_init(void *state, const void *key,
23 asmlinkage void crypto_morus1280_sse2_ad(void *state, const void *data,
26 asmlinkage void crypto_morus1280_sse2_enc(void *state, const void *src,
27 void *dst, unsigned int length);
28 asmlinkage void crypto_morus1280_sse2_dec(void *state, const void *src,
29 void *dst, unsigned int length);
31 asmlinkage void crypto_morus1280_sse2_enc_tail(void *state, const void *src,
32 void *dst, unsigned int length);
33 asmlinkage void crypto_morus1280_sse2_dec_tail(void *state, const void *src,
34 void *dst, unsigned int length);
36 asmlinkage void crypto_morus1280_sse2_final(void *state, void *tag_xor,
37 u64 assoclen, u64 cryptlen);
39 MORUS1280_DECLARE_ALG(sse2, "morus1280-sse2", 350);
41 static struct simd_aead_alg *simd_alg;
43 static int __init crypto_morus1280_sse2_module_init(void)
45 if (!boot_cpu_has(X86_FEATURE_XMM2) ||
46 !cpu_has_xfeatures(XFEATURE_MASK_SSE, NULL))
49 return simd_register_aeads_compat(&crypto_morus1280_sse2_alg, 1,
53 static void __exit crypto_morus1280_sse2_module_exit(void)
55 simd_unregister_aeads(&crypto_morus1280_sse2_alg, 1, &simd_alg);
58 module_init(crypto_morus1280_sse2_module_init);
59 module_exit(crypto_morus1280_sse2_module_exit);
61 MODULE_LICENSE("GPL");
62 MODULE_AUTHOR("Ondrej Mosnacek <omosnacek@gmail.com>");
63 MODULE_DESCRIPTION("MORUS-1280 AEAD algorithm -- SSE2 implementation");
64 MODULE_ALIAS_CRYPTO("morus1280");
65 MODULE_ALIAS_CRYPTO("morus1280-sse2");