~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/crypto/blake2b-neon-glue.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/arm/crypto/blake2b-neon-glue.c (Version linux-6.12-rc7) and /arch/m68k/crypto/blake2b-neon-glue.c (Version linux-6.7.12)


  1 // SPDX-License-Identifier: GPL-2.0-or-later        1 
  2 /*                                                
  3  * BLAKE2b digest algorithm, NEON accelerated     
  4  *                                                
  5  * Copyright 2020 Google LLC                      
  6  */                                               
  7                                                   
  8 #include <crypto/internal/blake2b.h>              
  9 #include <crypto/internal/hash.h>                 
 10 #include <crypto/internal/simd.h>                 
 11                                                   
 12 #include <linux/module.h>                         
 13 #include <linux/sizes.h>                          
 14                                                   
 15 #include <asm/neon.h>                             
 16 #include <asm/simd.h>                             
 17                                                   
 18 asmlinkage void blake2b_compress_neon(struct b    
 19                                       const u8    
 20                                                   
 21 static void blake2b_compress_arch(struct blake    
 22                                   const u8 *bl    
 23 {                                                 
 24         if (!crypto_simd_usable()) {              
 25                 blake2b_compress_generic(state    
 26                 return;                           
 27         }                                         
 28                                                   
 29         do {                                      
 30                 const size_t blocks = min_t(si    
 31                                             SZ    
 32                                                   
 33                 kernel_neon_begin();              
 34                 blake2b_compress_neon(state, b    
 35                 kernel_neon_end();                
 36                                                   
 37                 nblocks -= blocks;                
 38                 block += blocks * BLAKE2B_BLOC    
 39         } while (nblocks);                        
 40 }                                                 
 41                                                   
 42 static int crypto_blake2b_update_neon(struct s    
 43                                       const u8    
 44 {                                                 
 45         return crypto_blake2b_update(desc, in,    
 46 }                                                 
 47                                                   
 48 static int crypto_blake2b_final_neon(struct sh    
 49 {                                                 
 50         return crypto_blake2b_final(desc, out,    
 51 }                                                 
 52                                                   
 53 #define BLAKE2B_ALG(name, driver_name, digest_    
 54         {                                         
 55                 .base.cra_name          = name    
 56                 .base.cra_driver_name   = driv    
 57                 .base.cra_priority      = 200,    
 58                 .base.cra_flags         = CRYP    
 59                 .base.cra_blocksize     = BLAK    
 60                 .base.cra_ctxsize       = size    
 61                 .base.cra_module        = THIS    
 62                 .digestsize             = dige    
 63                 .setkey                 = cryp    
 64                 .init                   = cryp    
 65                 .update                 = cryp    
 66                 .final                  = cryp    
 67                 .descsize               = size    
 68         }                                         
 69                                                   
 70 static struct shash_alg blake2b_neon_algs[] =     
 71         BLAKE2B_ALG("blake2b-160", "blake2b-16    
 72         BLAKE2B_ALG("blake2b-256", "blake2b-25    
 73         BLAKE2B_ALG("blake2b-384", "blake2b-38    
 74         BLAKE2B_ALG("blake2b-512", "blake2b-51    
 75 };                                                
 76                                                   
 77 static int __init blake2b_neon_mod_init(void)     
 78 {                                                 
 79         if (!(elf_hwcap & HWCAP_NEON))            
 80                 return -ENODEV;                   
 81                                                   
 82         return crypto_register_shashes(blake2b    
 83                                        ARRAY_S    
 84 }                                                 
 85                                                   
 86 static void __exit blake2b_neon_mod_exit(void)    
 87 {                                                 
 88         crypto_unregister_shashes(blake2b_neon    
 89                                   ARRAY_SIZE(b    
 90 }                                                 
 91                                                   
 92 module_init(blake2b_neon_mod_init);               
 93 module_exit(blake2b_neon_mod_exit);               
 94                                                   
 95 MODULE_DESCRIPTION("BLAKE2b digest algorithm,     
 96 MODULE_LICENSE("GPL");                            
 97 MODULE_AUTHOR("Eric Biggers <ebiggers@google.c    
 98 MODULE_ALIAS_CRYPTO("blake2b-160");               
 99 MODULE_ALIAS_CRYPTO("blake2b-160-neon");          
100 MODULE_ALIAS_CRYPTO("blake2b-256");               
101 MODULE_ALIAS_CRYPTO("blake2b-256-neon");          
102 MODULE_ALIAS_CRYPTO("blake2b-384");               
103 MODULE_ALIAS_CRYPTO("blake2b-384-neon");          
104 MODULE_ALIAS_CRYPTO("blake2b-512");               
105 MODULE_ALIAS_CRYPTO("blake2b-512-neon");          
106                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php