Esempio n. 1
0
static int sha512_ce_final(struct shash_desc *desc, u8 *out)
{
	if (!may_use_simd()) {
		sha512_base_do_finalize(desc,
				(sha512_block_fn *)sha512_block_data_order);
		return sha512_base_finish(desc, out);
	}

	kernel_neon_begin();
	sha512_base_do_finalize(desc, (sha512_block_fn *)sha512_ce_transform);
	kernel_neon_end();
	return sha512_base_finish(desc, out);
}
Esempio n. 2
0
static int sha512_ce_finup(struct shash_desc *desc, const u8 *data,
			   unsigned int len, u8 *out)
{
	if (!may_use_simd()) {
		if (len)
			sha512_base_do_update(desc, data, len,
				(sha512_block_fn *)sha512_block_data_order);
		sha512_base_do_finalize(desc,
				(sha512_block_fn *)sha512_block_data_order);
		return sha512_base_finish(desc, out);
	}

	kernel_neon_begin();
	sha512_base_do_update(desc, data, len,
			      (sha512_block_fn *)sha512_ce_transform);
	sha512_base_do_finalize(desc, (sha512_block_fn *)sha512_ce_transform);
	kernel_neon_end();
	return sha512_base_finish(desc, out);
}
static int sha512_ssse3_finup(struct shash_desc *desc, const u8 *data,
			      unsigned int len, u8 *out)
{
	if (!irq_fpu_usable())
		return crypto_sha512_finup(desc, data, len, out);

	kernel_fpu_begin();
	if (len)
		sha512_base_do_update(desc, data, len,
				      (sha512_block_fn *)sha512_transform_asm);
	sha512_base_do_finalize(desc, (sha512_block_fn *)sha512_transform_asm);
	kernel_fpu_end();

	return sha512_base_finish(desc, out);
}
Esempio n. 4
0
int sha512_arm_final(struct shash_desc *desc, u8 *out)
{
	sha512_base_do_finalize(desc,
		(sha512_block_fn *)sha512_block_data_order);
	return sha512_base_finish(desc, out);
}
Esempio n. 5
0
static int sha512_final(struct shash_desc *desc, u8 *hash)
{
	sha512_base_do_finalize(desc, sha512_generic_block_fn);
	return sha512_base_finish(desc, hash);
}