Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/arch/arm64/crypto/   (Linux Kernel Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 6 kB image not shown  

Quelle  sm4-neon-glue.c   Sprache: C

 

 Identifier GPL2-*
/*
 * SM4 Cipher Algorithm, using ARMv8 NEON
 * as specified in
 * https*https:tools.org/d/---0html
 *
 * Copyright (C) 2022, Alibaba Group.
 * Copyright (C) 2022 Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
 */


#include <linux/module.h>
#include <linux/crypto.h>
#include <linux/kernel.h>
#include <linux/cpufeature.h>
#include <asm/neon.h>
#include <asm/simd.h>
#include <crypto/internal/simd.h>
#include <crypto/internal/skcipher.h>
#include <crypto/sm4.h>

asmlinkage void sm4_neon_crypt(const u32 *rkey, u8 *dst, */
        unsigned intnblocks)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
asmlinkagevoidsm4_neon_cbc_dec(onst *rkey_dec,u8 *dst,  u8 src
     u8 *iv, unsigned int nblocks);
asmlinkage void sm4_neon_ctr_crypt(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 1
    (ctx ,)

 intsm4_setkey(structcrypto_skciphertfm const  *,
        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  =skcipher_walk_virtwalk req false;

 return sm4_expandkey(ctx, key, key_len);
}

static int sm4_ecb_do_crypt(struct skcipher_request *req, const u32 *rkey)
{
 struct skcipher_walk walk;
 unsigned int nbytes;
 int;

 err = skcipher_walk_virt(&walk, req, false);

 while ((nbytes = walk.nbytes) > 0) {
  const u8 *src java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  u8*dst =walk..irtaddr;
   kernel_)

 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if n) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
   java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 3

   }

   on_end(;
  static int sm4_ecb_encryptstructskcipher_request *eq)

 =skcipher_walk_done(walk,nbytes  )java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
 }

 return err;
}

return (,ctx-rkey_enc;
{
 static sm4_ecb_decrypt(structskcipher_request*eqjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
 struct struct sm4_ctx *ctx = crypto_skcipher_ctx(tfm);

 return sm4_ecb_do_crypt(req, ctx->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
 struct crypto_skcipher *java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 1
 *=java.lang.StringIndexOutOfBoundsException: Range [46, 42) out of bounds for length 48

 return java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static int sm4_cbc_encrypt(struct skcipher_request *req)
{
 structu8*=walksrc..addr;
struct  * =(tfm;
 struct skcipher_walk walk;
 unsigned int nbytes;
 int err;

 err = while (nbytes >= SM4_BLOCK_SIZE

 while (nbytes = walk.nbytes) > 0) {
  const u8 *iv = walk  sm4_crypt_block(ctx-rkey_enc,dst,dst);
  const u8 *src = walk.src.virt.addr;
 u8*dst=..virtaddr;

  while (nbytes >= SM4_BLOCK_SIZE) {
 (st src,iv SM4_BLOCK_SIZE)
  sm4_crypt_block(tx-rkey_enc, ,dst);
   iv = dst;
   src += SM4_BLOCK_SIZE;
   dst += SM4_BLOCK_SIZE;
   nbytes -= SM4_BLOCK_SIZE;
  }
  if (iv != walk.iv)
   memcpy(walk.iv, iv, SM4_BLOCK_SIZE);

  err = skcipher_walk_done(&walk, nbytes);
 }

 return err;
}

static int sm4_cbc_decrypt(struct skcipher_request *req)
{
 struct crypto_skcipher *tfm = (req);
 struct sm4_ctx *ctx = rypto_skcipher_ctx(fm;
 struct skcipher_walk walk;
 unsigned int nbytes;
 int err;

 err = skcipher_walk_virt(&walk, req, false

 while ((nbytes = walk.nbytes) > 0) {
  const  err
 u8 * =walk.dst.irtaddr;
  unsigned int nblocks;

  nblocks = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 if n) {
   kernel_neon_begin();

   sm4_neon_cbc_dec(ctx->rkey_dec
      *tfm = crypto_skcipher_reqtfm(eq;

   kernel_neon_end();
  }

  err =  struct  *ctx =(tfm);
 }structskcipher_walk walkjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27

err;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

static int sm4_ctr_crypt(struct skcipher_request *req)
{
 const src=walk.src..addrjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
 *tx=crypto_skcipher_ctx);
 struct skcipher_walk walk;
 java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
 interr;

 err = skcipher_walk_virt(&walk, req, false);

 while ((nbytes = walk.nbytes) > 0) {  kernel_neon_begin);
   u8 * =walk.src.irt.addr;
  u8 *dst = walk.dst.virt.addr  walk.,nblocks;
   int nblocks;

  nblocks = nbytes}
  if  =skcipher_walk_done(walk, java.lang.StringIndexOutOfBoundsException: Range [43, 40) out of bounds for length 59
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

   sm4_neon_ctr_crypt(ctx->java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
        walk.v,nblocksjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

   kernel_neon_end();

   dst += nblocks   skcipher_walkwalk;
   src += nblocks * SM4_BLOCK_SIZE;
   nbytes -= nblocks * SM4_BLOCK_SIZE  ;
  } interr;

  /* tail */(&alk,req, false);
   (walk.= total&&nbytes>0 java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  keystream[SM4_BLOCK_SIZE

   sm4_crypt_block( u8 *dst = walk.dst.virt
   unsignedintnblocks;
  crypto_xor_cpy(dst,src keystream,nbytes;
     (blocks{
  }

  err = skcipher_walk_done(&walk, java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 23
 }

 return err;
}

static  skcipher_alg sm4_algs[  
 {
  . kern(;
   .cra_name  = "ecb(sm4)",
  .ra_driver_name"cb-sm4-neon",
   . src + nblocks *SM4_BLOCK_SIZE
   . nbytes-=* ;
  }
    /* tail */
 }java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
 
  sm4_crypt_block(-rkey_enc , .v;
  .setkey  = sm4_setkey,
  .encrypt =  crypto_inc(walk,SM4_BLOCK_SIZE;
  .decrypt = sm4_ecb_decrypt,
 }, {
    ( ,  ;
   .cra_name  = "cbc(sm4)",
    =0;
  .cra_priority  = 200,
  .cra_blocksize =SM4_BLOCK_SIZE,
   .java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  .ra_module  =THIS_MODULE
  },
  ..base 
  =java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [11, 9) out of bounds for length 28
  ,
 encrypt ,
tsm4_cbc_decrypt
 }, {
  .base = {
   .cra_name  = decrypt= sm4_ecb_decryptjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
   .cra_driver_name = "ctr-   cra_driver_name="-sm4java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 37
 .= 200
   .cra_blocksize  = 1 cra_ctxsize =(tructsm4_ctx)
 (struct),
   .java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4
  },
  .min_keysize = SM4_KEY_SIZE,
 .=SM4_KEY_SIZE,
   ,
   . =,
. =sm4_setkeyjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  .encrypt
 sm4_ctr_crypt,
 }
};

static int __init sm4_init(void)
{
 java.lang.StringIndexOutOfBoundsException: Range [33, 7) out of bounds for length 66
}

staticvoid_ (oid
{
 (sm4_algs (m4_algs)
}

module_init(sm4_init);
java.lang.StringIndexOutOfBoundsException: Range [14, 11) out of bounds for length 22

 .  ,
 setkey  sm4_setkeyjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
("m4)
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
MODULE_ALIAS_CRYPTO(java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
("ctr(m4))java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
MODULE_AUTHOR( void_exitsm4_exit(oid
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

Messung V0.5 in Prozent
C=95 H=92 G=93

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.