mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	[CRYPTO] skcipher: Added geniv field
This patch introduces the geniv field which indicates the default IV generator for each algorithm. It should point to a string that is not freed as long as the algorithm is registered. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
		
							parent
							
								
									61da88e2b8
								
							
						
					
					
						commit
						23508e11ab
					
				
					 3 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -96,6 +96,7 @@ static void crypto_ablkcipher_show(struct seq_file *m, struct crypto_alg *alg)
 | 
				
			||||||
	seq_printf(m, "min keysize  : %u\n", ablkcipher->min_keysize);
 | 
						seq_printf(m, "min keysize  : %u\n", ablkcipher->min_keysize);
 | 
				
			||||||
	seq_printf(m, "max keysize  : %u\n", ablkcipher->max_keysize);
 | 
						seq_printf(m, "max keysize  : %u\n", ablkcipher->max_keysize);
 | 
				
			||||||
	seq_printf(m, "ivsize       : %u\n", ablkcipher->ivsize);
 | 
						seq_printf(m, "ivsize       : %u\n", ablkcipher->ivsize);
 | 
				
			||||||
 | 
						seq_printf(m, "geniv        : %s\n", ablkcipher->geniv ?: "<default>");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const struct crypto_type crypto_ablkcipher_type = {
 | 
					const struct crypto_type crypto_ablkcipher_type = {
 | 
				
			||||||
| 
						 | 
					@ -142,6 +143,7 @@ static void crypto_givcipher_show(struct seq_file *m, struct crypto_alg *alg)
 | 
				
			||||||
	seq_printf(m, "min keysize  : %u\n", ablkcipher->min_keysize);
 | 
						seq_printf(m, "min keysize  : %u\n", ablkcipher->min_keysize);
 | 
				
			||||||
	seq_printf(m, "max keysize  : %u\n", ablkcipher->max_keysize);
 | 
						seq_printf(m, "max keysize  : %u\n", ablkcipher->max_keysize);
 | 
				
			||||||
	seq_printf(m, "ivsize       : %u\n", ablkcipher->ivsize);
 | 
						seq_printf(m, "ivsize       : %u\n", ablkcipher->ivsize);
 | 
				
			||||||
 | 
						seq_printf(m, "geniv        : %s\n", ablkcipher->geniv ?: "<built-in>");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const struct crypto_type crypto_givcipher_type = {
 | 
					const struct crypto_type crypto_givcipher_type = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -496,6 +496,8 @@ static void crypto_blkcipher_show(struct seq_file *m, struct crypto_alg *alg)
 | 
				
			||||||
	seq_printf(m, "min keysize  : %u\n", alg->cra_blkcipher.min_keysize);
 | 
						seq_printf(m, "min keysize  : %u\n", alg->cra_blkcipher.min_keysize);
 | 
				
			||||||
	seq_printf(m, "max keysize  : %u\n", alg->cra_blkcipher.max_keysize);
 | 
						seq_printf(m, "max keysize  : %u\n", alg->cra_blkcipher.max_keysize);
 | 
				
			||||||
	seq_printf(m, "ivsize       : %u\n", alg->cra_blkcipher.ivsize);
 | 
						seq_printf(m, "ivsize       : %u\n", alg->cra_blkcipher.ivsize);
 | 
				
			||||||
 | 
						seq_printf(m, "geniv        : %s\n", alg->cra_blkcipher.geniv ?:
 | 
				
			||||||
 | 
										     "<default>");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const struct crypto_type crypto_blkcipher_type = {
 | 
					const struct crypto_type crypto_blkcipher_type = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -183,6 +183,8 @@ struct ablkcipher_alg {
 | 
				
			||||||
	int (*givencrypt)(struct skcipher_givcrypt_request *req);
 | 
						int (*givencrypt)(struct skcipher_givcrypt_request *req);
 | 
				
			||||||
	int (*givdecrypt)(struct skcipher_givcrypt_request *req);
 | 
						int (*givdecrypt)(struct skcipher_givcrypt_request *req);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						const char *geniv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	unsigned int min_keysize;
 | 
						unsigned int min_keysize;
 | 
				
			||||||
	unsigned int max_keysize;
 | 
						unsigned int max_keysize;
 | 
				
			||||||
	unsigned int ivsize;
 | 
						unsigned int ivsize;
 | 
				
			||||||
| 
						 | 
					@ -209,6 +211,8 @@ struct blkcipher_alg {
 | 
				
			||||||
		       struct scatterlist *dst, struct scatterlist *src,
 | 
							       struct scatterlist *dst, struct scatterlist *src,
 | 
				
			||||||
		       unsigned int nbytes);
 | 
							       unsigned int nbytes);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						const char *geniv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	unsigned int min_keysize;
 | 
						unsigned int min_keysize;
 | 
				
			||||||
	unsigned int max_keysize;
 | 
						unsigned int max_keysize;
 | 
				
			||||||
	unsigned int ivsize;
 | 
						unsigned int ivsize;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue