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

TOMOYO Linux Cross Reference
Linux/arch/arm64/crypto/sha512-ce-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/arm64/crypto/sha512-ce-glue.c (Version linux-6.12-rc7) and /arch/m68k/crypto/sha512-ce-glue.c (Version linux-4.12.14)


  1 // SPDX-License-Identifier: GPL-2.0                 1 
  2 /*                                                
  3  * sha512-ce-glue.c - SHA-384/SHA-512 using AR    
  4  *                                                
  5  * Copyright (C) 2018 Linaro Ltd <ard.biesheuv    
  6  *                                                
  7  * This program is free software; you can redi    
  8  * it under the terms of the GNU General Publi    
  9  * published by the Free Software Foundation.     
 10  */                                               
 11                                                   
 12 #include <asm/neon.h>                             
 13 #include <asm/simd.h>                             
 14 #include <linux/unaligned.h>                      
 15 #include <crypto/internal/hash.h>                 
 16 #include <crypto/internal/simd.h>                 
 17 #include <crypto/sha2.h>                          
 18 #include <crypto/sha512_base.h>                   
 19 #include <linux/cpufeature.h>                     
 20 #include <linux/crypto.h>                         
 21 #include <linux/module.h>                         
 22                                                   
 23 MODULE_DESCRIPTION("SHA-384/SHA-512 secure has    
 24 MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@    
 25 MODULE_LICENSE("GPL v2");                         
 26 MODULE_ALIAS_CRYPTO("sha384");                    
 27 MODULE_ALIAS_CRYPTO("sha512");                    
 28                                                   
 29 asmlinkage int __sha512_ce_transform(struct sh    
 30                                      int block    
 31                                                   
 32 asmlinkage void sha512_block_data_order(u64 *d    
 33                                                   
 34 static void sha512_ce_transform(struct sha512_    
 35                                 int blocks)       
 36 {                                                 
 37         while (blocks) {                          
 38                 int rem;                          
 39                                                   
 40                 kernel_neon_begin();              
 41                 rem = __sha512_ce_transform(ss    
 42                 kernel_neon_end();                
 43                 src += (blocks - rem) * SHA512    
 44                 blocks = rem;                     
 45         }                                         
 46 }                                                 
 47                                                   
 48 static void sha512_arm64_transform(struct sha5    
 49                                    int blocks)    
 50 {                                                 
 51         sha512_block_data_order(sst->state, sr    
 52 }                                                 
 53                                                   
 54 static int sha512_ce_update(struct shash_desc     
 55                             unsigned int len)     
 56 {                                                 
 57         sha512_block_fn *fn = crypto_simd_usab    
 58                                                   
 59                                                   
 60         sha512_base_do_update(desc, data, len,    
 61         return 0;                                 
 62 }                                                 
 63                                                   
 64 static int sha512_ce_finup(struct shash_desc *    
 65                            unsigned int len, u    
 66 {                                                 
 67         sha512_block_fn *fn = crypto_simd_usab    
 68                                                   
 69                                                   
 70         sha512_base_do_update(desc, data, len,    
 71         sha512_base_do_finalize(desc, fn);        
 72         return sha512_base_finish(desc, out);     
 73 }                                                 
 74                                                   
 75 static int sha512_ce_final(struct shash_desc *    
 76 {                                                 
 77         sha512_block_fn *fn = crypto_simd_usab    
 78                                                   
 79                                                   
 80         sha512_base_do_finalize(desc, fn);        
 81         return sha512_base_finish(desc, out);     
 82 }                                                 
 83                                                   
 84 static struct shash_alg algs[] = { {              
 85         .init                   = sha384_base_    
 86         .update                 = sha512_ce_up    
 87         .final                  = sha512_ce_fi    
 88         .finup                  = sha512_ce_fi    
 89         .descsize               = sizeof(struc    
 90         .digestsize             = SHA384_DIGES    
 91         .base.cra_name          = "sha384",       
 92         .base.cra_driver_name   = "sha384-ce",    
 93         .base.cra_priority      = 200,            
 94         .base.cra_blocksize     = SHA512_BLOCK    
 95         .base.cra_module        = THIS_MODULE,    
 96 }, {                                              
 97         .init                   = sha512_base_    
 98         .update                 = sha512_ce_up    
 99         .final                  = sha512_ce_fi    
100         .finup                  = sha512_ce_fi    
101         .descsize               = sizeof(struc    
102         .digestsize             = SHA512_DIGES    
103         .base.cra_name          = "sha512",       
104         .base.cra_driver_name   = "sha512-ce",    
105         .base.cra_priority      = 200,            
106         .base.cra_blocksize     = SHA512_BLOCK    
107         .base.cra_module        = THIS_MODULE,    
108 } };                                              
109                                                   
110 static int __init sha512_ce_mod_init(void)        
111 {                                                 
112         return crypto_register_shashes(algs, A    
113 }                                                 
114                                                   
115 static void __exit sha512_ce_mod_fini(void)       
116 {                                                 
117         crypto_unregister_shashes(algs, ARRAY_    
118 }                                                 
119                                                   
120 module_cpu_feature_match(SHA512, sha512_ce_mod    
121 module_exit(sha512_ce_mod_fini);                  
122                                                   

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