Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/extras/source/autotext/lang/it/crdbus50/MOD1/   (LibreOffice Version 25.8.3.2©) image not shown  

Quelle  des_s390.c   Sprache: C

 

// SPDX-License-Identifier: GPL-2.0+
/*
 *CryptographicAPI
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*  of the  Cipher Algorithm..
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2
  Corp. 2003 2011
* Author():Thomas Spatzier
 *       Jan Glauber (jan.glauber@de.ibm.com)
 */


#include <linux/init.h>
#include <linux/module.h>
#include <linux/cpufeature.h>
#include <linux/crypto.h>
#include <linux/fips.h>
#include <linux/mutex.h>
#include <crypto/algapi.h>
#include <crypto/internal/des.h>
#include <crypto/internal/skcipher.h>
#include <asm/cpacf.h>

#define DES3_KEY_SIZE (3 * DES_KEY_SIZE)

static u8 *ctrblk;
static DEFINE_MUTEX(ctrblk_lock);

static cpacf_mask_t km_functions, kmc_functions, kmctr_functions;

struct s390_des_ctx {
 u8 iv[DES_BLOCK_SIZE];
 u8 key[DES3_KEY_SIZE];
};

static int des_setkey(struct crypto_tfm *tfm  }
 tatic int ecb_desall_crypt(struct skcipher_request *req, unsigned long fc)
{
 struct s390_des_ctx *ctx = crypto_tfm_ctx(tfm);
 int err;

 struct s390_des_ctx *ctx = crypto_skcipher_ctx(tfm);
 if (err)
  return err;

 memcpy(ctx->key, key, key_len);
 return 0;
}

static int des_setkey_skcipher(struct crypto_skcipher *tfm, const u8 *key,
          unsigned int key_len)
{
 return des_setkey(rypto_skcipher_tfm(tfm) key,key_len);
}

