cregit-Linux how code gets into the kernel

Release 4.11 arch/arm/crypto/sha512-neon-glue.c

Directory: arch/arm/crypto
/*
 * sha512-neon-glue.c - accelerated SHA-384/512 for ARM NEON
 *
 * Copyright (C) 2015 Linaro Ltd <ard.biesheuvel@linaro.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <crypto/internal/hash.h>
#include <crypto/sha.h>
#include <crypto/sha512_base.h>
#include <linux/crypto.h>
#include <linux/module.h>

#include <asm/simd.h>
#include <asm/neon.h>

#include "sha512.h"

MODULE_ALIAS_CRYPTO("sha384-neon");
MODULE_ALIAS_CRYPTO("sha512-neon");

asmlinkage void sha512_block_data_order_neon(u64 *state, u8 const *src,
					     int blocks);


static int sha512_neon_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct sha512_state *sctx = shash_desc_ctx(desc); if (!may_use_simd() || (sctx->count[0] % SHA512_BLOCK_SIZE) + len < SHA512_BLOCK_SIZE) return sha512_arm_update(desc, data, len); kernel_neon_begin(); sha512_base_do_update(desc, data, len, (sha512_block_fn *)sha512_block_data_order_neon); kernel_neon_end(); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Ard Biesheuvel85100.00%1100.00%
Total85100.00%1100.00%


static int sha512_neon_finup(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) { if (!may_use_simd()) return sha512_arm_finup(desc, data, len, out); kernel_neon_begin(); if (len) sha512_base_do_update(desc, data, len, (sha512_block_fn *)sha512_block_data_order_neon); sha512_base_do_finalize(desc, (sha512_block_fn *)sha512_block_data_order_neon); kernel_neon_end(); return sha512_base_finish(desc, out); }

Contributors

PersonTokensPropCommitsCommitProp
Ard Biesheuvel86100.00%1100.00%
Total86100.00%1100.00%


static int sha512_neon_final(struct shash_desc *desc, u8 *out) { return sha512_neon_finup(desc, NULL, 0, out); }

Contributors

PersonTokensPropCommitsCommitProp
Ard Biesheuvel27100.00%1100.00%
Total27100.00%1100.00%

struct shash_alg sha512_neon_algs[] = { { .init = sha384_base_init, .update = sha512_neon_update, .final = sha512_neon_final, .finup = sha512_neon_finup, .descsize = sizeof(struct sha512_state), .digestsize = SHA384_DIGEST_SIZE, .base = { .cra_name = "sha384", .cra_driver_name = "sha384-neon", .cra_priority = 300, .cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_blocksize = SHA384_BLOCK_SIZE, .cra_module = THIS_MODULE, } }, { .init = sha512_base_init, .update = sha512_neon_update, .final = sha512_neon_final, .finup = sha512_neon_finup, .descsize = sizeof(struct sha512_state), .digestsize = SHA512_DIGEST_SIZE, .base = { .cra_name = "sha512", .cra_driver_name = "sha512-neon", .cra_priority = 300, .cra_flags = CRYPTO_ALG_TYPE_SHASH, .cra_blocksize = SHA512_BLOCK_SIZE, .cra_module = THIS_MODULE, } } };

Overall Contributors

PersonTokensPropCommitsCommitProp
Ard Biesheuvel399100.00%1100.00%
Total399100.00%1100.00%
Directory: arch/arm/crypto
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.