lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 24 Apr 2017 18:05:14 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     George Cherian <george.cherian@...ium.com>
Cc:     linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
        davem@...emloft.net
Subject: Re: [PATCH 2/3] crypto: cavium: Remove the individual
 encrypt/decrypt function for each algorithm

On Fri, Apr 21, 2017 at 11:16:05AM +0000, George Cherian wrote:
>
> -int cvm_aes_encrypt_cbc(struct ablkcipher_request *req)
> +static inline u32 cvm_cipher_type(const char *name)
>  {
> -	return cvm_enc_dec(req, true, AES_CBC);
> -}
>  
> -int cvm_aes_decrypt_cbc(struct ablkcipher_request *req)
> -{
> -	return cvm_enc_dec(req, false, AES_CBC);
> +	const struct cvm_cipher *cipher = cvm_cipher_table;
> +
> +	while (cipher->name) {
> +		if (!strcmp(cipher->name, name))
> +			break;
> +		cipher++;
> +	}
> +
> +	return cipher->value;
>  }

That's rather unwieldy.  It's usually easier to embed the cipher
type into the algo structure and then get to it via the alg object.

Cheers,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