static void __exit sha512_arm_mod_fini(void) { crypto_unregister_shashes(sha512_arm_algs, ARRAY_SIZE(sha512_arm_algs)); if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && cpu_has_neon()) crypto_unregister_shashes(sha512_neon_algs, ARRAY_SIZE(sha512_neon_algs)); }
static int __init sha256_mod_init(void) { int ret = crypto_register_shashes(algs, ARRAY_SIZE(algs)); if (ret) return ret; if (elf_hwcap & HWCAP_ASIMD) { ret = crypto_register_shashes(neon_algs, ARRAY_SIZE(neon_algs)); if (ret) crypto_unregister_shashes(algs, ARRAY_SIZE(algs)); } return ret; }
static int __init sha512_arm_mod_init(void) { int err; err = crypto_register_shashes(sha512_arm_algs, ARRAY_SIZE(sha512_arm_algs)); if (err) return err; if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && cpu_has_neon()) { err = crypto_register_shashes(sha512_neon_algs, ARRAY_SIZE(sha512_neon_algs)); if (err) goto err_unregister; } return 0; err_unregister: crypto_unregister_shashes(sha512_arm_algs, ARRAY_SIZE(sha512_arm_algs)); return err; }
static void __exit sha512_ssse3_mod_fini(void) { crypto_unregister_shashes(algs, ARRAY_SIZE(algs)); }
static void __exit sha256_generic_mod_fini(void) { crypto_unregister_shashes(sha256_algs, ARRAY_SIZE(sha256_algs)); }
static void __exit sha256_mod_fini(void) { if (elf_hwcap & HWCAP_ASIMD) crypto_unregister_shashes(neon_algs, ARRAY_SIZE(neon_algs)); crypto_unregister_shashes(algs, ARRAY_SIZE(algs)); }
static void __exit crc_vx_mod_exit(void) { crypto_unregister_shashes(crc32_vx_algs, ARRAY_SIZE(crc32_vx_algs)); }
static void unregister_sha512_avx2(void) { if (avx2_usable()) crypto_unregister_shashes(sha512_avx2_algs, ARRAY_SIZE(sha512_avx2_algs)); }
static void unregister_sha512_ssse3(void) { if (boot_cpu_has(X86_FEATURE_SSSE3)) crypto_unregister_shashes(sha512_ssse3_algs, ARRAY_SIZE(sha512_ssse3_algs)); }
static void unregister_sha256_ni(void) { if (boot_cpu_has(X86_FEATURE_SHA_NI)) crypto_unregister_shashes(sha256_ni_algs, ARRAY_SIZE(sha256_ni_algs)); }
static void unregister_sha256_avx(void) { if (avx_usable()) crypto_unregister_shashes(sha256_avx_algs, ARRAY_SIZE(sha256_avx_algs)); }