Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3696e851 authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Greg Kroah-Hartman
Browse files

staging: ccree: fix hash naming convention



The hash files were using a naming convention which was inconsistent
(ssi vs. cc), included a useless prefix (ssi_hash) and often used too
long function names producing monster such as
ssi_ahash_get_initial_digest_len_sram_addr() that made the call site
hard to read.

Make the code more readable by switching to a simpler, consistent naming
convention for the file.

Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7a457d23
Loading
Loading
Loading
Loading
+3 −7
Original line number Original line Diff line number Diff line
@@ -1023,9 +1023,7 @@ static void cc_set_hmac_desc(struct aead_request *req, struct cc_hw_desc desc[],
	/* Load init. digest len (64 bytes) */
	/* Load init. digest len (64 bytes) */
	hw_desc_init(&desc[idx]);
	hw_desc_init(&desc[idx]);
	set_cipher_mode(&desc[idx], hash_mode);
	set_cipher_mode(&desc[idx], hash_mode);
	set_din_sram(&desc[idx],
	set_din_sram(&desc[idx], cc_digest_len_addr(ctx->drvdata, hash_mode),
		     ssi_ahash_get_initial_digest_len_sram_addr(ctx->drvdata,
								hash_mode),
		     HASH_LEN_SIZE);
		     HASH_LEN_SIZE);
	set_flow_mode(&desc[idx], S_DIN_to_HASH);
	set_flow_mode(&desc[idx], S_DIN_to_HASH);
	set_setup_mode(&desc[idx], SETUP_LOAD_KEY0);
	set_setup_mode(&desc[idx], SETUP_LOAD_KEY0);
@@ -1152,9 +1150,7 @@ static void cc_proc_scheme_desc(struct aead_request *req,
	/* Load init. digest len (64 bytes) */
	/* Load init. digest len (64 bytes) */
	hw_desc_init(&desc[idx]);
	hw_desc_init(&desc[idx]);
	set_cipher_mode(&desc[idx], hash_mode);
	set_cipher_mode(&desc[idx], hash_mode);
	set_din_sram(&desc[idx],
	set_din_sram(&desc[idx], cc_digest_len_addr(ctx->drvdata, hash_mode),
		     ssi_ahash_get_initial_digest_len_sram_addr(ctx->drvdata,
								hash_mode),
		     HASH_LEN_SIZE);
		     HASH_LEN_SIZE);
	set_cipher_config1(&desc[idx], HASH_PADDING_ENABLED);
	set_cipher_config1(&desc[idx], HASH_PADDING_ENABLED);
	set_flow_mode(&desc[idx], S_DIN_to_HASH);
	set_flow_mode(&desc[idx], S_DIN_to_HASH);
+4 −4
Original line number Original line Diff line number Diff line
@@ -358,9 +358,9 @@ static int init_cc_resources(struct platform_device *plat_dev)
	}
	}


	/* hash must be allocated before aead since hash exports APIs */
	/* hash must be allocated before aead since hash exports APIs */
	rc = ssi_hash_alloc(new_drvdata);
	rc = cc_hash_alloc(new_drvdata);
	if (rc) {
	if (rc) {
		dev_err(dev, "ssi_hash_alloc failed\n");
		dev_err(dev, "cc_hash_alloc failed\n");
		goto post_cipher_err;
		goto post_cipher_err;
	}
	}


@@ -379,7 +379,7 @@ static int init_cc_resources(struct platform_device *plat_dev)
	return 0;
	return 0;


post_hash_err:
post_hash_err:
	ssi_hash_free(new_drvdata);
	cc_hash_free(new_drvdata);
post_cipher_err:
post_cipher_err:
	ssi_ablkcipher_free(new_drvdata);
	ssi_ablkcipher_free(new_drvdata);
post_ivgen_err:
post_ivgen_err:
@@ -417,7 +417,7 @@ static void cleanup_cc_resources(struct platform_device *plat_dev)
		(struct ssi_drvdata *)platform_get_drvdata(plat_dev);
		(struct ssi_drvdata *)platform_get_drvdata(plat_dev);


	cc_aead_free(drvdata);
	cc_aead_free(drvdata);
	ssi_hash_free(drvdata);
	cc_hash_free(drvdata);
	ssi_ablkcipher_free(drvdata);
	ssi_ablkcipher_free(drvdata);
	ssi_ivgen_fini(drvdata);
	ssi_ivgen_fini(drvdata);
	cc_pm_fini(drvdata);
	cc_pm_fini(drvdata);