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

TOMOYO Linux Cross Reference
Linux/arch/arm/crypto/nhpoly1305-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/nhpoly1305-neon-glue.c (Version linux-6.12-rc7) and /arch/ppc/crypto/nhpoly1305-neon-glue.c (Version linux-6.4.16)


  1 // SPDX-License-Identifier: GPL-2.0                 1 
  2 /*                                                
  3  * NHPoly1305 - ε-almost-∆-universal hash f    
  4  * (NEON accelerated version)                     
  5  *                                                
  6  * Copyright 2018 Google LLC                      
  7  */                                               
  8                                                   
  9 #include <asm/neon.h>                             
 10 #include <asm/simd.h>                             
 11 #include <crypto/internal/hash.h>                 
 12 #include <crypto/internal/simd.h>                 
 13 #include <crypto/nhpoly1305.h>                    
 14 #include <linux/module.h>                         
 15                                                   
 16 asmlinkage void nh_neon(const u32 *key, const     
 17                         __le64 hash[NH_NUM_PAS    
 18                                                   
 19 static int nhpoly1305_neon_update(struct shash    
 20                                   const u8 *sr    
 21 {                                                 
 22         if (srclen < 64 || !crypto_simd_usable    
 23                 return crypto_nhpoly1305_updat    
 24                                                   
 25         do {                                      
 26                 unsigned int n = min_t(unsigne    
 27                                                   
 28                 kernel_neon_begin();              
 29                 crypto_nhpoly1305_update_helpe    
 30                 kernel_neon_end();                
 31                 src += n;                         
 32                 srclen -= n;                      
 33         } while (srclen);                         
 34         return 0;                                 
 35 }                                                 
 36                                                   
 37 static int nhpoly1305_neon_digest(struct shash    
 38                                   const u8 *sr    
 39 {                                                 
 40         return crypto_nhpoly1305_init(desc) ?:    
 41                nhpoly1305_neon_update(desc, sr    
 42                crypto_nhpoly1305_final(desc, o    
 43 }                                                 
 44                                                   
 45 static struct shash_alg nhpoly1305_alg = {        
 46         .base.cra_name          = "nhpoly1305"    
 47         .base.cra_driver_name   = "nhpoly1305-    
 48         .base.cra_priority      = 200,            
 49         .base.cra_ctxsize       = sizeof(struc    
 50         .base.cra_module        = THIS_MODULE,    
 51         .digestsize             = POLY1305_DIG    
 52         .init                   = crypto_nhpol    
 53         .update                 = nhpoly1305_n    
 54         .final                  = crypto_nhpol    
 55         .digest                 = nhpoly1305_n    
 56         .setkey                 = crypto_nhpol    
 57         .descsize               = sizeof(struc    
 58 };                                                
 59                                                   
 60 static int __init nhpoly1305_mod_init(void)       
 61 {                                                 
 62         if (!(elf_hwcap & HWCAP_NEON))            
 63                 return -ENODEV;                   
 64                                                   
 65         return crypto_register_shash(&nhpoly13    
 66 }                                                 
 67                                                   
 68 static void __exit nhpoly1305_mod_exit(void)      
 69 {                                                 
 70         crypto_unregister_shash(&nhpoly1305_al    
 71 }                                                 
 72                                                   
 73 module_init(nhpoly1305_mod_init);                 
 74 module_exit(nhpoly1305_mod_exit);                 
 75                                                   
 76 MODULE_DESCRIPTION("NHPoly1305 ε-almost-∆-u    
 77 MODULE_LICENSE("GPL v2");                         
 78 MODULE_AUTHOR("Eric Biggers <ebiggers@google.c    
 79 MODULE_ALIAS_CRYPTO("nhpoly1305");                
 80 MODULE_ALIAS_CRYPTO("nhpoly1305-neon");           
 81                                                   

~ [ 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