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

TOMOYO Linux Cross Reference
Linux/arch/arm/crypto/sha256_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/sha256_glue.c (Architecture m68k) and /arch/ppc/crypto/sha256_glue.c (Architecture ppc)


  1 // SPDX-License-Identifier: GPL-2.0-or-later        1 
  2 /*                                                
  3  * Glue code for the SHA256 Secure Hash Algori    
  4  * using optimized ARM assembler and NEON inst    
  5  *                                                
  6  * Copyright © 2015 Google Inc.                  
  7  *                                                
  8  * This file is based on sha256_ssse3_glue.c:     
  9  *   Copyright (C) 2013 Intel Corporation         
 10  *   Author: Tim Chen <tim.c.chen@linux.intel.    
 11  */                                               
 12                                                   
 13 #include <crypto/internal/hash.h>                 
 14 #include <linux/crypto.h>                         
 15 #include <linux/init.h>                           
 16 #include <linux/module.h>                         
 17 #include <linux/mm.h>                             
 18 #include <linux/types.h>                          
 19 #include <linux/string.h>                         
 20 #include <crypto/sha2.h>                          
 21 #include <crypto/sha256_base.h>                   
 22 #include <asm/simd.h>                             
 23 #include <asm/neon.h>                             
 24                                                   
 25 #include "sha256_glue.h"                          
 26                                                   
 27 asmlinkage void sha256_block_data_order(struct    
 28                                         const     
 29                                                   
 30 int crypto_sha256_arm_update(struct shash_desc    
 31                              unsigned int len)    
 32 {                                                 
 33         /* make sure casting to sha256_block_f    
 34         BUILD_BUG_ON(offsetof(struct sha256_st    
 35                                                   
 36         return sha256_base_do_update(desc, dat    
 37 }                                                 
 38 EXPORT_SYMBOL(crypto_sha256_arm_update);          
 39                                                   
 40 static int crypto_sha256_arm_final(struct shas    
 41 {                                                 
 42         sha256_base_do_finalize(desc, sha256_b    
 43         return sha256_base_finish(desc, out);     
 44 }                                                 
 45                                                   
 46 int crypto_sha256_arm_finup(struct shash_desc     
 47                             unsigned int len,     
 48 {                                                 
 49         sha256_base_do_update(desc, data, len,    
 50         return crypto_sha256_arm_final(desc, o    
 51 }                                                 
 52 EXPORT_SYMBOL(crypto_sha256_arm_finup);           
 53                                                   
 54 static struct shash_alg algs[] = { {              
 55         .digestsize     =       SHA256_DIGEST_    
 56         .init           =       sha256_base_in    
 57         .update         =       crypto_sha256_    
 58         .final          =       crypto_sha256_    
 59         .finup          =       crypto_sha256_    
 60         .descsize       =       sizeof(struct     
 61         .base           =       {                 
 62                 .cra_name       =       "sha25    
 63                 .cra_driver_name =      "sha25    
 64                 .cra_priority   =       150,      
 65                 .cra_blocksize  =       SHA256    
 66                 .cra_module     =       THIS_M    
 67         }                                         
 68 }, {                                              
 69         .digestsize     =       SHA224_DIGEST_    
 70         .init           =       sha224_base_in    
 71         .update         =       crypto_sha256_    
 72         .final          =       crypto_sha256_    
 73         .finup          =       crypto_sha256_    
 74         .descsize       =       sizeof(struct     
 75         .base           =       {                 
 76                 .cra_name       =       "sha22    
 77                 .cra_driver_name =      "sha22    
 78                 .cra_priority   =       150,      
 79                 .cra_blocksize  =       SHA224    
 80                 .cra_module     =       THIS_M    
 81         }                                         
 82 } };                                              
 83                                                   
 84 static int __init sha256_mod_init(void)           
 85 {                                                 
 86         int res = crypto_register_shashes(algs    
 87                                                   
 88         if (res < 0)                              
 89                 return res;                       
 90                                                   
 91         if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON    
 92                 res = crypto_register_shashes(    
 93                                                   
 94                                                   
 95                 if (res < 0)                      
 96                         crypto_unregister_shas    
 97         }                                         
 98                                                   
 99         return res;                               
100 }                                                 
101                                                   
102 static void __exit sha256_mod_fini(void)          
103 {                                                 
104         crypto_unregister_shashes(algs, ARRAY_    
105                                                   
106         if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON    
107                 crypto_unregister_shashes(sha2    
108                                           ARRA    
109 }                                                 
110                                                   
111 module_init(sha256_mod_init);                     
112 module_exit(sha256_mod_fini);                     
113                                                   
114 MODULE_LICENSE("GPL");                            
115 MODULE_DESCRIPTION("SHA256 Secure Hash Algorit    
116                                                   
117 MODULE_ALIAS_CRYPTO("sha256");                    
118                                                   

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