mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	 9b9d4ef0cf
			
		
	
	
		9b9d4ef0cf
		
	
	
	
	
		
			
			Split the lib poly1305 code just as was done with sha256.  Make
the main library code conditional on LIB_POLY1305 instead of
LIB_POLY1305_GENERIC.
Reported-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Fixes: 10a6d72ea3 ("crypto: lib/poly1305 - Use block-only interface")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
		
	
			
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			689 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			689 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0-or-later
 | |
| /*
 | |
|  * Poly1305 authenticator algorithm, RFC7539
 | |
|  *
 | |
|  * Copyright (C) 2015 Martin Willi
 | |
|  *
 | |
|  * Based on public domain code by Andrew Moon and Daniel J. Bernstein.
 | |
|  */
 | |
| 
 | |
| #include <crypto/internal/poly1305.h>
 | |
| #include <linux/kernel.h>
 | |
| #include <linux/module.h>
 | |
| 
 | |
| void poly1305_block_init_generic(struct poly1305_block_state *desc,
 | |
| 				 const u8 raw_key[POLY1305_BLOCK_SIZE])
 | |
| {
 | |
| 	poly1305_core_init(&desc->h);
 | |
| 	poly1305_core_setkey(&desc->core_r, raw_key);
 | |
| }
 | |
| EXPORT_SYMBOL_GPL(poly1305_block_init_generic);
 | |
| 
 | |
| MODULE_LICENSE("GPL");
 | |
| MODULE_AUTHOR("Martin Willi <martin@strongswan.org>");
 | |
| MODULE_DESCRIPTION("Poly1305 algorithm (generic implementation)");
 |