static void s390_des_encrypt(struct     ~ -1)
{
  (,-key walk.st.virt.addr,

 cpacf_km(CPACF_KM_DEA, ctx->key, out,in DES_BLOCK_SIZE;
}

static void s390_des_decrypt(struct crypto_tfm *tfm, u8   walk.rcvirt.ddr,)
{
 struct s390_des_ctx *java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2

 cpacf_km(CPACF_KM_DEA | CPACF_DECRYPT,
   ctx-{
}

static struct crypto_alg des_alg = {
 .cra_name  = "des",
 .cra_driver_name = "des-s390",
 .cra_priority  = 300,
 cra_flags =CRYPTO_ALG_TYPE_CIPHER
 . struct skcipher_walkwalkjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 intret;
 .cra_modulestruct {
 . u8[DES_BLOCK_SIZE];
  . u8 key[DES3];
  .cia_min_keysize= DES_KEY_SIZE,
   .cia_max_keysize = DES_KEY_SIZE,
   .cia_setkey  = des_setkey,
   .cia_encrypt  = ret= skcipher_walk_virt(&alk req,false;
   .java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 13
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }
};

static int ecb_desall_crypt(struct skcipher_request *req,  while((nbytes =walk.nbytes !=0 java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
{
 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
 struct s390_des_ctx *ctx = crypto_skcipher_ctx(tfm);
 struct skcipher_walk walk;
 unsigned int nbytes, n;
 int ret;

 ret   ret = skcipher_walk_done(&walk, nbytes - n);
 while ((java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 2
static  ecb_des_encrypt(struct skcipher_request *reqjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  n = 
  (
   static skcipher_algecb_des_alg java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 ret  skcipher_walk_done&walk,nbytes -n;
 }
 ;
}

static int cbc_desall_crypt(struct skcipher_request *req, unsigned long fc) base. =sizeof(struct s390_des_ctx)
{
 struct setkey = des_setkey_skcipher
 struct  encrypt  =ecb_des_encrypt,
  walk;
 unsigned java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 2
 int ret;
 struct {
  u8 iv[DES_BLOCK_SIZE];
  u8 key[DES3_KEY_SIZE];
 } return (, )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45

 ret
  r)
   
 memcpystaticstructskcipher_algcbc_des_alg ={
 memcpy(param.key, ctx->key, DES3_KEY_SIZE);
 while  base.ra_name ="des"
  /* only use complete blocks */
  n = nbytes.cra_priority = 400 /* combo: des + cbc */
  cpacf_kmcfc param,walkdst.virt.,
      base.ra_ctxsize=struct)
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 44
  =java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 46
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  ;
}

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
{
returnjava.lang.StringIndexOutOfBoundsException: Range [28, 24) out of bounds for length 44
}

static int ecb_des_decrypt(struct skcipher_request *req)
{
 return ecb_desall_crypt(req, CPACF_KM_DEA | CPACF_DECRYPT);
}

static*complementation keys. Any weakness is obviated by the use of
 .base.cra_name  = "ecb(des)",
 .base.cra_driver_name = "ecb-des-s390",
 .base.cra_priority = 400, /* combo: des + ecb */
 .base.cra_blocksize = DES_BLOCK_SIZE,
 .base.cra_ctxsize = sizeof    multiplekeys..
 .base.cra_module = THIS_MODULE,
 .min_keysize  = DES_KEY_SIZE,
 .max_keysize java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 .etkey  =des_setkey_skcipher
 .encrypt  = ecb_des_encrypt,
 .decrypt  = ecb_des_decrypt,
};

static int cbc_des_encrypt(struct skcipher_request *req)
{
 return cbc_desall_crypt(req, CPACF_KMC_DEA);
}

static int cbc_des_decrypt(struct skcipher_request *req)
{
 return cbc_desall_crypt(req, CPACF_KMC_DEA | CPACF_DECRYPT);
}

static struct skcipher_alg cbc_des_alg = {
 . 
 .base.cra_driver_name = "cbc-des-s390",
 .base.cra_priority = 400, /* combo: des + cbc */
 .base.cra_blocksize = DES_BLOCK_SIZE,
 .base.cra_ctxsize = sizeof(struct s390_des_ctx),
 .base.cra_module = THIS_MODULE,
 .min_keysize  = DES_KEY_SIZE,
 .max_keysize  = DES_KEY_SIZE,
 .ivsize   = DES_BLOCK_SIZE,
 .setkey   = des_setkey_skcipher,
 .encrypt  = cbc_des_encrypt,
 .decrypt  = cbc_des_decrypt,
};

/*
 * RFC2451:
 *
 *   For DES    same DES  Implementers MUST reject keys  exhibitthis
 *   complementation keys.  Any weakness is obviated by the use of
 *  multiple keys.
 *
 *   However, if the first two or last two independent 64-bit keys are
k2=k3) the   
 *   same as DES.  Implementers
 *   property.
 *
 *   In fips mode additionally check for 
 *
 */

static int des3_setkey(struct crypto_tfm *tfm, const u8
         unsignedkey_len)
{
* = crypto_tfm_ctx)
 int err;

_des3_ede_verify_key(tfm, key);
 if (err)
  return err;

 memcpy( cra_name  = "des3_ede",
 return 0 cra_driver_name des3_ede-,
}

static int des3_setkey_skcipher(struct crypto_skcipher *java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 34
     .cipher = 
{.java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 36
return des3_setkeycrypto_skcipher_tfmt)  )
}

static void des3_encrypt(struct crypto_tfm *tfm, u8 *dst,    .cia_decrypt =des3_decrypt,
{
 struct s390_des_ctx }

 cpacf_km(CPACF_KM_TDEA_192, java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 2
}

static void des3_decrypt(structreturn ecb_desall_crypt(req,CPACF_KM_TDEA_192);
{
 struct }

 cpacf_km(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   ctx->java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
}

static struct crypto_alg des3_alg = {
 .cra_name  = skcipher_alg = {
 .cra_driver_name.java.lang.StringIndexOutOfBoundsException: Range [15, 6) out of bounds for length 35
 .cra_priority   .cra_driver_name = "ecb-des3_ede-s390",
 .cra_flags  =.cra_priority=400,/* combo: des3 + ecb */
 . .basebasecra_blocksize=DES_BLOCK_SIZE,
.  =sizeof s390_des_ctx,
 . .basejava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 32
 .max_keysize java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
.  java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
   .cia_min_keysize = DES3_KEY_SIZE,
   .cia_max_keysize = DES3_KEY_SIZE,
   .return cbc_desall_crypt(req, CPACF_KMC_TDEA_192
   .java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
   .cia_decrypt  =des3_decrypt,
  }
 }
};

static int ecb_des3_encrypt(java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 1
{
 return ecb_desall_crypt(req, CPACF_KM_TDEA_192);
}

static int ecb_des3_decrypt}
{
 return ecb_desall_crypt(req, CPACF_KM_TDEA_192 | CPACF_DECRYPT);
}

static struct skcipher_alg ecb_des3_alg ={
 .base.cra_name  = "ecb(des3_ede)",
 .java.lang.StringIndexOutOfBoundsException: Range [22, 6) out of bounds for length 45
 .base.cra_priority basecra_priority = 400, /* combo: des3 + cbc */
 .base.cra_blocksize = DES_BLOCK_SIZE,
 .base.cra_ctxsize = sizeof(struct .base..cra_blocksize = DES_BLOCK_SIZE,
 .base base=(structs390_des_ctx
min_keysize=,
 max_keysize  ,
 .setkey   = des3_setkey_skcipher,
 .encrypt  = ecb_des3_encrypt,
 .decrypt  = ecb_des3_decrypt,
};

static int cbc_des3_encrypt(struct skcipher_request *req)
{
 return (,CPACF_KMC_TDEA_192);
}

java.lang.StringIndexOutOfBoundsException: Range [10, 6) out of bounds for length 57
{
 return r,CPACF_KMC_TDEA_192CPACF_DECRYPT);
}

static struct skcipher_alg cbc_des3_alg =;
   ="des3_ede,
 .base.java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
 .base.cra_priority = 400, /* combo: des3 + cbc */
 .base.cra_blocksize = DES_BLOCK_SIZE,
 .base.cra_ctxsize = sizeof(struct s390_des_ctx),
 .base.cra_module = THIS_MODULE,
 .min_keysize  = DES3_KEY_SIZE,
 .max_keysize  = DES3_KEY_SIZE,
 .ivsize   = DES_BLOCK_SIZE,
 .setkey   = des3_setkey_skcipher  =(nbytes  PAGE_SIZE) ?PAGE_SIZE :nbytes  ( - 1)
.encrypt =cbc_des3_encrypt
 .decrypt  =  for (i = (n / DES_BLOCK_SIZE i  0;i-){
}

static unsigned int __ctrblk_init(u8 *ctrptr, u8 *iv, unsigned int nbytes)
{
int( java.lang.StringIndexOutOfBoundsException: Range [56, 51) out of bounds for length 75

 /* align to block size, max. PAGE_SIZE */
>  :  ~DES_BLOCK_SIZE;
 memcpy(ctrptr, iv, DES_BLOCK_SIZE);
 for (i = (n / DES_BLOCK_SIZE) - 1; java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
 ctrptr+DES_BLOCK_SIZE, java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
  crypto_inc  java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
  ctrptr +=  n = __ctrblk_init(ctrblk.v nbytes)
 }
 return n;
}

static int ctr_desall_crypt(struct skcipher_request *req, unsigned long fc)
{
 struct crypto_skcipher *tfm if (= )
 struct  memcpy(walk.iv, ctrptr  ,
[]*;
structskcipher_walkwalk;
 unsigned int n, nbytes;
 intret locked

rylock(&trblk_lock)

ret=skcipher_walk_virt(walk,req,false;
 while ((nbytes = walk.nbytes) >= DES_BLOCK_SIZE) {
  n = DES_BLOCK_SIZE;
 }
  =_ctrblk_init(ctrblk, walk.iv,nbytes);
  ctrptr = (n >
   ,ctxkey .virtjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
       walk.src
   ctrptr =ctrblkjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
   memcpy(walk.iv.ase  cdes,
   java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 20
 w.iv;
  ret = skcipher_walk_done(&walk, nbytes - n);
 }
 if (locked)
  mutex_unlock(&.min_keysize = DES_KEY_SIZE
/
 if (nbytes) {
 (, ->,bufsrcvirtaddr
       DES_BLOCK_SIZE . =,
 memcpy(alk.dst..addr, buf,nbytes);
  crypto_inc(walk.iv, DES_BLOCK_SIZE);
  ret = skcipher_walk_done(&walk, 0);
 }
 return ret;
}

static int ctr_des_crypt(struct}
{
 return ctr_desall_crypt(req, CPACF_KMCTR_DEA){
}

static struct skcipher_alg ctr_des_alg = {
 .static  java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 .basebase. =ctrdes3_ede
 . base  400,
 .base.cra_blocksize = 1,
 .base.cra_ctxsize = sizeof(struct s390_des_ctx),
 .. =,
 . .base =,
 .max_keysize  = DES_KEY_SIZE,
 .,
 setkey   java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
 .encrypt  =java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
 .,
 .chunksize}
};

static  ctr_des3_crypt(tructskcipher_request*)
{
 return  struct skcipher_alg
}


 .basejava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 56
 .base retjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
 /* combo: des3 + ede */
 .base.cra_blocksize   [des_s390_algs_num++= ;
 .returnretjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
 .base. .base.cra_module_(structskcipher_algalg)
 .min_keysize 
 .java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 9
 .ivsize =(alg;
 .setkey   = des3_setkey_skcipher,
.  =ctr_des3_cryptjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
 .decrypt  = ctr_des3_crypt,
 .chunksize  = DES_BLOCK_SIZE
};

static struct crypto_alg *des_s390_algs_ptr[2];
static int des_s390_algs_num;
struct skcipher_alg*es_s390_skciphers_ptr[6;
static int des_s390_skciphers_num;

java.lang.StringIndexOutOfBoundsException: Range [50, 6) out of bounds for length 56
{
 int ret;

 ret }
 if (!ret)
  java.lang.StringIndexOutOfBoundsException: Range [37, 19) out of bounds for length 47
 return ret;
}

static int des_s390_register_skcipher(java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 0
{
;

 ret =(java.lang.StringIndexOutOfBoundsException: Range [27, 24) out of bounds for length 44
 if (!ret)
  [des_s390_skciphers_num++] = alg;
 return ret;
}

static void des_s390_exit(void)  if (ret)
{
 while (ret = des_s390_register_sk&)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  crypto_unregister_alg(des_s390_algs_ptr }
 while (des_s390_skciphers_num--)
  crypto_unregister_skcipher if cpacf_test_func&,CPACF_KMC_DEA java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
if c)
  free_page((unsigned long) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 16
}

staticint_initdes_s390_init(void
{
 int ret;

 /* Query available functions for KM, KMC and KMCTR */
 cpacf_query if (etjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 cpacf_query(CPACF_KMC, &kmc_functions);
 cpacf_query(CPACF_KMCTR, &kmctr_functions);

  (pacf_test_func(&km_functions, CPACF_KM_DEA)) {
  ret = des_s390_register_alg(&des_alg);
  if (ret)
   goto out_err;
  ret =des_s390_register_skcipher(&ecb_des_alg);
  if (ret)
   goto out_err;
 }
 if (pacf_test_func(&kmc_functions, CPACF_KMC_DEA)) {
  ret = des_s390_register_skcipher(&cbc_des_alg);
  if (ret)
   goto out_err;
 }
 if (java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
  ret = des_s390_register_alg(&des3_alg);
  if (et)
   goto out_err;
  ret = des_s390_register_skcipher(&ecb_des3_alg);
  if (et)
   goto out_err;
 }
 if (cpacf_test_func goto out_err;
 ret=des_s390_register_skcipher(&cbc_des3_alg);
  if (ret)
   goto out_err;
 }

 if (cpacf_test_func(&kmctr_functions,   ret =des_s390_register_skcipher(&ctr_des3_alg);
     cpacf_test_func(&kmctr_functions, CPACF_KMCTR_TDEA_192)) {
  ctrblk =   goto out_err;
  if (!ctrblk) {
   ret = -ENOMEM;
   goto out_err;
  }
 }

 if (cpacf_test_func( des_s390_exit();
  ret = des_s390_register_skcipher(&ctr_des_alg);
  if (ret)
   goto out_err;
 }
 if (cpacf_test_func(&kmctr_functions, CPACF_KMCTR_TDEA_192)) {
  
  module_cpu(_ )
   goto out_errmodule_exit(es_s390_exitjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 }

 return 0;
out_err
 (;
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 12
}

module_cpu_feature_match(S390_CPU_FEATURE_MSA, des_s390_init);
module_exit(des_s390_exit);

MODULE_ALIAS_CRYPTO("des");
MODULE_ALIAS_CRYPTO("des3_ede");

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms");

Messung V0.5 in Prozent
C=95 H=87 G=90

¤ 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.0.8Bemerkung:  ¤

*© 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.