Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Thu, 2 May 2013 21:53:12 +0000 (14:53 -0700)]
Pull crypto update from Herbert Xu:

 - XTS mode optimisation for twofish/cast6/camellia/aes on x86

 - AVX2/x86_64 implementation for blowfish/twofish/serpent/camellia

 - SSSE3/AVX/AVX2 optimisations for sha256/sha512

 - Added driver for SAHARA2 crypto accelerator

 - Fix for GMAC when used in non-IPsec secnarios

 - Added generic CMAC implementation (including IPsec glue)

 - IP update for crypto/atmel

 - Support for more than one device in hwrng/timeriomem

 - Added Broadcom BCM2835 RNG driver

 - Misc fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (59 commits)
  crypto: caam - fix job ring cleanup code
  crypto: camellia - add AVX2/AES-NI/x86_64 assembler implementation of camellia cipher
  crypto: serpent - add AVX2/x86_64 assembler implementation of serpent cipher
  crypto: twofish - add AVX2/x86_64 assembler implementation of twofish cipher
  crypto: blowfish - add AVX2/x86_64 implementation of blowfish cipher
  crypto: tcrypt - add async cipher speed tests for blowfish
  crypto: testmgr - extend camellia test-vectors for camellia-aesni/avx2
  crypto: aesni_intel - fix Kconfig problem with CRYPTO_GLUE_HELPER_X86
  crypto: aesni_intel - add more optimized XTS mode for x86-64
  crypto: x86/camellia-aesni-avx - add more optimized XTS code
  crypto: cast6-avx: use new optimized XTS code
  crypto: x86/twofish-avx - use optimized XTS code
  crypto: x86 - add more optimized XTS-mode for serpent-avx
  xfrm: add rfc4494 AES-CMAC-96 support
  crypto: add CMAC support to CryptoAPI
  crypto: testmgr - add empty test vectors for null ciphers
  crypto: testmgr - add AES GMAC test vectors
  crypto: gcm - fix rfc4543 to handle async crypto correctly
  crypto: gcm - make GMAC work when dst and src are different
  hwrng: timeriomem - added devicetree hooks
  ...

1  2 
arch/x86/include/asm/cpufeature.h
crypto/gcm.c
crypto/testmgr.h
drivers/char/hw_random/mxc-rnga.c
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/ctrl.c
drivers/crypto/ux500/hash/hash_core.c

@@@ -9,7 -9,6 +9,7 @@@
  #endif
  
  #define NCAPINTS      10      /* N 32-bit words worth of info */
 +#define NBUGINTS      1       /* N 32-bit bug flags */
  
  /*
   * Note: If the comment begins with a quoted string, that string is used
  #define X86_FEATURE_AMD_DCM     (3*32+27) /* multi-node processor */
  #define X86_FEATURE_APERFMPERF        (3*32+28) /* APERFMPERF */
  #define X86_FEATURE_EAGER_FPU (3*32+29) /* "eagerfpu" Non lazy FPU restore */
 +#define X86_FEATURE_NONSTOP_TSC_S3 (3*32+30) /* TSC doesn't stop in S3 state */
  
  /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
  #define X86_FEATURE_XMM3      (4*32+ 0) /* "pni" SSE-3 */
  #define X86_FEATURE_TOPOEXT   (6*32+22) /* topology extensions CPUID leafs */
  #define X86_FEATURE_PERFCTR_CORE (6*32+23) /* core performance counter extensions */
  #define X86_FEATURE_PERFCTR_NB  (6*32+24) /* NB performance counter extensions */
 +#define X86_FEATURE_PERFCTR_L2        (6*32+28) /* L2 performance counter extensions */
  
  /*
   * Auxiliary flags: Linux defined - For features scattered in various
  #define X86_FEATURE_PTS               (7*32+ 6) /* Intel Package Thermal Status */
  #define X86_FEATURE_DTHERM    (7*32+ 7) /* Digital Thermal Sensor */
  #define X86_FEATURE_HW_PSTATE (7*32+ 8) /* AMD HW-PState */
 +#define X86_FEATURE_PROC_FEEDBACK (7*32+ 9) /* AMD ProcFeedbackInterface */
  
  /* Virtualization flags: Linux defined, word 8 */
  #define X86_FEATURE_TPR_SHADOW  (8*32+ 0) /* Intel TPR Shadow */
  #define X86_FEATURE_ADX               (9*32+19) /* The ADCX and ADOX instructions */
  #define X86_FEATURE_SMAP      (9*32+20) /* Supervisor Mode Access Prevention */
  
 +/*
 + * BUG word(s)
 + */
 +#define X86_BUG(x)            (NCAPINTS*32 + (x))
 +
 +#define X86_BUG_F00F          X86_BUG(0) /* Intel F00F */
 +#define X86_BUG_FDIV          X86_BUG(1) /* FPU FDIV */
 +#define X86_BUG_COMA          X86_BUG(2) /* Cyrix 6x86 coma */
 +#define X86_BUG_AMD_TLB_MMATCH        X86_BUG(3) /* AMD Erratum 383 */
 +#define X86_BUG_AMD_APIC_C1E  X86_BUG(4) /* AMD Erratum 400 */
 +
  #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
  
  #include <asm/asm.h>
@@@ -293,6 -278,7 +293,7 @@@ extern const char * const x86_power_fla
  #define cpu_has_ssse3         boot_cpu_has(X86_FEATURE_SSSE3)
  #define cpu_has_aes           boot_cpu_has(X86_FEATURE_AES)
  #define cpu_has_avx           boot_cpu_has(X86_FEATURE_AVX)
+ #define cpu_has_avx2          boot_cpu_has(X86_FEATURE_AVX2)
  #define cpu_has_ht            boot_cpu_has(X86_FEATURE_HT)
  #define cpu_has_mp            boot_cpu_has(X86_FEATURE_MP)
  #define cpu_has_nx            boot_cpu_has(X86_FEATURE_NX)
  #define cpu_has_pclmulqdq     boot_cpu_has(X86_FEATURE_PCLMULQDQ)
  #define cpu_has_perfctr_core  boot_cpu_has(X86_FEATURE_PERFCTR_CORE)
  #define cpu_has_perfctr_nb    boot_cpu_has(X86_FEATURE_PERFCTR_NB)
 +#define cpu_has_perfctr_l2    boot_cpu_has(X86_FEATURE_PERFCTR_L2)
  #define cpu_has_cx8           boot_cpu_has(X86_FEATURE_CX8)
  #define cpu_has_cx16          boot_cpu_has(X86_FEATURE_CX16)
  #define cpu_has_eager_fpu     boot_cpu_has(X86_FEATURE_EAGER_FPU)
@@@ -417,13 -402,6 +418,13 @@@ static __always_inline __pure bool __st
  #define static_cpu_has(bit) boot_cpu_has(bit)
  #endif
  
 +#define cpu_has_bug(c, bit)   cpu_has(c, (bit))
 +#define set_cpu_bug(c, bit)   set_cpu_cap(c, (bit))
 +#define clear_cpu_bug(c, bit) clear_cpu_cap(c, (bit));
 +
 +#define static_cpu_has_bug(bit)       static_cpu_has((bit))
 +#define boot_cpu_has_bug(bit) cpu_has_bug(&boot_cpu_data, (bit))
 +
  #endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */
  
  #endif /* _ASM_X86_CPUFEATURE_H */
diff --combined crypto/gcm.c
@@@ -37,14 -37,19 +37,20 @@@ struct crypto_rfc4106_ctx 
        u8 nonce[4];
  };
  
+ struct crypto_rfc4543_instance_ctx {
+       struct crypto_aead_spawn aead;
+       struct crypto_skcipher_spawn null;
+ };
  struct crypto_rfc4543_ctx {
        struct crypto_aead *child;
+       struct crypto_blkcipher *null;
        u8 nonce[4];
  };
  
  struct crypto_rfc4543_req_ctx {
        u8 auth_tag[16];
 +      u8 assocbuf[32];
        struct scatterlist cipher[1];
        struct scatterlist payload[2];
        struct scatterlist assoc[2];
@@@ -1094,21 -1099,36 +1100,36 @@@ static int crypto_rfc4543_setauthsize(s
        return crypto_aead_setauthsize(ctx->child, authsize);
  }
  
+ static void crypto_rfc4543_done(struct crypto_async_request *areq, int err)
+ {
+       struct aead_request *req = areq->data;
+       struct crypto_aead *aead = crypto_aead_reqtfm(req);
+       struct crypto_rfc4543_req_ctx *rctx = crypto_rfc4543_reqctx(req);
+       if (!err) {
+               scatterwalk_map_and_copy(rctx->auth_tag, req->dst,
+                                        req->cryptlen,
+                                        crypto_aead_authsize(aead), 1);
+       }
+       aead_request_complete(req, err);
+ }
  static struct aead_request *crypto_rfc4543_crypt(struct aead_request *req,
-                                                int enc)
+                                                bool enc)
  {
        struct crypto_aead *aead = crypto_aead_reqtfm(req);
        struct crypto_rfc4543_ctx *ctx = crypto_aead_ctx(aead);
        struct crypto_rfc4543_req_ctx *rctx = crypto_rfc4543_reqctx(req);
        struct aead_request *subreq = &rctx->subreq;
-       struct scatterlist *dst = req->dst;
+       struct scatterlist *src = req->src;
        struct scatterlist *cipher = rctx->cipher;
        struct scatterlist *payload = rctx->payload;
        struct scatterlist *assoc = rctx->assoc;
        unsigned int authsize = crypto_aead_authsize(aead);
        unsigned int assoclen = req->assoclen;
-       struct page *dstp;
-       u8 *vdst;
+       struct page *srcp;
+       u8 *vsrc;
        u8 *iv = PTR_ALIGN((u8 *)(rctx + 1) + crypto_aead_reqsize(ctx->child),
                           crypto_aead_alignmask(ctx->child) + 1);
  
        if (enc)
                memset(rctx->auth_tag, 0, authsize);
        else
-               scatterwalk_map_and_copy(rctx->auth_tag, dst,
+               scatterwalk_map_and_copy(rctx->auth_tag, src,
                                         req->cryptlen - authsize,
                                         authsize, 0);
  
        sg_init_one(cipher, rctx->auth_tag, authsize);
  
        /* construct the aad */
-       dstp = sg_page(dst);
-       vdst = PageHighMem(dstp) ? NULL : page_address(dstp) + dst->offset;
+       srcp = sg_page(src);
+       vsrc = PageHighMem(srcp) ? NULL : page_address(srcp) + src->offset;
  
        sg_init_table(payload, 2);
        sg_set_buf(payload, req->iv, 8);
-       scatterwalk_crypto_chain(payload, dst, vdst == req->iv + 8, 2);
+       scatterwalk_crypto_chain(payload, src, vsrc == req->iv + 8, 2);
        assoclen += 8 + req->cryptlen - (enc ? 0 : authsize);
  
 -      sg_init_table(assoc, 2);
 -      sg_set_page(assoc, sg_page(req->assoc), req->assoc->length,
 -                  req->assoc->offset);
 +      if (req->assoc->length == req->assoclen) {
 +              sg_init_table(assoc, 2);
 +              sg_set_page(assoc, sg_page(req->assoc), req->assoc->length,
 +                          req->assoc->offset);
 +      } else {
 +              BUG_ON(req->assoclen > sizeof(rctx->assocbuf));
 +
 +              scatterwalk_map_and_copy(rctx->assocbuf, req->assoc, 0,
 +                                       req->assoclen, 0);
 +
 +              sg_init_table(assoc, 2);
 +              sg_set_buf(assoc, rctx->assocbuf, req->assoclen);
 +      }
        scatterwalk_crypto_chain(assoc, payload, 0, 2);
  
        aead_request_set_tfm(subreq, ctx->child);
-       aead_request_set_callback(subreq, req->base.flags, req->base.complete,
-                                 req->base.data);
+       aead_request_set_callback(subreq, req->base.flags, crypto_rfc4543_done,
+                                 req);
        aead_request_set_crypt(subreq, cipher, cipher, enc ? 0 : authsize, iv);
        aead_request_set_assoc(subreq, assoc, assoclen);
  
        return subreq;
  }
  
+ static int crypto_rfc4543_copy_src_to_dst(struct aead_request *req, bool enc)
+ {
+       struct crypto_aead *aead = crypto_aead_reqtfm(req);
+       struct crypto_rfc4543_ctx *ctx = crypto_aead_ctx(aead);
+       unsigned int authsize = crypto_aead_authsize(aead);
+       unsigned int nbytes = req->cryptlen - (enc ? 0 : authsize);
+       struct blkcipher_desc desc = {
+               .tfm = ctx->null,
+       };
+       return crypto_blkcipher_encrypt(&desc, req->dst, req->src, nbytes);
+ }
  static int crypto_rfc4543_encrypt(struct aead_request *req)
  {
        struct crypto_aead *aead = crypto_aead_reqtfm(req);
        struct aead_request *subreq;
        int err;
  
-       subreq = crypto_rfc4543_crypt(req, 1);
+       if (req->src != req->dst) {
+               err = crypto_rfc4543_copy_src_to_dst(req, true);
+               if (err)
+                       return err;
+       }
+       subreq = crypto_rfc4543_crypt(req, true);
        err = crypto_aead_encrypt(subreq);
        if (err)
                return err;
  
  static int crypto_rfc4543_decrypt(struct aead_request *req)
  {
-       req = crypto_rfc4543_crypt(req, 0);
+       int err;
+       if (req->src != req->dst) {
+               err = crypto_rfc4543_copy_src_to_dst(req, false);
+               if (err)
+                       return err;
+       }
+       req = crypto_rfc4543_crypt(req, false);
  
        return crypto_aead_decrypt(req);
  }
  static int crypto_rfc4543_init_tfm(struct crypto_tfm *tfm)
  {
        struct crypto_instance *inst = (void *)tfm->__crt_alg;
-       struct crypto_aead_spawn *spawn = crypto_instance_ctx(inst);
+       struct crypto_rfc4543_instance_ctx *ictx = crypto_instance_ctx(inst);
+       struct crypto_aead_spawn *spawn = &ictx->aead;
        struct crypto_rfc4543_ctx *ctx = crypto_tfm_ctx(tfm);
        struct crypto_aead *aead;
+       struct crypto_blkcipher *null;
        unsigned long align;
+       int err = 0;
  
        aead = crypto_spawn_aead(spawn);
        if (IS_ERR(aead))
                return PTR_ERR(aead);
  
+       null = crypto_spawn_blkcipher(&ictx->null.base);
+       err = PTR_ERR(null);
+       if (IS_ERR(null))
+               goto err_free_aead;
        ctx->child = aead;
+       ctx->null = null;
  
        align = crypto_aead_alignmask(aead);
        align &= ~(crypto_tfm_ctx_alignment() - 1);
                                align + 16;
  
        return 0;
+ err_free_aead:
+       crypto_free_aead(aead);
+       return err;
  }
  
  static void crypto_rfc4543_exit_tfm(struct crypto_tfm *tfm)
        struct crypto_rfc4543_ctx *ctx = crypto_tfm_ctx(tfm);
  
        crypto_free_aead(ctx->child);
+       crypto_free_blkcipher(ctx->null);
  }
  
  static struct crypto_instance *crypto_rfc4543_alloc(struct rtattr **tb)
        struct crypto_instance *inst;
        struct crypto_aead_spawn *spawn;
        struct crypto_alg *alg;
+       struct crypto_rfc4543_instance_ctx *ctx;
        const char *ccm_name;
        int err;
  
        if (IS_ERR(ccm_name))
                return ERR_CAST(ccm_name);
  
-       inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL);
+       inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
        if (!inst)
                return ERR_PTR(-ENOMEM);
  
-       spawn = crypto_instance_ctx(inst);
+       ctx = crypto_instance_ctx(inst);
+       spawn = &ctx->aead;
        crypto_set_aead_spawn(spawn, inst);
        err = crypto_grab_aead(spawn, ccm_name, 0,
                               crypto_requires_sync(algt->type, algt->mask));
  
        alg = crypto_aead_spawn_alg(spawn);
  
+       crypto_set_skcipher_spawn(&ctx->null, inst);
+       err = crypto_grab_skcipher(&ctx->null, "ecb(cipher_null)", 0,
+                                  CRYPTO_ALG_ASYNC);
+       if (err)
+               goto out_drop_alg;
+       crypto_skcipher_spawn_alg(&ctx->null);
        err = -EINVAL;
  
        /* We only support 16-byte blocks. */
        if (alg->cra_aead.ivsize != 16)
-               goto out_drop_alg;
+               goto out_drop_ecbnull;
  
        /* Not a stream cipher? */
        if (alg->cra_blocksize != 1)
-               goto out_drop_alg;
+               goto out_drop_ecbnull;
  
        err = -ENAMETOOLONG;
        if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME,
            snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME,
                     "rfc4543(%s)", alg->cra_driver_name) >=
            CRYPTO_MAX_ALG_NAME)
-               goto out_drop_alg;
+               goto out_drop_ecbnull;
  
        inst->alg.cra_flags = CRYPTO_ALG_TYPE_AEAD;
        inst->alg.cra_flags |= alg->cra_flags & CRYPTO_ALG_ASYNC;
  out:
        return inst;
  
+ out_drop_ecbnull:
+       crypto_drop_skcipher(&ctx->null);
  out_drop_alg:
        crypto_drop_aead(spawn);
  out_free_inst:
  
  static void crypto_rfc4543_free(struct crypto_instance *inst)
  {
-       crypto_drop_spawn(crypto_instance_ctx(inst));
+       struct crypto_rfc4543_instance_ctx *ctx = crypto_instance_ctx(inst);
+       crypto_drop_aead(&ctx->aead);
+       crypto_drop_skcipher(&ctx->null);
        kfree(inst);
  }
  
diff --combined crypto/testmgr.h
@@@ -1639,6 -1639,131 +1639,131 @@@ static struct hash_testvec hmac_sha256_
        },
  };
  
+ #define CMAC_AES_TEST_VECTORS 6
+ static struct hash_testvec aes_cmac128_tv_template[] = {
+       { /* From NIST Special Publication 800-38B, AES-128 */
+               .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
+                                 "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
+               .plaintext      = zeroed_string,
+               .digest         = "\xbb\x1d\x69\x29\xe9\x59\x37\x28"
+                                 "\x7f\xa3\x7d\x12\x9b\x75\x67\x46",
+               .psize          = 0,
+               .ksize          = 16,
+       }, {
+               .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
+                                 "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
+               .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                                 "\xe9\x3d\x7e\x11\x73\x93\x17\x2a",
+               .digest         = "\x07\x0a\x16\xb4\x6b\x4d\x41\x44"
+                                 "\xf7\x9b\xdd\x9d\xd0\x4a\x28\x7c",
+               .psize          = 16,
+               .ksize          = 16,
+       }, {
+               .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
+                                 "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
+               .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                                 "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                                 "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                                 "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
+                                 "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11",
+               .digest         = "\xdf\xa6\x67\x47\xde\x9a\xe6\x30"
+                                 "\x30\xca\x32\x61\x14\x97\xc8\x27",
+               .psize          = 40,
+               .ksize          = 16,
+       }, {
+               .key            = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6"
+                                 "\xab\xf7\x15\x88\x09\xcf\x4f\x3c",
+               .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                                 "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                                 "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                                 "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
+                                 "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
+                                 "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
+                                 "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
+                                 "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
+               .digest         = "\x51\xf0\xbe\xbf\x7e\x3b\x9d\x92"
+                                 "\xfc\x49\x74\x17\x79\x36\x3c\xfe",
+               .psize          = 64,
+               .ksize          = 16,
+       }, { /* From NIST Special Publication 800-38B, AES-256 */
+               .key            = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
+                                 "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
+                                 "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
+                                 "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
+               .plaintext      = zeroed_string,
+               .digest         = "\x02\x89\x62\xf6\x1b\x7b\xf8\x9e"
+                                 "\xfc\x6b\x55\x1f\x46\x67\xd9\x83",
+               .psize          = 0,
+               .ksize          = 32,
+       }, {
+               .key            = "\x60\x3d\xeb\x10\x15\xca\x71\xbe"
+                                 "\x2b\x73\xae\xf0\x85\x7d\x77\x81"
+                                 "\x1f\x35\x2c\x07\x3b\x61\x08\xd7"
+                                 "\x2d\x98\x10\xa3\x09\x14\xdf\xf4",
+               .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                                 "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                                 "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                                 "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51"
+                                 "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11"
+                                 "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef"
+                                 "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17"
+                                 "\xad\x2b\x41\x7b\xe6\x6c\x37\x10",
+               .digest         = "\xe1\x99\x21\x90\x54\x9f\x6e\xd5"
+                                 "\x69\x6a\x2c\x05\x6c\x31\x54\x10",
+               .psize          = 64,
+               .ksize          = 32,
+       }
+ };
+ #define CMAC_DES3_EDE_TEST_VECTORS 4
+ static struct hash_testvec des3_ede_cmac64_tv_template[] = {
+ /*
+  * From NIST Special Publication 800-38B, Three Key TDEA
+  * Corrected test vectors from:
+  *  http://csrc.nist.gov/publications/nistpubs/800-38B/Updated_CMAC_Examples.pdf
+  */
+       {
+               .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
+                                 "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
+                                 "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
+               .plaintext      = zeroed_string,
+               .digest         = "\xb7\xa6\x88\xe1\x22\xff\xaf\x95",
+               .psize          = 0,
+               .ksize          = 24,
+       }, {
+               .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
+                                 "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
+                                 "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
+               .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96",
+               .digest         = "\x8e\x8f\x29\x31\x36\x28\x37\x97",
+               .psize          = 8,
+               .ksize          = 24,
+       }, {
+               .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
+                                 "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
+                                 "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
+               .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                                 "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                                 "\xae\x2d\x8a\x57",
+               .digest         = "\x74\x3d\xdb\xe0\xce\x2d\xc2\xed",
+               .psize          = 20,
+               .ksize          = 24,
+       }, {
+               .key            = "\x8a\xa8\x3b\xf8\xcb\xda\x10\x62"
+                                 "\x0b\xc1\xbf\x19\xfb\xb6\xcd\x58"
+                                 "\xbc\x31\x3d\x4a\x37\x1c\xa8\xb5",
+               .plaintext      = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96"
+                                 "\xe9\x3d\x7e\x11\x73\x93\x17\x2a"
+                                 "\xae\x2d\x8a\x57\x1e\x03\xac\x9c"
+                                 "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51",
+               .digest         = "\x33\xe6\xb1\x09\x24\x00\xea\xe5",
+               .psize          = 32,
+               .ksize          = 24,
+       }
+ };
  #define XCBC_AES_TEST_VECTORS 6
  
  static struct hash_testvec aes_xcbc128_tv_template[] = {
@@@ -12680,6 -12805,8 +12805,8 @@@ static struct cipher_testvec cast6_xts_
  #define AES_GCM_DEC_TEST_VECTORS 8
  #define AES_GCM_4106_ENC_TEST_VECTORS 7
  #define AES_GCM_4106_DEC_TEST_VECTORS 7
+ #define AES_GCM_4543_ENC_TEST_VECTORS 1
+ #define AES_GCM_4543_DEC_TEST_VECTORS 2
  #define AES_CCM_ENC_TEST_VECTORS 7
  #define AES_CCM_DEC_TEST_VECTORS 7
  #define AES_CCM_4309_ENC_TEST_VECTORS 7
@@@ -18193,6 -18320,93 +18320,93 @@@ static struct aead_testvec aes_gcm_rfc4
        }
  };
  
+ static struct aead_testvec aes_gcm_rfc4543_enc_tv_template[] = {
+       { /* From draft-mcgrew-gcm-test-01 */
+               .key    = "\x4c\x80\xcd\xef\xbb\x5d\x10\xda"
+                         "\x90\x6a\xc7\x3c\x36\x13\xa6\x34"
+                         "\x22\x43\x3c\x64",
+               .klen   = 20,
+               .iv     = zeroed_string,
+               .assoc  = "\x00\x00\x43\x21\x00\x00\x00\x07",
+               .alen   = 8,
+               .input  = "\x45\x00\x00\x30\xda\x3a\x00\x00"
+                         "\x80\x01\xdf\x3b\xc0\xa8\x00\x05"
+                         "\xc0\xa8\x00\x01\x08\x00\xc6\xcd"
+                         "\x02\x00\x07\x00\x61\x62\x63\x64"
+                         "\x65\x66\x67\x68\x69\x6a\x6b\x6c"
+                         "\x6d\x6e\x6f\x70\x71\x72\x73\x74"
+                         "\x01\x02\x02\x01",
+               .ilen   = 52,
+               .result = "\x45\x00\x00\x30\xda\x3a\x00\x00"
+                         "\x80\x01\xdf\x3b\xc0\xa8\x00\x05"
+                         "\xc0\xa8\x00\x01\x08\x00\xc6\xcd"
+                         "\x02\x00\x07\x00\x61\x62\x63\x64"
+                         "\x65\x66\x67\x68\x69\x6a\x6b\x6c"
+                         "\x6d\x6e\x6f\x70\x71\x72\x73\x74"
+                         "\x01\x02\x02\x01\xf2\xa9\xa8\x36"
+                         "\xe1\x55\x10\x6a\xa8\xdc\xd6\x18"
+                         "\xe4\x09\x9a\xaa",
+               .rlen   = 68,
+       }
+ };
+ static struct aead_testvec aes_gcm_rfc4543_dec_tv_template[] = {
+       { /* From draft-mcgrew-gcm-test-01 */
+               .key    = "\x4c\x80\xcd\xef\xbb\x5d\x10\xda"
+                         "\x90\x6a\xc7\x3c\x36\x13\xa6\x34"
+                         "\x22\x43\x3c\x64",
+               .klen   = 20,
+               .iv     = zeroed_string,
+               .assoc  = "\x00\x00\x43\x21\x00\x00\x00\x07",
+               .alen   = 8,
+               .input  = "\x45\x00\x00\x30\xda\x3a\x00\x00"
+                         "\x80\x01\xdf\x3b\xc0\xa8\x00\x05"
+                         "\xc0\xa8\x00\x01\x08\x00\xc6\xcd"
+                         "\x02\x00\x07\x00\x61\x62\x63\x64"
+                         "\x65\x66\x67\x68\x69\x6a\x6b\x6c"
+                         "\x6d\x6e\x6f\x70\x71\x72\x73\x74"
+                         "\x01\x02\x02\x01\xf2\xa9\xa8\x36"
+                         "\xe1\x55\x10\x6a\xa8\xdc\xd6\x18"
+                         "\xe4\x09\x9a\xaa",
+               .ilen   = 68,
+               .result = "\x45\x00\x00\x30\xda\x3a\x00\x00"
+                         "\x80\x01\xdf\x3b\xc0\xa8\x00\x05"
+                         "\xc0\xa8\x00\x01\x08\x00\xc6\xcd"
+                         "\x02\x00\x07\x00\x61\x62\x63\x64"
+                         "\x65\x66\x67\x68\x69\x6a\x6b\x6c"
+                         "\x6d\x6e\x6f\x70\x71\x72\x73\x74"
+                         "\x01\x02\x02\x01",
+               .rlen   = 52,
+       }, { /* nearly same as previous, but should fail */
+               .key    = "\x4c\x80\xcd\xef\xbb\x5d\x10\xda"
+                         "\x90\x6a\xc7\x3c\x36\x13\xa6\x34"
+                         "\x22\x43\x3c\x64",
+               .klen   = 20,
+               .iv     = zeroed_string,
+               .assoc  = "\x00\x00\x43\x21\x00\x00\x00\x07",
+               .alen   = 8,
+               .input  = "\x45\x00\x00\x30\xda\x3a\x00\x00"
+                         "\x80\x01\xdf\x3b\xc0\xa8\x00\x05"
+                         "\xc0\xa8\x00\x01\x08\x00\xc6\xcd"
+                         "\x02\x00\x07\x00\x61\x62\x63\x64"
+                         "\x65\x66\x67\x68\x69\x6a\x6b\x6c"
+                         "\x6d\x6e\x6f\x70\x71\x72\x73\x74"
+                         "\x01\x02\x02\x01\xf2\xa9\xa8\x36"
+                         "\xe1\x55\x10\x6a\xa8\xdc\xd6\x18"
+                         "\x00\x00\x00\x00",
+               .ilen   = 68,
+               .novrfy = 1,
+               .result = "\x45\x00\x00\x30\xda\x3a\x00\x00"
+                         "\x80\x01\xdf\x3b\xc0\xa8\x00\x05"
+                         "\xc0\xa8\x00\x01\x08\x00\xc6\xcd"
+                         "\x02\x00\x07\x00\x61\x62\x63\x64"
+                         "\x65\x66\x67\x68\x69\x6a\x6b\x6c"
+                         "\x6d\x6e\x6f\x70\x71\x72\x73\x74"
+                         "\x01\x02\x02\x01",
+               .rlen   = 52,
+       },
+ };
  static struct aead_testvec aes_ccm_enc_tv_template[] = {
        { /* From RFC 3610 */
                .key    = "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7"
@@@ -20783,8 -20997,72 +20997,72 @@@ static struct cipher_testvec camellia_e
                          "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
                          "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
                          "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
-                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
-               .ilen   = 496,
+                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
+                         "\x2B\xC2\x59\xF0\x64\xFB\x92\x06"
+                         "\x9D\x34\xCB\x3F\xD6\x6D\x04\x78"
+                         "\x0F\xA6\x1A\xB1\x48\xDF\x53\xEA"
+                         "\x81\x18\x8C\x23\xBA\x2E\xC5\x5C"
+                         "\xF3\x67\xFE\x95\x09\xA0\x37\xCE"
+                         "\x42\xD9\x70\x07\x7B\x12\xA9\x1D"
+                         "\xB4\x4B\xE2\x56\xED\x84\x1B\x8F"
+                         "\x26\xBD\x31\xC8\x5F\xF6\x6A\x01"
+                         "\x98\x0C\xA3\x3A\xD1\x45\xDC\x73"
+                         "\x0A\x7E\x15\xAC\x20\xB7\x4E\xE5"
+                         "\x59\xF0\x87\x1E\x92\x29\xC0\x34"
+                         "\xCB\x62\xF9\x6D\x04\x9B\x0F\xA6"
+                         "\x3D\xD4\x48\xDF\x76\x0D\x81\x18"
+                         "\xAF\x23\xBA\x51\xE8\x5C\xF3\x8A"
+                         "\x21\x95\x2C\xC3\x37\xCE\x65\xFC"
+                         "\x70\x07\x9E\x12\xA9\x40\xD7\x4B"
+                         "\xE2\x79\x10\x84\x1B\xB2\x26\xBD"
+                         "\x54\xEB\x5F\xF6\x8D\x01\x98\x2F"
+                         "\xC6\x3A\xD1\x68\xFF\x73\x0A\xA1"
+                         "\x15\xAC\x43\xDA\x4E\xE5\x7C\x13"
+                         "\x87\x1E\xB5\x29\xC0\x57\xEE\x62"
+                         "\xF9\x90\x04\x9B\x32\xC9\x3D\xD4"
+                         "\x6B\x02\x76\x0D\xA4\x18\xAF\x46"
+                         "\xDD\x51\xE8\x7F\x16\x8A\x21\xB8"
+                         "\x2C\xC3\x5A\xF1\x65\xFC\x93\x07"
+                         "\x9E\x35\xCC\x40\xD7\x6E\x05\x79"
+                         "\x10\xA7\x1B\xB2\x49\xE0\x54\xEB"
+                         "\x82\x19\x8D\x24\xBB\x2F\xC6\x5D"
+                         "\xF4\x68\xFF\x96\x0A\xA1\x38\xCF"
+                         "\x43\xDA\x71\x08\x7C\x13\xAA\x1E"
+                         "\xB5\x4C\xE3\x57\xEE\x85\x1C\x90"
+                         "\x27\xBE\x32\xC9\x60\xF7\x6B\x02"
+                         "\x99\x0D\xA4\x3B\xD2\x46\xDD\x74"
+                         "\x0B\x7F\x16\xAD\x21\xB8\x4F\xE6"
+                         "\x5A\xF1\x88\x1F\x93\x2A\xC1\x35"
+                         "\xCC\x63\xFA\x6E\x05\x9C\x10\xA7"
+                         "\x3E\xD5\x49\xE0\x77\x0E\x82\x19"
+                         "\xB0\x24\xBB\x52\xE9\x5D\xF4\x8B"
+                         "\x22\x96\x2D\xC4\x38\xCF\x66\xFD"
+                         "\x71\x08\x9F\x13\xAA\x41\xD8\x4C"
+                         "\xE3\x7A\x11\x85\x1C\xB3\x27\xBE"
+                         "\x55\xEC\x60\xF7\x8E\x02\x99\x30"
+                         "\xC7\x3B\xD2\x69\x00\x74\x0B\xA2"
+                         "\x16\xAD\x44\xDB\x4F\xE6\x7D\x14"
+                         "\x88\x1F\xB6\x2A\xC1\x58\xEF\x63"
+                         "\xFA\x91\x05\x9C\x33\xCA\x3E\xD5"
+                         "\x6C\x03\x77\x0E\xA5\x19\xB0\x47"
+                         "\xDE\x52\xE9\x80\x17\x8B\x22\xB9"
+                         "\x2D\xC4\x5B\xF2\x66\xFD\x94\x08"
+                         "\x9F\x36\xCD\x41\xD8\x6F\x06\x7A"
+                         "\x11\xA8\x1C\xB3\x4A\xE1\x55\xEC"
+                         "\x83\x1A\x8E\x25\xBC\x30\xC7\x5E"
+                         "\xF5\x69\x00\x97\x0B\xA2\x39\xD0"
+                         "\x44\xDB\x72\x09\x7D\x14\xAB\x1F"
+                         "\xB6\x4D\xE4\x58\xEF\x86\x1D\x91"
+                         "\x28\xBF\x33\xCA\x61\xF8\x6C\x03"
+                         "\x9A\x0E\xA5\x3C\xD3\x47\xDE\x75"
+                         "\x0C\x80\x17\xAE\x22\xB9\x50\xE7"
+                         "\x5B\xF2\x89\x20\x94\x2B\xC2\x36"
+                         "\xCD\x64\xFB\x6F\x06\x9D\x11\xA8"
+                         "\x3F\xD6\x4A\xE1\x78\x0F\x83\x1A"
+                         "\xB1\x25\xBC\x53\xEA\x5E\xF5\x8C"
+                         "\x00\x97\x2E\xC5\x39\xD0\x67\xFE"
+                         "\x72\x09\xA0\x14\xAB\x42\xD9\x4D",
+               .ilen   = 1008,
                .result = "\xED\xCD\xDB\xB8\x68\xCE\xBD\xEA"
                          "\x9D\x9D\xCD\x9F\x4F\xFC\x4D\xB7"
                          "\xA5\xFF\x6F\x43\x0F\xBA\x32\x04"
                          "\x2C\x35\x1B\x38\x85\x7D\xE8\xF3"
                          "\x87\x4F\xDA\xD8\x5F\xFC\xB6\x44"
                          "\xD0\xE3\x9B\x8B\xBF\xD6\xB8\xC4"
-                         "\x73\xAE\x1D\x8B\x5B\x74\x8B\xCB",
-               .rlen   = 496,
+                         "\x73\xAE\x1D\x8B\x5B\x74\x8B\xCB"
+                         "\xA4\xAD\xCF\x5D\xD4\x58\xC9\xCD"
+                         "\xF7\x90\x68\xCF\xC9\x11\x52\x3E"
+                         "\xE8\xA1\xA3\x78\x8B\xD0\xAC\x0A"
+                         "\xD4\xC9\xA3\xA5\x55\x30\xC8\x3E"
+                         "\xED\x28\x39\xE9\x63\xED\x41\x70"
+                         "\x51\xE3\xC4\xA0\xFC\xD5\x43\xCB"
+                         "\x4D\x65\xC8\xFD\x3A\x91\x8F\x60"
+                         "\x8A\xA6\x6D\x9D\x3E\x01\x23\x4B"
+                         "\x50\x47\xC9\xDC\x9B\xDE\x37\xC5"
+                         "\xBF\x67\xB1\x6B\x78\x38\xD5\x7E"
+                         "\xB6\xFF\x67\x83\x3B\x6E\xBE\x23"
+                         "\x45\xFA\x1D\x69\x44\xFD\xC6\xB9"
+                         "\xD0\x4A\x92\xD1\xBE\xF6\x4A\xB7"
+                         "\xCA\xA8\xA2\x9E\x13\x87\x57\x92"
+                         "\x64\x7C\x85\x0B\xB3\x29\x37\xD8"
+                         "\xE6\xAA\xAF\xC4\x03\x67\xA3\xBF"
+                         "\x2E\x45\x83\xB6\xD8\x54\x00\x89"
+                         "\xF6\xBC\x3A\x7A\x88\x58\x51\xED"
+                         "\xF4\x4E\x01\xA5\xC3\x2E\xD9\x42"
+                         "\xBD\x6E\x0D\x0B\x21\xB0\x1A\xCC"
+                         "\xA4\xD3\x3F\xDC\x9B\x81\xD8\xF1"
+                         "\xEA\x7A\x6A\xB7\x07\xC9\x6D\x91"
+                         "\x6D\x3A\xF5\x5F\xA6\xFF\x87\x1E"
+                         "\x3F\xDD\xC0\x72\xEA\xAC\x08\x15"
+                         "\x21\xE6\xC6\xB6\x0D\xD8\x51\x86"
+                         "\x2A\x03\x73\xF7\x29\xD4\xC4\xE4"
+                         "\x7F\x95\x10\xF7\xAB\x3F\x92\x23"
+                         "\xD3\xCE\x9C\x2E\x46\x3B\x63\x43"
+                         "\xBB\xC2\x82\x7A\x83\xD5\x55\xE2"
+                         "\xE7\x9B\x2F\x92\xAF\xFD\x81\x56"
+                         "\x79\xFD\x3E\xF9\x46\xE0\x25\xD4"
+                         "\x38\xDE\xBC\x2C\xC4\x7A\x2A\x8F"
+                         "\x94\x4F\xD0\xAD\x9B\x37\x18\xD4"
+                         "\x0E\x4D\x0F\x02\x3A\xDC\x5A\xA2"
+                         "\x39\x25\x55\x20\x5A\xA6\x02\x9F"
+                         "\xE6\x77\x21\x77\xE5\x4B\x7B\x0B"
+                         "\x30\xF8\x5F\x33\x0F\x49\xCD\xFF"
+                         "\xF2\xE4\x35\xF9\xF0\x63\xC3\x7E"
+                         "\xF1\xA6\x73\xB4\xDF\xE7\xBB\x78"
+                         "\xFF\x21\xA9\xF3\xF3\xCF\x5D\xBA"
+                         "\xED\x87\x98\xAC\xFE\x48\x97\x6D"
+                         "\xA6\x7F\x69\x31\xB1\xC4\xFF\x14"
+                         "\xC6\x76\xD4\x10\xDD\xF6\x49\x2C"
+                         "\x9C\xC8\x6D\x76\xC0\x8F\x5F\x55"
+                         "\x2F\x3C\x8A\x30\xAA\xC3\x16\x55"
+                         "\xC6\xFC\x8D\x8B\xB9\xE5\x80\x6C"
+                         "\xC8\x7E\xBD\x65\x58\x36\xD5\xBC"
+                         "\xF0\x33\x52\x29\x70\xF9\x5C\xE9"
+                         "\xAC\x1F\xB5\x73\x56\x66\x54\xAF"
+                         "\x1B\x8F\x7D\xED\xAB\x03\xCE\xE3"
+                         "\xAE\x47\xB6\x69\x86\xE9\x01\x31"
+                         "\x83\x18\x3D\xF4\x74\x7B\xF9\x42"
+                         "\x4C\xFD\x75\x4A\x6D\xF0\x03\xA6"
+                         "\x2B\x20\x63\xDA\x49\x65\x5E\x8B"
+                         "\xC0\x19\xE3\x8D\xD9\xF3\xB0\x34"
+                         "\xD3\x52\xFC\x68\x00\x43\x1B\x37"
+                         "\x31\x93\x51\x1C\x63\x97\x70\xB0"
+                         "\x99\x78\x83\x13\xFD\xCF\x53\x81"
+                         "\x36\x46\xB5\x42\x52\x2F\x32\xEB"
+                         "\x4A\x3D\xF1\x8F\x1C\x54\x2E\xFC"
+                         "\x41\x75\x5A\x8C\x8E\x6F\xE7\x1A"
+                         "\xAE\xEF\x3E\x82\x12\x0B\x74\x72"
+                         "\xF8\xB2\xAA\x7A\xD6\xFF\xFA\x55"
+                         "\x33\x1A\xBB\xD3\xA2\x7E\x97\x66",
+               .rlen   = 1008,
                .also_non_np = 1,
                .np     = 2,
-               .tap    = { 496 - 16, 16 },
+               .tap    = { 1008 - 16, 16 },
        },
  };
  
@@@ -20955,8 -21297,72 +21297,72 @@@ static struct cipher_testvec camellia_d
                          "\x2C\x35\x1B\x38\x85\x7D\xE8\xF3"
                          "\x87\x4F\xDA\xD8\x5F\xFC\xB6\x44"
                          "\xD0\xE3\x9B\x8B\xBF\xD6\xB8\xC4"
-                         "\x73\xAE\x1D\x8B\x5B\x74\x8B\xCB",
-               .ilen   = 496,
+                         "\x73\xAE\x1D\x8B\x5B\x74\x8B\xCB"
+                         "\xA4\xAD\xCF\x5D\xD4\x58\xC9\xCD"
+                         "\xF7\x90\x68\xCF\xC9\x11\x52\x3E"
+                         "\xE8\xA1\xA3\x78\x8B\xD0\xAC\x0A"
+                         "\xD4\xC9\xA3\xA5\x55\x30\xC8\x3E"
+                         "\xED\x28\x39\xE9\x63\xED\x41\x70"
+                         "\x51\xE3\xC4\xA0\xFC\xD5\x43\xCB"
+                         "\x4D\x65\xC8\xFD\x3A\x91\x8F\x60"
+                         "\x8A\xA6\x6D\x9D\x3E\x01\x23\x4B"
+                         "\x50\x47\xC9\xDC\x9B\xDE\x37\xC5"
+                         "\xBF\x67\xB1\x6B\x78\x38\xD5\x7E"
+                         "\xB6\xFF\x67\x83\x3B\x6E\xBE\x23"
+                         "\x45\xFA\x1D\x69\x44\xFD\xC6\xB9"
+                         "\xD0\x4A\x92\xD1\xBE\xF6\x4A\xB7"
+                         "\xCA\xA8\xA2\x9E\x13\x87\x57\x92"
+                         "\x64\x7C\x85\x0B\xB3\x29\x37\xD8"
+                         "\xE6\xAA\xAF\xC4\x03\x67\xA3\xBF"
+                         "\x2E\x45\x83\xB6\xD8\x54\x00\x89"
+                         "\xF6\xBC\x3A\x7A\x88\x58\x51\xED"
+                         "\xF4\x4E\x01\xA5\xC3\x2E\xD9\x42"
+                         "\xBD\x6E\x0D\x0B\x21\xB0\x1A\xCC"
+                         "\xA4\xD3\x3F\xDC\x9B\x81\xD8\xF1"
+                         "\xEA\x7A\x6A\xB7\x07\xC9\x6D\x91"
+                         "\x6D\x3A\xF5\x5F\xA6\xFF\x87\x1E"
+                         "\x3F\xDD\xC0\x72\xEA\xAC\x08\x15"
+                         "\x21\xE6\xC6\xB6\x0D\xD8\x51\x86"
+                         "\x2A\x03\x73\xF7\x29\xD4\xC4\xE4"
+                         "\x7F\x95\x10\xF7\xAB\x3F\x92\x23"
+                         "\xD3\xCE\x9C\x2E\x46\x3B\x63\x43"
+                         "\xBB\xC2\x82\x7A\x83\xD5\x55\xE2"
+                         "\xE7\x9B\x2F\x92\xAF\xFD\x81\x56"
+                         "\x79\xFD\x3E\xF9\x46\xE0\x25\xD4"
+                         "\x38\xDE\xBC\x2C\xC4\x7A\x2A\x8F"
+                         "\x94\x4F\xD0\xAD\x9B\x37\x18\xD4"
+                         "\x0E\x4D\x0F\x02\x3A\xDC\x5A\xA2"
+                         "\x39\x25\x55\x20\x5A\xA6\x02\x9F"
+                         "\xE6\x77\x21\x77\xE5\x4B\x7B\x0B"
+                         "\x30\xF8\x5F\x33\x0F\x49\xCD\xFF"
+                         "\xF2\xE4\x35\xF9\xF0\x63\xC3\x7E"
+                         "\xF1\xA6\x73\xB4\xDF\xE7\xBB\x78"
+                         "\xFF\x21\xA9\xF3\xF3\xCF\x5D\xBA"
+                         "\xED\x87\x98\xAC\xFE\x48\x97\x6D"
+                         "\xA6\x7F\x69\x31\xB1\xC4\xFF\x14"
+                         "\xC6\x76\xD4\x10\xDD\xF6\x49\x2C"
+                         "\x9C\xC8\x6D\x76\xC0\x8F\x5F\x55"
+                         "\x2F\x3C\x8A\x30\xAA\xC3\x16\x55"
+                         "\xC6\xFC\x8D\x8B\xB9\xE5\x80\x6C"
+                         "\xC8\x7E\xBD\x65\x58\x36\xD5\xBC"
+                         "\xF0\x33\x52\x29\x70\xF9\x5C\xE9"
+                         "\xAC\x1F\xB5\x73\x56\x66\x54\xAF"
+                         "\x1B\x8F\x7D\xED\xAB\x03\xCE\xE3"
+                         "\xAE\x47\xB6\x69\x86\xE9\x01\x31"
+                         "\x83\x18\x3D\xF4\x74\x7B\xF9\x42"
+                         "\x4C\xFD\x75\x4A\x6D\xF0\x03\xA6"
+                         "\x2B\x20\x63\xDA\x49\x65\x5E\x8B"
+                         "\xC0\x19\xE3\x8D\xD9\xF3\xB0\x34"
+                         "\xD3\x52\xFC\x68\x00\x43\x1B\x37"
+                         "\x31\x93\x51\x1C\x63\x97\x70\xB0"
+                         "\x99\x78\x83\x13\xFD\xCF\x53\x81"
+                         "\x36\x46\xB5\x42\x52\x2F\x32\xEB"
+                         "\x4A\x3D\xF1\x8F\x1C\x54\x2E\xFC"
+                         "\x41\x75\x5A\x8C\x8E\x6F\xE7\x1A"
+                         "\xAE\xEF\x3E\x82\x12\x0B\x74\x72"
+                         "\xF8\xB2\xAA\x7A\xD6\xFF\xFA\x55"
+                         "\x33\x1A\xBB\xD3\xA2\x7E\x97\x66",
+               .ilen   = 1008,
                .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
                          "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
                          "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
                          "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
                          "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
                          "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
-                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
-               .rlen   = 496,
+                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
+                         "\x2B\xC2\x59\xF0\x64\xFB\x92\x06"
+                         "\x9D\x34\xCB\x3F\xD6\x6D\x04\x78"
+                         "\x0F\xA6\x1A\xB1\x48\xDF\x53\xEA"
+                         "\x81\x18\x8C\x23\xBA\x2E\xC5\x5C"
+                         "\xF3\x67\xFE\x95\x09\xA0\x37\xCE"
+                         "\x42\xD9\x70\x07\x7B\x12\xA9\x1D"
+                         "\xB4\x4B\xE2\x56\xED\x84\x1B\x8F"
+                         "\x26\xBD\x31\xC8\x5F\xF6\x6A\x01"
+                         "\x98\x0C\xA3\x3A\xD1\x45\xDC\x73"
+                         "\x0A\x7E\x15\xAC\x20\xB7\x4E\xE5"
+                         "\x59\xF0\x87\x1E\x92\x29\xC0\x34"
+                         "\xCB\x62\xF9\x6D\x04\x9B\x0F\xA6"
+                         "\x3D\xD4\x48\xDF\x76\x0D\x81\x18"
+                         "\xAF\x23\xBA\x51\xE8\x5C\xF3\x8A"
+                         "\x21\x95\x2C\xC3\x37\xCE\x65\xFC"
+                         "\x70\x07\x9E\x12\xA9\x40\xD7\x4B"
+                         "\xE2\x79\x10\x84\x1B\xB2\x26\xBD"
+                         "\x54\xEB\x5F\xF6\x8D\x01\x98\x2F"
+                         "\xC6\x3A\xD1\x68\xFF\x73\x0A\xA1"
+                         "\x15\xAC\x43\xDA\x4E\xE5\x7C\x13"
+                         "\x87\x1E\xB5\x29\xC0\x57\xEE\x62"
+                         "\xF9\x90\x04\x9B\x32\xC9\x3D\xD4"
+                         "\x6B\x02\x76\x0D\xA4\x18\xAF\x46"
+                         "\xDD\x51\xE8\x7F\x16\x8A\x21\xB8"
+                         "\x2C\xC3\x5A\xF1\x65\xFC\x93\x07"
+                         "\x9E\x35\xCC\x40\xD7\x6E\x05\x79"
+                         "\x10\xA7\x1B\xB2\x49\xE0\x54\xEB"
+                         "\x82\x19\x8D\x24\xBB\x2F\xC6\x5D"
+                         "\xF4\x68\xFF\x96\x0A\xA1\x38\xCF"
+                         "\x43\xDA\x71\x08\x7C\x13\xAA\x1E"
+                         "\xB5\x4C\xE3\x57\xEE\x85\x1C\x90"
+                         "\x27\xBE\x32\xC9\x60\xF7\x6B\x02"
+                         "\x99\x0D\xA4\x3B\xD2\x46\xDD\x74"
+                         "\x0B\x7F\x16\xAD\x21\xB8\x4F\xE6"
+                         "\x5A\xF1\x88\x1F\x93\x2A\xC1\x35"
+                         "\xCC\x63\xFA\x6E\x05\x9C\x10\xA7"
+                         "\x3E\xD5\x49\xE0\x77\x0E\x82\x19"
+                         "\xB0\x24\xBB\x52\xE9\x5D\xF4\x8B"
+                         "\x22\x96\x2D\xC4\x38\xCF\x66\xFD"
+                         "\x71\x08\x9F\x13\xAA\x41\xD8\x4C"
+                         "\xE3\x7A\x11\x85\x1C\xB3\x27\xBE"
+                         "\x55\xEC\x60\xF7\x8E\x02\x99\x30"
+                         "\xC7\x3B\xD2\x69\x00\x74\x0B\xA2"
+                         "\x16\xAD\x44\xDB\x4F\xE6\x7D\x14"
+                         "\x88\x1F\xB6\x2A\xC1\x58\xEF\x63"
+                         "\xFA\x91\x05\x9C\x33\xCA\x3E\xD5"
+                         "\x6C\x03\x77\x0E\xA5\x19\xB0\x47"
+                         "\xDE\x52\xE9\x80\x17\x8B\x22\xB9"
+                         "\x2D\xC4\x5B\xF2\x66\xFD\x94\x08"
+                         "\x9F\x36\xCD\x41\xD8\x6F\x06\x7A"
+                         "\x11\xA8\x1C\xB3\x4A\xE1\x55\xEC"
+                         "\x83\x1A\x8E\x25\xBC\x30\xC7\x5E"
+                         "\xF5\x69\x00\x97\x0B\xA2\x39\xD0"
+                         "\x44\xDB\x72\x09\x7D\x14\xAB\x1F"
+                         "\xB6\x4D\xE4\x58\xEF\x86\x1D\x91"
+                         "\x28\xBF\x33\xCA\x61\xF8\x6C\x03"
+                         "\x9A\x0E\xA5\x3C\xD3\x47\xDE\x75"
+                         "\x0C\x80\x17\xAE\x22\xB9\x50\xE7"
+                         "\x5B\xF2\x89\x20\x94\x2B\xC2\x36"
+                         "\xCD\x64\xFB\x6F\x06\x9D\x11\xA8"
+                         "\x3F\xD6\x4A\xE1\x78\x0F\x83\x1A"
+                         "\xB1\x25\xBC\x53\xEA\x5E\xF5\x8C"
+                         "\x00\x97\x2E\xC5\x39\xD0\x67\xFE"
+                         "\x72\x09\xA0\x14\xAB\x42\xD9\x4D",
+               .rlen   = 1008,
                .also_non_np = 1,
                .np     = 2,
-               .tap    = { 496 - 16, 16 },
+               .tap    = { 1008 - 16, 16 },
        },
  };
  
@@@ -21123,8 -21593,72 +21593,72 @@@ static struct cipher_testvec camellia_c
                          "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
                          "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
                          "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
-                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
-               .ilen   = 496,
+                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
+                         "\x2B\xC2\x59\xF0\x64\xFB\x92\x06"
+                         "\x9D\x34\xCB\x3F\xD6\x6D\x04\x78"
+                         "\x0F\xA6\x1A\xB1\x48\xDF\x53\xEA"
+                         "\x81\x18\x8C\x23\xBA\x2E\xC5\x5C"
+                         "\xF3\x67\xFE\x95\x09\xA0\x37\xCE"
+                         "\x42\xD9\x70\x07\x7B\x12\xA9\x1D"
+                         "\xB4\x4B\xE2\x56\xED\x84\x1B\x8F"
+                         "\x26\xBD\x31\xC8\x5F\xF6\x6A\x01"
+                         "\x98\x0C\xA3\x3A\xD1\x45\xDC\x73"
+                         "\x0A\x7E\x15\xAC\x20\xB7\x4E\xE5"
+                         "\x59\xF0\x87\x1E\x92\x29\xC0\x34"
+                         "\xCB\x62\xF9\x6D\x04\x9B\x0F\xA6"
+                         "\x3D\xD4\x48\xDF\x76\x0D\x81\x18"
+                         "\xAF\x23\xBA\x51\xE8\x5C\xF3\x8A"
+                         "\x21\x95\x2C\xC3\x37\xCE\x65\xFC"
+                         "\x70\x07\x9E\x12\xA9\x40\xD7\x4B"
+                         "\xE2\x79\x10\x84\x1B\xB2\x26\xBD"
+                         "\x54\xEB\x5F\xF6\x8D\x01\x98\x2F"
+                         "\xC6\x3A\xD1\x68\xFF\x73\x0A\xA1"
+                         "\x15\xAC\x43\xDA\x4E\xE5\x7C\x13"
+                         "\x87\x1E\xB5\x29\xC0\x57\xEE\x62"
+                         "\xF9\x90\x04\x9B\x32\xC9\x3D\xD4"
+                         "\x6B\x02\x76\x0D\xA4\x18\xAF\x46"
+                         "\xDD\x51\xE8\x7F\x16\x8A\x21\xB8"
+                         "\x2C\xC3\x5A\xF1\x65\xFC\x93\x07"
+                         "\x9E\x35\xCC\x40\xD7\x6E\x05\x79"
+                         "\x10\xA7\x1B\xB2\x49\xE0\x54\xEB"
+                         "\x82\x19\x8D\x24\xBB\x2F\xC6\x5D"
+                         "\xF4\x68\xFF\x96\x0A\xA1\x38\xCF"
+                         "\x43\xDA\x71\x08\x7C\x13\xAA\x1E"
+                         "\xB5\x4C\xE3\x57\xEE\x85\x1C\x90"
+                         "\x27\xBE\x32\xC9\x60\xF7\x6B\x02"
+                         "\x99\x0D\xA4\x3B\xD2\x46\xDD\x74"
+                         "\x0B\x7F\x16\xAD\x21\xB8\x4F\xE6"
+                         "\x5A\xF1\x88\x1F\x93\x2A\xC1\x35"
+                         "\xCC\x63\xFA\x6E\x05\x9C\x10\xA7"
+                         "\x3E\xD5\x49\xE0\x77\x0E\x82\x19"
+                         "\xB0\x24\xBB\x52\xE9\x5D\xF4\x8B"
+                         "\x22\x96\x2D\xC4\x38\xCF\x66\xFD"
+                         "\x71\x08\x9F\x13\xAA\x41\xD8\x4C"
+                         "\xE3\x7A\x11\x85\x1C\xB3\x27\xBE"
+                         "\x55\xEC\x60\xF7\x8E\x02\x99\x30"
+                         "\xC7\x3B\xD2\x69\x00\x74\x0B\xA2"
+                         "\x16\xAD\x44\xDB\x4F\xE6\x7D\x14"
+                         "\x88\x1F\xB6\x2A\xC1\x58\xEF\x63"
+                         "\xFA\x91\x05\x9C\x33\xCA\x3E\xD5"
+                         "\x6C\x03\x77\x0E\xA5\x19\xB0\x47"
+                         "\xDE\x52\xE9\x80\x17\x8B\x22\xB9"
+                         "\x2D\xC4\x5B\xF2\x66\xFD\x94\x08"
+                         "\x9F\x36\xCD\x41\xD8\x6F\x06\x7A"
+                         "\x11\xA8\x1C\xB3\x4A\xE1\x55\xEC"
+                         "\x83\x1A\x8E\x25\xBC\x30\xC7\x5E"
+                         "\xF5\x69\x00\x97\x0B\xA2\x39\xD0"
+                         "\x44\xDB\x72\x09\x7D\x14\xAB\x1F"
+                         "\xB6\x4D\xE4\x58\xEF\x86\x1D\x91"
+                         "\x28\xBF\x33\xCA\x61\xF8\x6C\x03"
+                         "\x9A\x0E\xA5\x3C\xD3\x47\xDE\x75"
+                         "\x0C\x80\x17\xAE\x22\xB9\x50\xE7"
+                         "\x5B\xF2\x89\x20\x94\x2B\xC2\x36"
+                         "\xCD\x64\xFB\x6F\x06\x9D\x11\xA8"
+                         "\x3F\xD6\x4A\xE1\x78\x0F\x83\x1A"
+                         "\xB1\x25\xBC\x53\xEA\x5E\xF5\x8C"
+                         "\x00\x97\x2E\xC5\x39\xD0\x67\xFE"
+                         "\x72\x09\xA0\x14\xAB\x42\xD9\x4D",
+               .ilen   = 1008,
                .result = "\xCD\x3E\x2A\x3B\x3E\x94\xC5\x77"
                          "\xBA\xBB\x5B\xB1\xDE\x7B\xA4\x40"
                          "\x88\x39\xE3\xFD\x94\x4B\x25\x58"
                          "\x2D\x1A\x68\xFE\xEC\x92\x94\xDA"
                          "\x94\x2A\x6F\xD6\xFE\xE5\x76\x97"
                          "\xF4\x6E\xEE\xCB\x2B\x95\x4E\x36"
-                         "\x5F\x74\x8C\x86\x5B\x71\xD0\x20",
-               .rlen   = 496,
+                         "\x5F\x74\x8C\x86\x5B\x71\xD0\x20"
+                         "\x78\x1A\x7F\x18\x8C\xD9\xCD\xF5"
+                         "\x21\x41\x56\x72\x13\xE1\x86\x07"
+                         "\x07\x26\xF3\x4F\x7B\xEA\xB5\x18"
+                         "\xFE\x94\x2D\x9F\xE0\x72\x18\x65"
+                         "\xB2\xA5\x63\x48\xB4\x13\x22\xF7"
+                         "\x25\xF1\x80\xA8\x7F\x54\x86\x7B"
+                         "\x39\xAE\x95\x0C\x09\x32\x22\x2D"
+                         "\x4D\x73\x39\x0C\x09\x2C\x7C\x10"
+                         "\xD0\x4B\x53\xF6\x90\xC5\x99\x2F"
+                         "\x15\xE1\x7F\xC6\xC5\x7A\x52\x14"
+                         "\x65\xEE\x93\x54\xD0\x66\x15\x3C"
+                         "\x4C\x68\xFD\x64\x0F\xF9\x10\x39"
+                         "\x46\x7A\xDD\x97\x20\xEE\xC7\xD2"
+                         "\x98\x4A\xB6\xE6\xF5\xA8\x1F\x4F"
+                         "\xDB\xAB\x6D\xD5\x9B\x34\x16\x97"
+                         "\x2F\x64\xE5\x37\xEF\x0E\xA1\xE9"
+                         "\xBE\x31\x31\x96\x8B\x40\x18\x75"
+                         "\x11\x75\x14\x32\xA5\x2D\x1B\x6B"
+                         "\xDB\x59\xEB\xFA\x3D\x8E\x7C\xC4"
+                         "\xDE\x68\xC8\x9F\xC9\x99\xE3\xC6"
+                         "\x71\xB0\x12\x57\x89\x0D\xC0\x2B"
+                         "\x9F\x12\x6A\x04\x67\xF1\x95\x31"
+                         "\x59\xFD\x84\x95\x2C\x9C\x5B\xEC"
+                         "\x09\xB0\x43\x96\x4A\x64\x80\x40"
+                         "\xB9\x72\x19\xDD\x70\x42\xFA\xB1"
+                         "\x4A\x2C\x0C\x0A\x60\x6E\xE3\x7C"
+                         "\x37\x5A\xBE\xA4\x62\xCF\x29\xAB"
+                         "\x7F\x4D\xA6\xB3\xE2\xB6\x64\xC6"
+                         "\x33\x0B\xF3\xD5\x01\x38\x74\xA4"
+                         "\x67\x1E\x75\x68\xC3\xAD\x76\xE9"
+                         "\xE9\xBC\xF0\xEB\xD8\xFD\x31\x8A"
+                         "\x5F\xC9\x18\x94\x4B\x86\x66\xFC"
+                         "\xBD\x0B\x3D\xB3\x9F\xFA\x1F\xD9"
+                         "\x78\xC4\xE3\x24\x1C\x67\xA2\xF8"
+                         "\x43\xBC\x76\x75\xBF\x6C\x05\xB3"
+                         "\x32\xE8\x7C\x80\xDB\xC7\xB6\x61"
+                         "\x1A\x3E\x2B\xA7\x25\xED\x8F\xA0"
+                         "\x00\x4B\xF8\x90\xCA\xD8\xFB\x12"
+                         "\xAC\x1F\x18\xE9\xD2\x5E\xA2\x8E"
+                         "\xE4\x84\x6B\x9D\xEB\x1E\x6B\xA3"
+                         "\x7B\xDC\xCE\x15\x97\x27\xB2\x65"
+                         "\xBC\x0E\x47\xAB\x55\x13\x53\xAB"
+                         "\x0E\x34\x55\x02\x5F\x27\xC5\x89"
+                         "\xDF\xC5\x70\xC4\xDD\x76\x82\xEE"
+                         "\x68\xA6\x09\xB0\xE5\x5E\xF1\x0C"
+                         "\xE3\xF3\x09\x9B\xFE\x65\x4B\xB8"
+                         "\x30\xEC\xD5\x7C\x6A\xEC\x1D\xD2"
+                         "\x93\xB7\xA1\x1A\x02\xD4\xC0\xD6"
+                         "\x8D\x4D\x83\x9A\xED\x29\x4E\x14"
+                         "\x86\xD5\x3C\x1A\xD5\xB9\x0A\x6A"
+                         "\x72\x22\xD5\x92\x38\xF1\xA1\x86"
+                         "\xB2\x41\x51\xCA\x4E\xAB\x8F\xD3"
+                         "\x80\x56\xC3\xD7\x65\xE1\xB3\x86"
+                         "\xCB\xCE\x98\xA1\xD4\x59\x1C\x06"
+                         "\x01\xED\xF8\x29\x91\x19\x5C\x9A"
+                         "\xEE\x28\x1B\x48\xD7\x32\xEF\x9F"
+                         "\x6C\x2B\x66\x4E\x78\xD5\x8B\x72"
+                         "\x80\xE7\x29\xDC\x23\x55\x98\x54"
+                         "\xB1\xFF\x3E\x95\x56\xA8\x78\x78"
+                         "\xEF\xC4\xA5\x11\x2D\x2B\xD8\x93"
+                         "\x30\x6E\x7E\x51\xBB\x42\x5F\x03"
+                         "\x43\x94\x23\x7E\xEE\xF0\xA5\x79"
+                         "\x55\x01\xD4\x58\xB2\xF2\x85\x49"
+                         "\x70\xC5\xB9\x0B\x3B\x7A\x6E\x6C",
+               .rlen   = 1008,
                .also_non_np = 1,
                .np     = 2,
-               .tap    = { 496 - 16, 16 },
+               .tap    = { 1008 - 16, 16 },
        },
  };
  
@@@ -21291,8 -21889,72 +21889,72 @@@ static struct cipher_testvec camellia_c
                          "\x2D\x1A\x68\xFE\xEC\x92\x94\xDA"
                          "\x94\x2A\x6F\xD6\xFE\xE5\x76\x97"
                          "\xF4\x6E\xEE\xCB\x2B\x95\x4E\x36"
-                         "\x5F\x74\x8C\x86\x5B\x71\xD0\x20",
-               .ilen   = 496,
+                         "\x5F\x74\x8C\x86\x5B\x71\xD0\x20"
+                         "\x78\x1A\x7F\x18\x8C\xD9\xCD\xF5"
+                         "\x21\x41\x56\x72\x13\xE1\x86\x07"
+                         "\x07\x26\xF3\x4F\x7B\xEA\xB5\x18"
+                         "\xFE\x94\x2D\x9F\xE0\x72\x18\x65"
+                         "\xB2\xA5\x63\x48\xB4\x13\x22\xF7"
+                         "\x25\xF1\x80\xA8\x7F\x54\x86\x7B"
+                         "\x39\xAE\x95\x0C\x09\x32\x22\x2D"
+                         "\x4D\x73\x39\x0C\x09\x2C\x7C\x10"
+                         "\xD0\x4B\x53\xF6\x90\xC5\x99\x2F"
+                         "\x15\xE1\x7F\xC6\xC5\x7A\x52\x14"
+                         "\x65\xEE\x93\x54\xD0\x66\x15\x3C"
+                         "\x4C\x68\xFD\x64\x0F\xF9\x10\x39"
+                         "\x46\x7A\xDD\x97\x20\xEE\xC7\xD2"
+                         "\x98\x4A\xB6\xE6\xF5\xA8\x1F\x4F"
+                         "\xDB\xAB\x6D\xD5\x9B\x34\x16\x97"
+                         "\x2F\x64\xE5\x37\xEF\x0E\xA1\xE9"
+                         "\xBE\x31\x31\x96\x8B\x40\x18\x75"
+                         "\x11\x75\x14\x32\xA5\x2D\x1B\x6B"
+                         "\xDB\x59\xEB\xFA\x3D\x8E\x7C\xC4"
+                         "\xDE\x68\xC8\x9F\xC9\x99\xE3\xC6"
+                         "\x71\xB0\x12\x57\x89\x0D\xC0\x2B"
+                         "\x9F\x12\x6A\x04\x67\xF1\x95\x31"
+                         "\x59\xFD\x84\x95\x2C\x9C\x5B\xEC"
+                         "\x09\xB0\x43\x96\x4A\x64\x80\x40"
+                         "\xB9\x72\x19\xDD\x70\x42\xFA\xB1"
+                         "\x4A\x2C\x0C\x0A\x60\x6E\xE3\x7C"
+                         "\x37\x5A\xBE\xA4\x62\xCF\x29\xAB"
+                         "\x7F\x4D\xA6\xB3\xE2\xB6\x64\xC6"
+                         "\x33\x0B\xF3\xD5\x01\x38\x74\xA4"
+                         "\x67\x1E\x75\x68\xC3\xAD\x76\xE9"
+                         "\xE9\xBC\xF0\xEB\xD8\xFD\x31\x8A"
+                         "\x5F\xC9\x18\x94\x4B\x86\x66\xFC"
+                         "\xBD\x0B\x3D\xB3\x9F\xFA\x1F\xD9"
+                         "\x78\xC4\xE3\x24\x1C\x67\xA2\xF8"
+                         "\x43\xBC\x76\x75\xBF\x6C\x05\xB3"
+                         "\x32\xE8\x7C\x80\xDB\xC7\xB6\x61"
+                         "\x1A\x3E\x2B\xA7\x25\xED\x8F\xA0"
+                         "\x00\x4B\xF8\x90\xCA\xD8\xFB\x12"
+                         "\xAC\x1F\x18\xE9\xD2\x5E\xA2\x8E"
+                         "\xE4\x84\x6B\x9D\xEB\x1E\x6B\xA3"
+                         "\x7B\xDC\xCE\x15\x97\x27\xB2\x65"
+                         "\xBC\x0E\x47\xAB\x55\x13\x53\xAB"
+                         "\x0E\x34\x55\x02\x5F\x27\xC5\x89"
+                         "\xDF\xC5\x70\xC4\xDD\x76\x82\xEE"
+                         "\x68\xA6\x09\xB0\xE5\x5E\xF1\x0C"
+                         "\xE3\xF3\x09\x9B\xFE\x65\x4B\xB8"
+                         "\x30\xEC\xD5\x7C\x6A\xEC\x1D\xD2"
+                         "\x93\xB7\xA1\x1A\x02\xD4\xC0\xD6"
+                         "\x8D\x4D\x83\x9A\xED\x29\x4E\x14"
+                         "\x86\xD5\x3C\x1A\xD5\xB9\x0A\x6A"
+                         "\x72\x22\xD5\x92\x38\xF1\xA1\x86"
+                         "\xB2\x41\x51\xCA\x4E\xAB\x8F\xD3"
+                         "\x80\x56\xC3\xD7\x65\xE1\xB3\x86"
+                         "\xCB\xCE\x98\xA1\xD4\x59\x1C\x06"
+                         "\x01\xED\xF8\x29\x91\x19\x5C\x9A"
+                         "\xEE\x28\x1B\x48\xD7\x32\xEF\x9F"
+                         "\x6C\x2B\x66\x4E\x78\xD5\x8B\x72"
+                         "\x80\xE7\x29\xDC\x23\x55\x98\x54"
+                         "\xB1\xFF\x3E\x95\x56\xA8\x78\x78"
+                         "\xEF\xC4\xA5\x11\x2D\x2B\xD8\x93"
+                         "\x30\x6E\x7E\x51\xBB\x42\x5F\x03"
+                         "\x43\x94\x23\x7E\xEE\xF0\xA5\x79"
+                         "\x55\x01\xD4\x58\xB2\xF2\x85\x49"
+                         "\x70\xC5\xB9\x0B\x3B\x7A\x6E\x6C",
+               .ilen   = 1008,
                .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
                          "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
                          "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
                          "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
                          "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
                          "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
-                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
-               .rlen   = 496,
+                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
+                         "\x2B\xC2\x59\xF0\x64\xFB\x92\x06"
+                         "\x9D\x34\xCB\x3F\xD6\x6D\x04\x78"
+                         "\x0F\xA6\x1A\xB1\x48\xDF\x53\xEA"
+                         "\x81\x18\x8C\x23\xBA\x2E\xC5\x5C"
+                         "\xF3\x67\xFE\x95\x09\xA0\x37\xCE"
+                         "\x42\xD9\x70\x07\x7B\x12\xA9\x1D"
+                         "\xB4\x4B\xE2\x56\xED\x84\x1B\x8F"
+                         "\x26\xBD\x31\xC8\x5F\xF6\x6A\x01"
+                         "\x98\x0C\xA3\x3A\xD1\x45\xDC\x73"
+                         "\x0A\x7E\x15\xAC\x20\xB7\x4E\xE5"
+                         "\x59\xF0\x87\x1E\x92\x29\xC0\x34"
+                         "\xCB\x62\xF9\x6D\x04\x9B\x0F\xA6"
+                         "\x3D\xD4\x48\xDF\x76\x0D\x81\x18"
+                         "\xAF\x23\xBA\x51\xE8\x5C\xF3\x8A"
+                         "\x21\x95\x2C\xC3\x37\xCE\x65\xFC"
+                         "\x70\x07\x9E\x12\xA9\x40\xD7\x4B"
+                         "\xE2\x79\x10\x84\x1B\xB2\x26\xBD"
+                         "\x54\xEB\x5F\xF6\x8D\x01\x98\x2F"
+                         "\xC6\x3A\xD1\x68\xFF\x73\x0A\xA1"
+                         "\x15\xAC\x43\xDA\x4E\xE5\x7C\x13"
+                         "\x87\x1E\xB5\x29\xC0\x57\xEE\x62"
+                         "\xF9\x90\x04\x9B\x32\xC9\x3D\xD4"
+                         "\x6B\x02\x76\x0D\xA4\x18\xAF\x46"
+                         "\xDD\x51\xE8\x7F\x16\x8A\x21\xB8"
+                         "\x2C\xC3\x5A\xF1\x65\xFC\x93\x07"
+                         "\x9E\x35\xCC\x40\xD7\x6E\x05\x79"
+                         "\x10\xA7\x1B\xB2\x49\xE0\x54\xEB"
+                         "\x82\x19\x8D\x24\xBB\x2F\xC6\x5D"
+                         "\xF4\x68\xFF\x96\x0A\xA1\x38\xCF"
+                         "\x43\xDA\x71\x08\x7C\x13\xAA\x1E"
+                         "\xB5\x4C\xE3\x57\xEE\x85\x1C\x90"
+                         "\x27\xBE\x32\xC9\x60\xF7\x6B\x02"
+                         "\x99\x0D\xA4\x3B\xD2\x46\xDD\x74"
+                         "\x0B\x7F\x16\xAD\x21\xB8\x4F\xE6"
+                         "\x5A\xF1\x88\x1F\x93\x2A\xC1\x35"
+                         "\xCC\x63\xFA\x6E\x05\x9C\x10\xA7"
+                         "\x3E\xD5\x49\xE0\x77\x0E\x82\x19"
+                         "\xB0\x24\xBB\x52\xE9\x5D\xF4\x8B"
+                         "\x22\x96\x2D\xC4\x38\xCF\x66\xFD"
+                         "\x71\x08\x9F\x13\xAA\x41\xD8\x4C"
+                         "\xE3\x7A\x11\x85\x1C\xB3\x27\xBE"
+                         "\x55\xEC\x60\xF7\x8E\x02\x99\x30"
+                         "\xC7\x3B\xD2\x69\x00\x74\x0B\xA2"
+                         "\x16\xAD\x44\xDB\x4F\xE6\x7D\x14"
+                         "\x88\x1F\xB6\x2A\xC1\x58\xEF\x63"
+                         "\xFA\x91\x05\x9C\x33\xCA\x3E\xD5"
+                         "\x6C\x03\x77\x0E\xA5\x19\xB0\x47"
+                         "\xDE\x52\xE9\x80\x17\x8B\x22\xB9"
+                         "\x2D\xC4\x5B\xF2\x66\xFD\x94\x08"
+                         "\x9F\x36\xCD\x41\xD8\x6F\x06\x7A"
+                         "\x11\xA8\x1C\xB3\x4A\xE1\x55\xEC"
+                         "\x83\x1A\x8E\x25\xBC\x30\xC7\x5E"
+                         "\xF5\x69\x00\x97\x0B\xA2\x39\xD0"
+                         "\x44\xDB\x72\x09\x7D\x14\xAB\x1F"
+                         "\xB6\x4D\xE4\x58\xEF\x86\x1D\x91"
+                         "\x28\xBF\x33\xCA\x61\xF8\x6C\x03"
+                         "\x9A\x0E\xA5\x3C\xD3\x47\xDE\x75"
+                         "\x0C\x80\x17\xAE\x22\xB9\x50\xE7"
+                         "\x5B\xF2\x89\x20\x94\x2B\xC2\x36"
+                         "\xCD\x64\xFB\x6F\x06\x9D\x11\xA8"
+                         "\x3F\xD6\x4A\xE1\x78\x0F\x83\x1A"
+                         "\xB1\x25\xBC\x53\xEA\x5E\xF5\x8C"
+                         "\x00\x97\x2E\xC5\x39\xD0\x67\xFE"
+                         "\x72\x09\xA0\x14\xAB\x42\xD9\x4D",
+               .rlen   = 1008,
                .also_non_np = 1,
                .np     = 2,
-               .tap    = { 496 - 16, 16 },
+               .tap    = { 1008 - 16, 16 },
        },
  };
  
@@@ -21567,8 -22293,72 +22293,72 @@@ static struct cipher_testvec camellia_c
                          "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
                          "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
                          "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
-                         "\x2B\xC2\x59",
-               .ilen   = 499,
+                         "\x2B\xC2\x59\xF0\x64\xFB\x92\x06"
+                         "\x9D\x34\xCB\x3F\xD6\x6D\x04\x78"
+                         "\x0F\xA6\x1A\xB1\x48\xDF\x53\xEA"
+                         "\x81\x18\x8C\x23\xBA\x2E\xC5\x5C"
+                         "\xF3\x67\xFE\x95\x09\xA0\x37\xCE"
+                         "\x42\xD9\x70\x07\x7B\x12\xA9\x1D"
+                         "\xB4\x4B\xE2\x56\xED\x84\x1B\x8F"
+                         "\x26\xBD\x31\xC8\x5F\xF6\x6A\x01"
+                         "\x98\x0C\xA3\x3A\xD1\x45\xDC\x73"
+                         "\x0A\x7E\x15\xAC\x20\xB7\x4E\xE5"
+                         "\x59\xF0\x87\x1E\x92\x29\xC0\x34"
+                         "\xCB\x62\xF9\x6D\x04\x9B\x0F\xA6"
+                         "\x3D\xD4\x48\xDF\x76\x0D\x81\x18"
+                         "\xAF\x23\xBA\x51\xE8\x5C\xF3\x8A"
+                         "\x21\x95\x2C\xC3\x37\xCE\x65\xFC"
+                         "\x70\x07\x9E\x12\xA9\x40\xD7\x4B"
+                         "\xE2\x79\x10\x84\x1B\xB2\x26\xBD"
+                         "\x54\xEB\x5F\xF6\x8D\x01\x98\x2F"
+                         "\xC6\x3A\xD1\x68\xFF\x73\x0A\xA1"
+                         "\x15\xAC\x43\xDA\x4E\xE5\x7C\x13"
+                         "\x87\x1E\xB5\x29\xC0\x57\xEE\x62"
+                         "\xF9\x90\x04\x9B\x32\xC9\x3D\xD4"
+                         "\x6B\x02\x76\x0D\xA4\x18\xAF\x46"
+                         "\xDD\x51\xE8\x7F\x16\x8A\x21\xB8"
+                         "\x2C\xC3\x5A\xF1\x65\xFC\x93\x07"
+                         "\x9E\x35\xCC\x40\xD7\x6E\x05\x79"
+                         "\x10\xA7\x1B\xB2\x49\xE0\x54\xEB"
+                         "\x82\x19\x8D\x24\xBB\x2F\xC6\x5D"
+                         "\xF4\x68\xFF\x96\x0A\xA1\x38\xCF"
+                         "\x43\xDA\x71\x08\x7C\x13\xAA\x1E"
+                         "\xB5\x4C\xE3\x57\xEE\x85\x1C\x90"
+                         "\x27\xBE\x32\xC9\x60\xF7\x6B\x02"
+                         "\x99\x0D\xA4\x3B\xD2\x46\xDD\x74"
+                         "\x0B\x7F\x16\xAD\x21\xB8\x4F\xE6"
+                         "\x5A\xF1\x88\x1F\x93\x2A\xC1\x35"
+                         "\xCC\x63\xFA\x6E\x05\x9C\x10\xA7"
+                         "\x3E\xD5\x49\xE0\x77\x0E\x82\x19"
+                         "\xB0\x24\xBB\x52\xE9\x5D\xF4\x8B"
+                         "\x22\x96\x2D\xC4\x38\xCF\x66\xFD"
+                         "\x71\x08\x9F\x13\xAA\x41\xD8\x4C"
+                         "\xE3\x7A\x11\x85\x1C\xB3\x27\xBE"
+                         "\x55\xEC\x60\xF7\x8E\x02\x99\x30"
+                         "\xC7\x3B\xD2\x69\x00\x74\x0B\xA2"
+                         "\x16\xAD\x44\xDB\x4F\xE6\x7D\x14"
+                         "\x88\x1F\xB6\x2A\xC1\x58\xEF\x63"
+                         "\xFA\x91\x05\x9C\x33\xCA\x3E\xD5"
+                         "\x6C\x03\x77\x0E\xA5\x19\xB0\x47"
+                         "\xDE\x52\xE9\x80\x17\x8B\x22\xB9"
+                         "\x2D\xC4\x5B\xF2\x66\xFD\x94\x08"
+                         "\x9F\x36\xCD\x41\xD8\x6F\x06\x7A"
+                         "\x11\xA8\x1C\xB3\x4A\xE1\x55\xEC"
+                         "\x83\x1A\x8E\x25\xBC\x30\xC7\x5E"
+                         "\xF5\x69\x00\x97\x0B\xA2\x39\xD0"
+                         "\x44\xDB\x72\x09\x7D\x14\xAB\x1F"
+                         "\xB6\x4D\xE4\x58\xEF\x86\x1D\x91"
+                         "\x28\xBF\x33\xCA\x61\xF8\x6C\x03"
+                         "\x9A\x0E\xA5\x3C\xD3\x47\xDE\x75"
+                         "\x0C\x80\x17\xAE\x22\xB9\x50\xE7"
+                         "\x5B\xF2\x89\x20\x94\x2B\xC2\x36"
+                         "\xCD\x64\xFB\x6F\x06\x9D\x11\xA8"
+                         "\x3F\xD6\x4A\xE1\x78\x0F\x83\x1A"
+                         "\xB1\x25\xBC\x53\xEA\x5E\xF5\x8C"
+                         "\x00\x97\x2E\xC5\x39\xD0\x67\xFE"
+                         "\x72\x09\xA0\x14\xAB\x42\xD9\x4D"
+                         "\xE4\x7B\x12",
+               .ilen   = 1011,
                .result = "\xF3\x06\x3A\x84\xCD\xBA\x8E\x11"
                          "\xB7\x74\x6F\x5C\x97\xFB\x36\xFE"
                          "\xDE\x71\x58\xD4\x15\xD1\xC1\xA4"
                          "\x7E\x42\xEC\xB6\x6F\x4D\x6B\x48"
                          "\xE6\xA6\x50\x80\x78\x9E\xF1\xB0"
                          "\x4D\xB2\x0D\x3D\xFC\x40\x25\x4D"
-                         "\x93\x11\x1C",
-               .rlen   = 499,
+                         "\x93\x11\x1C\xE9\xD2\x9F\x6E\x90"
+                         "\xE5\x41\x4A\xE2\x3C\x45\x29\x35"
+                         "\xEC\xD6\x47\x50\xCB\x7B\xA2\x32"
+                         "\xF7\x8B\x62\xF1\xE3\x9A\xFE\xC7"
+                         "\x1D\x8C\x02\x72\x68\x09\xE9\xB6"
+                         "\x4A\x80\xE6\xB1\x56\xDF\x90\xD4"
+                         "\x93\x74\xA4\xCE\x20\x23\xBF\x48"
+                         "\xA5\xDE\x1B\xFA\x40\x69\x31\x98"
+                         "\x62\x6E\xA5\xC7\xBF\x0C\x62\xE5"
+                         "\x6D\xE1\x93\xF1\x83\x10\x1C\xCA"
+                         "\xF6\x5C\x19\xF8\x90\x78\xCB\xE4"
+                         "\x0B\x3A\xB5\xF8\x43\x86\xD3\x3F"
+                         "\xBA\x83\x34\x3C\x42\xCC\x7D\x28"
+                         "\x29\x63\x4F\xD8\x02\x17\xC5\x07"
+                         "\x2C\xA4\xAC\x79\xCB\xC3\xA9\x09"
+                         "\x81\x45\x18\xED\xE4\xCB\x42\x3B"
+                         "\x87\x2D\x23\xDC\xC5\xBA\x45\xBD"
+                         "\x92\xE5\x02\x97\x96\xCE\xAD\xEC"
+                         "\xBA\xD8\x76\xF8\xCA\xC1\x31\xEC"
+                         "\x1E\x4F\x3F\x83\xF8\x33\xE8\x6E"
+                         "\xCC\xF8\x5F\xDD\x65\x50\x99\x69"
+                         "\xAF\x48\xCE\xA5\xBA\xB6\x14\x9F"
+                         "\x05\x93\xB2\xE6\x59\xC8\x28\xFE"
+                         "\x8F\x37\xF9\x64\xB9\xA5\x56\x8F"
+                         "\xF1\x1B\x90\xEF\xAE\xEB\xFC\x09"
+                         "\x11\x7A\xF2\x19\x0A\x0A\x9A\x3C"
+                         "\xE2\x5E\x29\xFA\x31\x9B\xC1\x74"
+                         "\x1E\x10\x3E\x07\xA9\x31\x6D\xF8"
+                         "\x81\xF5\xD5\x8A\x04\x23\x51\xAC"
+                         "\xA2\xE2\x63\xFD\x27\x1F\x79\x5B"
+                         "\x1F\xE8\xDA\x11\x49\x4D\x1C\xBA"
+                         "\x54\xCC\x0F\xBA\x92\x69\xE5\xCB"
+                         "\x41\x1A\x67\xA6\x40\x82\x70\x8C"
+                         "\x19\x79\x08\xA4\x51\x20\x7D\xC9"
+                         "\x12\x27\xAE\x20\x0D\x2C\xA1\x6D"
+                         "\xF4\x55\xD4\xE7\xE6\xD4\x28\x08"
+                         "\x00\x70\x12\x56\x56\x50\xAD\x14"
+                         "\x5C\x3E\xA2\xD1\x36\x3F\x36\x48"
+                         "\xED\xB1\x57\x3E\x5D\x15\xF6\x1E"
+                         "\x53\xE9\xA4\x3E\xED\x7D\xCF\x7D"
+                         "\x29\xAF\xF3\x1E\x51\xA8\x9F\x85"
+                         "\x8B\xF0\xBB\xCE\xCC\x39\xC3\x64"
+                         "\x4B\xF2\xAD\x70\x19\xD4\x44\x8F"
+                         "\x91\x76\xE8\x15\x66\x34\x9F\xF6"
+                         "\x0F\x15\xA4\xA8\x24\xF8\x58\xB1"
+                         "\x38\x46\x47\xC7\x9B\xCA\xE9\x42"
+                         "\x44\xAA\xE6\xB5\x9C\x91\xA4\xD3"
+                         "\x16\xA0\xED\x42\xBE\xB5\x06\x19"
+                         "\xBE\x67\xE8\xBC\x22\x32\xA4\x1E"
+                         "\x93\xEB\xBE\xE9\xE1\x93\xE5\x31"
+                         "\x3A\xA2\x75\xDF\xE3\x6B\xE7\xCC"
+                         "\xB4\x70\x20\xE0\x6D\x82\x7C\xC8"
+                         "\x94\x5C\x5E\x37\x18\xAD\xED\x8B"
+                         "\x44\x86\xCA\x5E\x07\xB7\x70\x8D"
+                         "\x40\x48\x19\x73\x7C\x78\x64\x0B"
+                         "\xDB\x01\xCA\xAE\x63\x19\xE9\xD1"
+                         "\x6B\x2C\x84\x10\x45\x42\x2E\xC3"
+                         "\xDF\x7F\xAA\xE8\x87\x1B\x63\x46"
+                         "\x74\x28\x9D\x05\x30\x20\x62\x41"
+                         "\xC0\x9F\x2C\x36\x2B\x78\xD7\x26"
+                         "\xDF\x58\x51\xED\xFA\xDC\x87\x79"
+                         "\xBF\x8C\xBF\xC4\x0F\xE5\x05\xDA"
+                         "\x45\xE3\x35\x0D\x69\x91\x54\x1C"
+                         "\xE7\x2C\x49\x08\x8B\x72\xFA\x5C"
+                         "\xF1\x6B\xD9",
+               .rlen   = 1011,
                .also_non_np = 1,
                .np     = 2,
-               .tap    = { 499 - 16, 16 },
+               .tap    = { 1011 - 16, 16 },
        }, { /* Generated with Crypto++ */
                .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
                          "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
                          "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
                          "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
                          "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
-                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
-               .ilen   = 496,
+                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
+                         "\x2B\xC2\x59\xF0\x64\xFB\x92\x06"
+                         "\x9D\x34\xCB\x3F\xD6\x6D\x04\x78"
+                         "\x0F\xA6\x1A\xB1\x48\xDF\x53\xEA"
+                         "\x81\x18\x8C\x23\xBA\x2E\xC5\x5C"
+                         "\xF3\x67\xFE\x95\x09\xA0\x37\xCE"
+                         "\x42\xD9\x70\x07\x7B\x12\xA9\x1D"
+                         "\xB4\x4B\xE2\x56\xED\x84\x1B\x8F"
+                         "\x26\xBD\x31\xC8\x5F\xF6\x6A\x01"
+                         "\x98\x0C\xA3\x3A\xD1\x45\xDC\x73"
+                         "\x0A\x7E\x15\xAC\x20\xB7\x4E\xE5"
+                         "\x59\xF0\x87\x1E\x92\x29\xC0\x34"
+                         "\xCB\x62\xF9\x6D\x04\x9B\x0F\xA6"
+                         "\x3D\xD4\x48\xDF\x76\x0D\x81\x18"
+                         "\xAF\x23\xBA\x51\xE8\x5C\xF3\x8A"
+                         "\x21\x95\x2C\xC3\x37\xCE\x65\xFC"
+                         "\x70\x07\x9E\x12\xA9\x40\xD7\x4B"
+                         "\xE2\x79\x10\x84\x1B\xB2\x26\xBD"
+                         "\x54\xEB\x5F\xF6\x8D\x01\x98\x2F"
+                         "\xC6\x3A\xD1\x68\xFF\x73\x0A\xA1"
+                         "\x15\xAC\x43\xDA\x4E\xE5\x7C\x13"
+                         "\x87\x1E\xB5\x29\xC0\x57\xEE\x62"
+                         "\xF9\x90\x04\x9B\x32\xC9\x3D\xD4"
+                         "\x6B\x02\x76\x0D\xA4\x18\xAF\x46"
+                         "\xDD\x51\xE8\x7F\x16\x8A\x21\xB8"
+                         "\x2C\xC3\x5A\xF1\x65\xFC\x93\x07"
+                         "\x9E\x35\xCC\x40\xD7\x6E\x05\x79"
+                         "\x10\xA7\x1B\xB2\x49\xE0\x54\xEB"
+                         "\x82\x19\x8D\x24\xBB\x2F\xC6\x5D"
+                         "\xF4\x68\xFF\x96\x0A\xA1\x38\xCF"
+                         "\x43\xDA\x71\x08\x7C\x13\xAA\x1E"
+                         "\xB5\x4C\xE3\x57\xEE\x85\x1C\x90"
+                         "\x27\xBE\x32\xC9\x60\xF7\x6B\x02"
+                         "\x99\x0D\xA4\x3B\xD2\x46\xDD\x74"
+                         "\x0B\x7F\x16\xAD\x21\xB8\x4F\xE6"
+                         "\x5A\xF1\x88\x1F\x93\x2A\xC1\x35"
+                         "\xCC\x63\xFA\x6E\x05\x9C\x10\xA7"
+                         "\x3E\xD5\x49\xE0\x77\x0E\x82\x19"
+                         "\xB0\x24\xBB\x52\xE9\x5D\xF4\x8B"
+                         "\x22\x96\x2D\xC4\x38\xCF\x66\xFD"
+                         "\x71\x08\x9F\x13\xAA\x41\xD8\x4C"
+                         "\xE3\x7A\x11\x85\x1C\xB3\x27\xBE"
+                         "\x55\xEC\x60\xF7\x8E\x02\x99\x30"
+                         "\xC7\x3B\xD2\x69\x00\x74\x0B\xA2"
+                         "\x16\xAD\x44\xDB\x4F\xE6\x7D\x14"
+                         "\x88\x1F\xB6\x2A\xC1\x58\xEF\x63"
+                         "\xFA\x91\x05\x9C\x33\xCA\x3E\xD5"
+                         "\x6C\x03\x77\x0E\xA5\x19\xB0\x47"
+                         "\xDE\x52\xE9\x80\x17\x8B\x22\xB9"
+                         "\x2D\xC4\x5B\xF2\x66\xFD\x94\x08"
+                         "\x9F\x36\xCD\x41\xD8\x6F\x06\x7A"
+                         "\x11\xA8\x1C\xB3\x4A\xE1\x55\xEC"
+                         "\x83\x1A\x8E\x25\xBC\x30\xC7\x5E"
+                         "\xF5\x69\x00\x97\x0B\xA2\x39\xD0"
+                         "\x44\xDB\x72\x09\x7D\x14\xAB\x1F"
+                         "\xB6\x4D\xE4\x58\xEF\x86\x1D\x91"
+                         "\x28\xBF\x33\xCA\x61\xF8\x6C\x03"
+                         "\x9A\x0E\xA5\x3C\xD3\x47\xDE\x75"
+                         "\x0C\x80\x17\xAE\x22\xB9\x50\xE7"
+                         "\x5B\xF2\x89\x20\x94\x2B\xC2\x36"
+                         "\xCD\x64\xFB\x6F\x06\x9D\x11\xA8"
+                         "\x3F\xD6\x4A\xE1\x78\x0F\x83\x1A"
+                         "\xB1\x25\xBC\x53\xEA\x5E\xF5\x8C"
+                         "\x00\x97\x2E\xC5\x39\xD0\x67\xFE"
+                         "\x72\x09\xA0\x14\xAB\x42\xD9\x4D",
+               .ilen   = 1008,
                .result = "\x85\x79\x6C\x8B\x2B\x6D\x14\xF9"
                          "\xA6\x83\xB6\x80\x5B\x3A\xF3\x7E"
                          "\x30\x29\xEB\x1F\xDC\x19\x5F\xEB"
                          "\xB4\x3A\x5F\x19\xCF\x42\x1B\x22"
                          "\x0B\x2D\x7B\xF1\xC5\x43\xF7\x5E"
                          "\x12\xA8\x01\x64\x16\x0B\x26\x5A"
-                         "\x0C\x95\x0F\x40\xC5\x5A\x06\x7C",
-               .rlen   = 496,
+                         "\x0C\x95\x0F\x40\xC5\x5A\x06\x7C"
+                         "\xCF\xF5\xD5\xB7\x7A\x34\x23\xB6"
+                         "\xAA\x9E\xA8\x98\xA2\xF8\x3D\xD3"
+                         "\x3F\x23\x69\x63\x56\x96\x45\xD6"
+                         "\x74\x23\x1D\x5C\x63\xCC\xD8\x78"
+                         "\x16\xE2\x9C\xD2\x80\x02\xF2\x28"
+                         "\x69\x2F\xC4\xA8\x15\x15\x24\x3B"
+                         "\xCB\xF0\x14\xE4\x62\xC8\xF3\xD1"
+                         "\x03\x58\x1B\x33\x77\x74\x1F\xB4"
+                         "\x07\x86\xF2\x21\xB7\x41\xAE\xBF"
+                         "\x25\xC2\xFF\x51\xEF\xEA\xCE\xC4"
+                         "\x5F\xD9\xB8\x18\x6A\xF0\x0F\x0D"
+                         "\xF8\x04\xBB\x6D\x62\x33\x87\x26"
+                         "\x4F\x2F\x14\x6E\xDC\xDB\x66\x09"
+                         "\x2A\xEF\x7D\x84\x10\xAC\x82\x5E"
+                         "\xD2\xE4\xAD\x74\x7A\x6D\xCC\x3A"
+                         "\x7B\x62\xD8\xD6\x07\x2D\xF7\xDF"
+                         "\x9B\xB3\x82\xCF\x9C\x1D\x76\x5C"
+                         "\xAC\x7B\xD4\x9B\x45\xA1\x64\x11"
+                         "\x66\xF1\xA7\x0B\xF9\xDD\x00\xDD"
+                         "\xA4\x45\x3D\x3E\x03\xC9\x2E\xCB"
+                         "\xC3\x14\x84\x72\xFD\x41\xDC\xBD"
+                         "\x75\xBE\xA8\xE5\x16\x48\x64\x39"
+                         "\xCA\xF3\xE6\xDC\x25\x24\xF1\x6D"
+                         "\xB2\x8D\xC5\x38\x54\xD3\x5D\x6D"
+                         "\x0B\x29\x10\x15\x0E\x13\x3B\xAC"
+                         "\x7E\xCC\x9E\x3E\x18\x48\xA6\x02"
+                         "\xEF\x03\xB2\x2E\xE3\xD2\x70\x21"
+                         "\xB4\x19\x26\xBE\x3A\x3D\x05\xE0"
+                         "\xF8\x09\xAF\xE4\x31\x26\x92\x2F"
+                         "\x8F\x55\xAC\xED\x0B\xB2\xA5\x34"
+                         "\xBE\x50\xB1\x02\x22\x96\xE3\x40"
+                         "\x7B\x70\x50\x6E\x3B\xD5\xE5\xA0"
+                         "\x8E\xA2\xAD\x14\x60\x5C\x7A\x2B"
+                         "\x3D\x1B\x7F\xC1\xC0\x2C\x56\x36"
+                         "\xD2\x0A\x32\x06\x97\x34\xB9\xF4"
+                         "\x6F\x9F\x7E\x80\xD0\x9D\xF7\x6A"
+                         "\x21\xC1\xA2\x6A\xB1\x96\x5B\x4D"
+                         "\x7A\x15\x6C\xC4\x4E\xB8\xE0\x9E"
+                         "\x6C\x50\xF3\x9C\xC9\xB5\x23\xB7"
+                         "\xF1\xD4\x29\x4A\x23\xC4\xAD\x1E"
+                         "\x2C\x07\xD2\x43\x5F\x57\x93\xCA"
+                         "\x85\xF9\x9F\xAD\x4C\xF1\xE4\xB1"
+                         "\x1A\x8E\x28\xA4\xB6\x52\x77\x7E"
+                         "\x68\xC6\x47\xB9\x76\xCC\x65\x5F"
+                         "\x0B\xF9\x67\x93\xD8\x0E\x9A\x37"
+                         "\x5F\x41\xED\x64\x6C\xAD\x5F\xED"
+                         "\x3F\x8D\xFB\x8E\x1E\xA0\xE4\x1F"
+                         "\xC2\xC7\xED\x18\x43\xE1\x20\x86"
+                         "\x5D\xBC\x30\x70\x22\xA1\xDC\x53"
+                         "\x10\x3A\x8D\x47\x82\xCD\x7F\x59"
+                         "\x03\x2D\x6D\xF5\xE7\x79\xD4\x07"
+                         "\x68\x2A\xA5\x42\x19\x4D\xAF\xF5"
+                         "\xED\x47\x83\xBC\x5F\x62\x84\xDA"
+                         "\xDA\x41\xFF\xB0\x1D\x64\xA3\xC8"
+                         "\xBD\x4E\xE0\xB8\x7F\xEE\x55\x0A"
+                         "\x4E\x61\xB2\x51\xF6\x9C\x95\xF6"
+                         "\x92\xBB\xF6\xC5\xF0\x09\x86\xDE"
+                         "\x37\x9E\x29\xF9\x2A\x18\x73\x0D"
+                         "\xDC\x7E\x6B\x7B\x1B\x43\x8C\xEA"
+                         "\x13\xC8\x1A\x47\x0A\x2D\x6D\x56"
+                         "\xCD\xD2\xE7\x53\x1A\xAB\x1C\x3C"
+                         "\xC5\x9B\x03\x70\x29\x2A\x49\x09"
+                         "\x67\xA1\xEA\xD6\x3A\x5B\xBF\x71"
+                         "\x1D\x48\x64\x6C\xFB\xC0\x9E\x36",
+               .rlen   = 1008,
        },
  };
  
@@@ -21978,8 -22960,72 +22960,72 @@@ static struct cipher_testvec camellia_c
                          "\x7E\x42\xEC\xB6\x6F\x4D\x6B\x48"
                          "\xE6\xA6\x50\x80\x78\x9E\xF1\xB0"
                          "\x4D\xB2\x0D\x3D\xFC\x40\x25\x4D"
-                         "\x93\x11\x1C",
-               .ilen   = 499,
+                         "\x93\x11\x1C\xE9\xD2\x9F\x6E\x90"
+                         "\xE5\x41\x4A\xE2\x3C\x45\x29\x35"
+                         "\xEC\xD6\x47\x50\xCB\x7B\xA2\x32"
+                         "\xF7\x8B\x62\xF1\xE3\x9A\xFE\xC7"
+                         "\x1D\x8C\x02\x72\x68\x09\xE9\xB6"
+                         "\x4A\x80\xE6\xB1\x56\xDF\x90\xD4"
+                         "\x93\x74\xA4\xCE\x20\x23\xBF\x48"
+                         "\xA5\xDE\x1B\xFA\x40\x69\x31\x98"
+                         "\x62\x6E\xA5\xC7\xBF\x0C\x62\xE5"
+                         "\x6D\xE1\x93\xF1\x83\x10\x1C\xCA"
+                         "\xF6\x5C\x19\xF8\x90\x78\xCB\xE4"
+                         "\x0B\x3A\xB5\xF8\x43\x86\xD3\x3F"
+                         "\xBA\x83\x34\x3C\x42\xCC\x7D\x28"
+                         "\x29\x63\x4F\xD8\x02\x17\xC5\x07"
+                         "\x2C\xA4\xAC\x79\xCB\xC3\xA9\x09"
+                         "\x81\x45\x18\xED\xE4\xCB\x42\x3B"
+                         "\x87\x2D\x23\xDC\xC5\xBA\x45\xBD"
+                         "\x92\xE5\x02\x97\x96\xCE\xAD\xEC"
+                         "\xBA\xD8\x76\xF8\xCA\xC1\x31\xEC"
+                         "\x1E\x4F\x3F\x83\xF8\x33\xE8\x6E"
+                         "\xCC\xF8\x5F\xDD\x65\x50\x99\x69"
+                         "\xAF\x48\xCE\xA5\xBA\xB6\x14\x9F"
+                         "\x05\x93\xB2\xE6\x59\xC8\x28\xFE"
+                         "\x8F\x37\xF9\x64\xB9\xA5\x56\x8F"
+                         "\xF1\x1B\x90\xEF\xAE\xEB\xFC\x09"
+                         "\x11\x7A\xF2\x19\x0A\x0A\x9A\x3C"
+                         "\xE2\x5E\x29\xFA\x31\x9B\xC1\x74"
+                         "\x1E\x10\x3E\x07\xA9\x31\x6D\xF8"
+                         "\x81\xF5\xD5\x8A\x04\x23\x51\xAC"
+                         "\xA2\xE2\x63\xFD\x27\x1F\x79\x5B"
+                         "\x1F\xE8\xDA\x11\x49\x4D\x1C\xBA"
+                         "\x54\xCC\x0F\xBA\x92\x69\xE5\xCB"
+                         "\x41\x1A\x67\xA6\x40\x82\x70\x8C"
+                         "\x19\x79\x08\xA4\x51\x20\x7D\xC9"
+                         "\x12\x27\xAE\x20\x0D\x2C\xA1\x6D"
+                         "\xF4\x55\xD4\xE7\xE6\xD4\x28\x08"
+                         "\x00\x70\x12\x56\x56\x50\xAD\x14"
+                         "\x5C\x3E\xA2\xD1\x36\x3F\x36\x48"
+                         "\xED\xB1\x57\x3E\x5D\x15\xF6\x1E"
+                         "\x53\xE9\xA4\x3E\xED\x7D\xCF\x7D"
+                         "\x29\xAF\xF3\x1E\x51\xA8\x9F\x85"
+                         "\x8B\xF0\xBB\xCE\xCC\x39\xC3\x64"
+                         "\x4B\xF2\xAD\x70\x19\xD4\x44\x8F"
+                         "\x91\x76\xE8\x15\x66\x34\x9F\xF6"
+                         "\x0F\x15\xA4\xA8\x24\xF8\x58\xB1"
+                         "\x38\x46\x47\xC7\x9B\xCA\xE9\x42"
+                         "\x44\xAA\xE6\xB5\x9C\x91\xA4\xD3"
+                         "\x16\xA0\xED\x42\xBE\xB5\x06\x19"
+                         "\xBE\x67\xE8\xBC\x22\x32\xA4\x1E"
+                         "\x93\xEB\xBE\xE9\xE1\x93\xE5\x31"
+                         "\x3A\xA2\x75\xDF\xE3\x6B\xE7\xCC"
+                         "\xB4\x70\x20\xE0\x6D\x82\x7C\xC8"
+                         "\x94\x5C\x5E\x37\x18\xAD\xED\x8B"
+                         "\x44\x86\xCA\x5E\x07\xB7\x70\x8D"
+                         "\x40\x48\x19\x73\x7C\x78\x64\x0B"
+                         "\xDB\x01\xCA\xAE\x63\x19\xE9\xD1"
+                         "\x6B\x2C\x84\x10\x45\x42\x2E\xC3"
+                         "\xDF\x7F\xAA\xE8\x87\x1B\x63\x46"
+                         "\x74\x28\x9D\x05\x30\x20\x62\x41"
+                         "\xC0\x9F\x2C\x36\x2B\x78\xD7\x26"
+                         "\xDF\x58\x51\xED\xFA\xDC\x87\x79"
+                         "\xBF\x8C\xBF\xC4\x0F\xE5\x05\xDA"
+                         "\x45\xE3\x35\x0D\x69\x91\x54\x1C"
+                         "\xE7\x2C\x49\x08\x8B\x72\xFA\x5C"
+                         "\xF1\x6B\xD9",
+               .ilen   = 1011,
                .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
                          "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
                          "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
                          "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
                          "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
                          "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
-                         "\x2B\xC2\x59",
-               .rlen   = 499,
+                         "\x2B\xC2\x59\xF0\x64\xFB\x92\x06"
+                         "\x9D\x34\xCB\x3F\xD6\x6D\x04\x78"
+                         "\x0F\xA6\x1A\xB1\x48\xDF\x53\xEA"
+                         "\x81\x18\x8C\x23\xBA\x2E\xC5\x5C"
+                         "\xF3\x67\xFE\x95\x09\xA0\x37\xCE"
+                         "\x42\xD9\x70\x07\x7B\x12\xA9\x1D"
+                         "\xB4\x4B\xE2\x56\xED\x84\x1B\x8F"
+                         "\x26\xBD\x31\xC8\x5F\xF6\x6A\x01"
+                         "\x98\x0C\xA3\x3A\xD1\x45\xDC\x73"
+                         "\x0A\x7E\x15\xAC\x20\xB7\x4E\xE5"
+                         "\x59\xF0\x87\x1E\x92\x29\xC0\x34"
+                         "\xCB\x62\xF9\x6D\x04\x9B\x0F\xA6"
+                         "\x3D\xD4\x48\xDF\x76\x0D\x81\x18"
+                         "\xAF\x23\xBA\x51\xE8\x5C\xF3\x8A"
+                         "\x21\x95\x2C\xC3\x37\xCE\x65\xFC"
+                         "\x70\x07\x9E\x12\xA9\x40\xD7\x4B"
+                         "\xE2\x79\x10\x84\x1B\xB2\x26\xBD"
+                         "\x54\xEB\x5F\xF6\x8D\x01\x98\x2F"
+                         "\xC6\x3A\xD1\x68\xFF\x73\x0A\xA1"
+                         "\x15\xAC\x43\xDA\x4E\xE5\x7C\x13"
+                         "\x87\x1E\xB5\x29\xC0\x57\xEE\x62"
+                         "\xF9\x90\x04\x9B\x32\xC9\x3D\xD4"
+                         "\x6B\x02\x76\x0D\xA4\x18\xAF\x46"
+                         "\xDD\x51\xE8\x7F\x16\x8A\x21\xB8"
+                         "\x2C\xC3\x5A\xF1\x65\xFC\x93\x07"
+                         "\x9E\x35\xCC\x40\xD7\x6E\x05\x79"
+                         "\x10\xA7\x1B\xB2\x49\xE0\x54\xEB"
+                         "\x82\x19\x8D\x24\xBB\x2F\xC6\x5D"
+                         "\xF4\x68\xFF\x96\x0A\xA1\x38\xCF"
+                         "\x43\xDA\x71\x08\x7C\x13\xAA\x1E"
+                         "\xB5\x4C\xE3\x57\xEE\x85\x1C\x90"
+                         "\x27\xBE\x32\xC9\x60\xF7\x6B\x02"
+                         "\x99\x0D\xA4\x3B\xD2\x46\xDD\x74"
+                         "\x0B\x7F\x16\xAD\x21\xB8\x4F\xE6"
+                         "\x5A\xF1\x88\x1F\x93\x2A\xC1\x35"
+                         "\xCC\x63\xFA\x6E\x05\x9C\x10\xA7"
+                         "\x3E\xD5\x49\xE0\x77\x0E\x82\x19"
+                         "\xB0\x24\xBB\x52\xE9\x5D\xF4\x8B"
+                         "\x22\x96\x2D\xC4\x38\xCF\x66\xFD"
+                         "\x71\x08\x9F\x13\xAA\x41\xD8\x4C"
+                         "\xE3\x7A\x11\x85\x1C\xB3\x27\xBE"
+                         "\x55\xEC\x60\xF7\x8E\x02\x99\x30"
+                         "\xC7\x3B\xD2\x69\x00\x74\x0B\xA2"
+                         "\x16\xAD\x44\xDB\x4F\xE6\x7D\x14"
+                         "\x88\x1F\xB6\x2A\xC1\x58\xEF\x63"
+                         "\xFA\x91\x05\x9C\x33\xCA\x3E\xD5"
+                         "\x6C\x03\x77\x0E\xA5\x19\xB0\x47"
+                         "\xDE\x52\xE9\x80\x17\x8B\x22\xB9"
+                         "\x2D\xC4\x5B\xF2\x66\xFD\x94\x08"
+                         "\x9F\x36\xCD\x41\xD8\x6F\x06\x7A"
+                         "\x11\xA8\x1C\xB3\x4A\xE1\x55\xEC"
+                         "\x83\x1A\x8E\x25\xBC\x30\xC7\x5E"
+                         "\xF5\x69\x00\x97\x0B\xA2\x39\xD0"
+                         "\x44\xDB\x72\x09\x7D\x14\xAB\x1F"
+                         "\xB6\x4D\xE4\x58\xEF\x86\x1D\x91"
+                         "\x28\xBF\x33\xCA\x61\xF8\x6C\x03"
+                         "\x9A\x0E\xA5\x3C\xD3\x47\xDE\x75"
+                         "\x0C\x80\x17\xAE\x22\xB9\x50\xE7"
+                         "\x5B\xF2\x89\x20\x94\x2B\xC2\x36"
+                         "\xCD\x64\xFB\x6F\x06\x9D\x11\xA8"
+                         "\x3F\xD6\x4A\xE1\x78\x0F\x83\x1A"
+                         "\xB1\x25\xBC\x53\xEA\x5E\xF5\x8C"
+                         "\x00\x97\x2E\xC5\x39\xD0\x67\xFE"
+                         "\x72\x09\xA0\x14\xAB\x42\xD9\x4D"
+                         "\xE4\x7B\x12",
+               .rlen   = 1011,
                .also_non_np = 1,
                .np     = 2,
-               .tap    = { 499 - 16, 16 },
+               .tap    = { 1011 - 16, 16 },
        }, { /* Generated with Crypto++ */
                .key    = "\x85\x62\x3F\x1C\xF9\xD6\x1C\xF9"
                          "\xD6\xB3\x90\x6D\x4A\x90\x6D\x4A"
                          "\xB4\x3A\x5F\x19\xCF\x42\x1B\x22"
                          "\x0B\x2D\x7B\xF1\xC5\x43\xF7\x5E"
                          "\x12\xA8\x01\x64\x16\x0B\x26\x5A"
-                         "\x0C\x95\x0F\x40\xC5\x5A\x06\x7C",
-               .ilen   = 496,
+                         "\x0C\x95\x0F\x40\xC5\x5A\x06\x7C"
+                         "\xCF\xF5\xD5\xB7\x7A\x34\x23\xB6"
+                         "\xAA\x9E\xA8\x98\xA2\xF8\x3D\xD3"
+                         "\x3F\x23\x69\x63\x56\x96\x45\xD6"
+                         "\x74\x23\x1D\x5C\x63\xCC\xD8\x78"
+                         "\x16\xE2\x9C\xD2\x80\x02\xF2\x28"
+                         "\x69\x2F\xC4\xA8\x15\x15\x24\x3B"
+                         "\xCB\xF0\x14\xE4\x62\xC8\xF3\xD1"
+                         "\x03\x58\x1B\x33\x77\x74\x1F\xB4"
+                         "\x07\x86\xF2\x21\xB7\x41\xAE\xBF"
+                         "\x25\xC2\xFF\x51\xEF\xEA\xCE\xC4"
+                         "\x5F\xD9\xB8\x18\x6A\xF0\x0F\x0D"
+                         "\xF8\x04\xBB\x6D\x62\x33\x87\x26"
+                         "\x4F\x2F\x14\x6E\xDC\xDB\x66\x09"
+                         "\x2A\xEF\x7D\x84\x10\xAC\x82\x5E"
+                         "\xD2\xE4\xAD\x74\x7A\x6D\xCC\x3A"
+                         "\x7B\x62\xD8\xD6\x07\x2D\xF7\xDF"
+                         "\x9B\xB3\x82\xCF\x9C\x1D\x76\x5C"
+                         "\xAC\x7B\xD4\x9B\x45\xA1\x64\x11"
+                         "\x66\xF1\xA7\x0B\xF9\xDD\x00\xDD"
+                         "\xA4\x45\x3D\x3E\x03\xC9\x2E\xCB"
+                         "\xC3\x14\x84\x72\xFD\x41\xDC\xBD"
+                         "\x75\xBE\xA8\xE5\x16\x48\x64\x39"
+                         "\xCA\xF3\xE6\xDC\x25\x24\xF1\x6D"
+                         "\xB2\x8D\xC5\x38\x54\xD3\x5D\x6D"
+                         "\x0B\x29\x10\x15\x0E\x13\x3B\xAC"
+                         "\x7E\xCC\x9E\x3E\x18\x48\xA6\x02"
+                         "\xEF\x03\xB2\x2E\xE3\xD2\x70\x21"
+                         "\xB4\x19\x26\xBE\x3A\x3D\x05\xE0"
+                         "\xF8\x09\xAF\xE4\x31\x26\x92\x2F"
+                         "\x8F\x55\xAC\xED\x0B\xB2\xA5\x34"
+                         "\xBE\x50\xB1\x02\x22\x96\xE3\x40"
+                         "\x7B\x70\x50\x6E\x3B\xD5\xE5\xA0"
+                         "\x8E\xA2\xAD\x14\x60\x5C\x7A\x2B"
+                         "\x3D\x1B\x7F\xC1\xC0\x2C\x56\x36"
+                         "\xD2\x0A\x32\x06\x97\x34\xB9\xF4"
+                         "\x6F\x9F\x7E\x80\xD0\x9D\xF7\x6A"
+                         "\x21\xC1\xA2\x6A\xB1\x96\x5B\x4D"
+                         "\x7A\x15\x6C\xC4\x4E\xB8\xE0\x9E"
+                         "\x6C\x50\xF3\x9C\xC9\xB5\x23\xB7"
+                         "\xF1\xD4\x29\x4A\x23\xC4\xAD\x1E"
+                         "\x2C\x07\xD2\x43\x5F\x57\x93\xCA"
+                         "\x85\xF9\x9F\xAD\x4C\xF1\xE4\xB1"
+                         "\x1A\x8E\x28\xA4\xB6\x52\x77\x7E"
+                         "\x68\xC6\x47\xB9\x76\xCC\x65\x5F"
+                         "\x0B\xF9\x67\x93\xD8\x0E\x9A\x37"
+                         "\x5F\x41\xED\x64\x6C\xAD\x5F\xED"
+                         "\x3F\x8D\xFB\x8E\x1E\xA0\xE4\x1F"
+                         "\xC2\xC7\xED\x18\x43\xE1\x20\x86"
+                         "\x5D\xBC\x30\x70\x22\xA1\xDC\x53"
+                         "\x10\x3A\x8D\x47\x82\xCD\x7F\x59"
+                         "\x03\x2D\x6D\xF5\xE7\x79\xD4\x07"
+                         "\x68\x2A\xA5\x42\x19\x4D\xAF\xF5"
+                         "\xED\x47\x83\xBC\x5F\x62\x84\xDA"
+                         "\xDA\x41\xFF\xB0\x1D\x64\xA3\xC8"
+                         "\xBD\x4E\xE0\xB8\x7F\xEE\x55\x0A"
+                         "\x4E\x61\xB2\x51\xF6\x9C\x95\xF6"
+                         "\x92\xBB\xF6\xC5\xF0\x09\x86\xDE"
+                         "\x37\x9E\x29\xF9\x2A\x18\x73\x0D"
+                         "\xDC\x7E\x6B\x7B\x1B\x43\x8C\xEA"
+                         "\x13\xC8\x1A\x47\x0A\x2D\x6D\x56"
+                         "\xCD\xD2\xE7\x53\x1A\xAB\x1C\x3C"
+                         "\xC5\x9B\x03\x70\x29\x2A\x49\x09"
+                         "\x67\xA1\xEA\xD6\x3A\x5B\xBF\x71"
+                         "\x1D\x48\x64\x6C\xFB\xC0\x9E\x36",
+               .ilen   = 1008,
                .result = "\x56\xED\x84\x1B\x8F\x26\xBD\x31"
                          "\xC8\x5F\xF6\x6A\x01\x98\x0C\xA3"
                          "\x3A\xD1\x45\xDC\x73\x0A\x7E\x15"
                          "\x86\x1D\xB4\x28\xBF\x56\xED\x61"
                          "\xF8\x8F\x03\x9A\x31\xC8\x3C\xD3"
                          "\x6A\x01\x75\x0C\xA3\x17\xAE\x45"
-                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7",
-               .rlen   = 496,
+                         "\xDC\x50\xE7\x7E\x15\x89\x20\xB7"
+                         "\x2B\xC2\x59\xF0\x64\xFB\x92\x06"
+                         "\x9D\x34\xCB\x3F\xD6\x6D\x04\x78"
+                         "\x0F\xA6\x1A\xB1\x48\xDF\x53\xEA"
+                         "\x81\x18\x8C\x23\xBA\x2E\xC5\x5C"
+                         "\xF3\x67\xFE\x95\x09\xA0\x37\xCE"
+                         "\x42\xD9\x70\x07\x7B\x12\xA9\x1D"
+                         "\xB4\x4B\xE2\x56\xED\x84\x1B\x8F"
+                         "\x26\xBD\x31\xC8\x5F\xF6\x6A\x01"
+                         "\x98\x0C\xA3\x3A\xD1\x45\xDC\x73"
+                         "\x0A\x7E\x15\xAC\x20\xB7\x4E\xE5"
+                         "\x59\xF0\x87\x1E\x92\x29\xC0\x34"
+                         "\xCB\x62\xF9\x6D\x04\x9B\x0F\xA6"
+                         "\x3D\xD4\x48\xDF\x76\x0D\x81\x18"
+                         "\xAF\x23\xBA\x51\xE8\x5C\xF3\x8A"
+                         "\x21\x95\x2C\xC3\x37\xCE\x65\xFC"
+                         "\x70\x07\x9E\x12\xA9\x40\xD7\x4B"
+                         "\xE2\x79\x10\x84\x1B\xB2\x26\xBD"
+                         "\x54\xEB\x5F\xF6\x8D\x01\x98\x2F"
+                         "\xC6\x3A\xD1\x68\xFF\x73\x0A\xA1"
+                         "\x15\xAC\x43\xDA\x4E\xE5\x7C\x13"
+                         "\x87\x1E\xB5\x29\xC0\x57\xEE\x62"
+                         "\xF9\x90\x04\x9B\x32\xC9\x3D\xD4"
+                         "\x6B\x02\x76\x0D\xA4\x18\xAF\x46"
+                         "\xDD\x51\xE8\x7F\x16\x8A\x21\xB8"
+                         "\x2C\xC3\x5A\xF1\x65\xFC\x93\x07"
+                         "\x9E\x35\xCC\x40\xD7\x6E\x05\x79"
+                         "\x10\xA7\x1B\xB2\x49\xE0\x54\xEB"
+                         "\x82\x19\x8D\x24\xBB\x2F\xC6\x5D"
+                         "\xF4\x68\xFF\x96\x0A\xA1\x38\xCF"
+                         "\x43\xDA\x71\x08\x7C\x13\xAA\x1E"
+                         "\xB5\x4C\xE3\x57\xEE\x85\x1C\x90"
+                         "\x27\xBE\x32\xC9\x60\xF7\x6B\x02"
+                         "\x99\x0D\xA4\x3B\xD2\x46\xDD\x74"
+                         "\x0B\x7F\x16\xAD\x21\xB8\x4F\xE6"
+                         "\x5A\xF1\x88\x1F\x93\x2A\xC1\x35"
+                         "\xCC\x63\xFA\x6E\x05\x9C\x10\xA7"
+                         "\x3E\xD5\x49\xE0\x77\x0E\x82\x19"
+                         "\xB0\x24\xBB\x52\xE9\x5D\xF4\x8B"
+                         "\x22\x96\x2D\xC4\x38\xCF\x66\xFD"
+                         "\x71\x08\x9F\x13\xAA\x41\xD8\x4C"
+                         "\xE3\x7A\x11\x85\x1C\xB3\x27\xBE"
+                         "\x55\xEC\x60\xF7\x8E\x02\x99\x30"
+                         "\xC7\x3B\xD2\x69\x00\x74\x0B\xA2"
+                         "\x16\xAD\x44\xDB\x4F\xE6\x7D\x14"
+                         "\x88\x1F\xB6\x2A\xC1\x58\xEF\x63"
+                         "\xFA\x91\x05\x9C\x33\xCA\x3E\xD5"
+                         "\x6C\x03\x77\x0E\xA5\x19\xB0\x47"
+                         "\xDE\x52\xE9\x80\x17\x8B\x22\xB9"
+                         "\x2D\xC4\x5B\xF2\x66\xFD\x94\x08"
+                         "\x9F\x36\xCD\x41\xD8\x6F\x06\x7A"
+                         "\x11\xA8\x1C\xB3\x4A\xE1\x55\xEC"
+                         "\x83\x1A\x8E\x25\xBC\x30\xC7\x5E"
+                         "\xF5\x69\x00\x97\x0B\xA2\x39\xD0"
+                         "\x44\xDB\x72\x09\x7D\x14\xAB\x1F"
+                         "\xB6\x4D\xE4\x58\xEF\x86\x1D\x91"
+                         "\x28\xBF\x33\xCA\x61\xF8\x6C\x03"
+                         "\x9A\x0E\xA5\x3C\xD3\x47\xDE\x75"
+                         "\x0C\x80\x17\xAE\x22\xB9\x50\xE7"
+                         "\x5B\xF2\x89\x20\x94\x2B\xC2\x36"
+                         "\xCD\x64\xFB\x6F\x06\x9D\x11\xA8"
+                         "\x3F\xD6\x4A\xE1\x78\x0F\x83\x1A"
+                         "\xB1\x25\xBC\x53\xEA\x5E\xF5\x8C"
+                         "\x00\x97\x2E\xC5\x39\xD0\x67\xFE"
+                         "\x72\x09\xA0\x14\xAB\x42\xD9\x4D",
+               .rlen   = 1008,
        },
  };
  
@@@ -25084,40 -26322,38 +26322,40 @@@ static struct pcomp_testvec zlib_decomp
  static struct comp_testvec lzo_comp_tv_template[] = {
        {
                .inlen  = 70,
 -              .outlen = 46,
 +              .outlen = 57,
                .input  = "Join us now and share the software "
                        "Join us now and share the software ",
                .output = "\x00\x0d\x4a\x6f\x69\x6e\x20\x75"
 -                      "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
 -                      "\x64\x20\x73\x68\x61\x72\x65\x20"
 -                      "\x74\x68\x65\x20\x73\x6f\x66\x74"
 -                      "\x77\x70\x01\x01\x4a\x6f\x69\x6e"
 -                      "\x3d\x88\x00\x11\x00\x00",
 +                        "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
 +                        "\x64\x20\x73\x68\x61\x72\x65\x20"
 +                        "\x74\x68\x65\x20\x73\x6f\x66\x74"
 +                        "\x77\x70\x01\x32\x88\x00\x0c\x65"
 +                        "\x20\x74\x68\x65\x20\x73\x6f\x66"
 +                        "\x74\x77\x61\x72\x65\x20\x11\x00"
 +                        "\x00",
        }, {
                .inlen  = 159,
 -              .outlen = 133,
 +              .outlen = 131,
                .input  = "This document describes a compression method based on the LZO "
                        "compression algorithm.  This document defines the application of "
                        "the LZO algorithm used in UBIFS.",
 -              .output = "\x00\x2b\x54\x68\x69\x73\x20\x64"
 +              .output = "\x00\x2c\x54\x68\x69\x73\x20\x64"
                          "\x6f\x63\x75\x6d\x65\x6e\x74\x20"
                          "\x64\x65\x73\x63\x72\x69\x62\x65"
                          "\x73\x20\x61\x20\x63\x6f\x6d\x70"
                          "\x72\x65\x73\x73\x69\x6f\x6e\x20"
                          "\x6d\x65\x74\x68\x6f\x64\x20\x62"
                          "\x61\x73\x65\x64\x20\x6f\x6e\x20"
 -                        "\x74\x68\x65\x20\x4c\x5a\x4f\x2b"
 -                        "\x8c\x00\x0d\x61\x6c\x67\x6f\x72"
 -                        "\x69\x74\x68\x6d\x2e\x20\x20\x54"
 -                        "\x68\x69\x73\x2a\x54\x01\x02\x66"
 -                        "\x69\x6e\x65\x73\x94\x06\x05\x61"
 -                        "\x70\x70\x6c\x69\x63\x61\x74\x76"
 -                        "\x0a\x6f\x66\x88\x02\x60\x09\x27"
 -                        "\xf0\x00\x0c\x20\x75\x73\x65\x64"
 -                        "\x20\x69\x6e\x20\x55\x42\x49\x46"
 -                        "\x53\x2e\x11\x00\x00",
 +                        "\x74\x68\x65\x20\x4c\x5a\x4f\x20"
 +                        "\x2a\x8c\x00\x09\x61\x6c\x67\x6f"
 +                        "\x72\x69\x74\x68\x6d\x2e\x20\x20"
 +                        "\x2e\x54\x01\x03\x66\x69\x6e\x65"
 +                        "\x73\x20\x74\x06\x05\x61\x70\x70"
 +                        "\x6c\x69\x63\x61\x74\x76\x0a\x6f"
 +                        "\x66\x88\x02\x60\x09\x27\xf0\x00"
 +                        "\x0c\x20\x75\x73\x65\x64\x20\x69"
 +                        "\x6e\x20\x55\x42\x49\x46\x53\x2e"
 +                        "\x11\x00\x00",
        },
  };
  
@@@ -142,7 -142,7 +142,7 @@@ static void mxc_rnga_cleanup(struct hwr
  static int __init mxc_rnga_probe(struct platform_device *pdev)
  {
        int err = -ENODEV;
-       struct resource *res, *mem;
+       struct resource *res;
        struct mxc_rng *mxc_rng;
  
        mxc_rng = devm_kzalloc(&pdev->dev, sizeof(struct mxc_rng),
                goto err_region;
        }
  
-       mem = request_mem_region(res->start, resource_size(res), pdev->name);
-       if (mem == NULL) {
-               err = -EBUSY;
-               goto err_region;
-       }
-       mxc_rng->mem = ioremap(res->start, resource_size(res));
-       if (!mxc_rng->mem) {
-               err = -ENOMEM;
+       mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(mxc_rng->mem)) {
+               err = PTR_ERR(mxc_rng->mem);
                goto err_ioremap;
        }
  
        return 0;
  
  err_ioremap:
-       release_mem_region(res->start, resource_size(res));
  err_region:
        clk_disable_unprepare(mxc_rng->clk);
  
@@@ -206,15 -198,10 +198,10 @@@ out
  
  static int __exit mxc_rnga_remove(struct platform_device *pdev)
  {
-       struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        struct mxc_rng *mxc_rng = platform_get_drvdata(pdev);
  
        hwrng_unregister(&mxc_rng->rng);
  
-       iounmap(mxc_rng->mem);
-       release_mem_region(res->start, resource_size(res));
        clk_disable_unprepare(mxc_rng->clk);
  
        return 0;
@@@ -228,7 -215,18 +215,7 @@@ static struct platform_driver mxc_rnga_
        .remove = __exit_p(mxc_rnga_remove),
  };
  
 -static int __init mod_init(void)
 -{
 -      return platform_driver_probe(&mxc_rnga_driver, mxc_rnga_probe);
 -}
 -
 -static void __exit mod_exit(void)
 -{
 -      platform_driver_unregister(&mxc_rnga_driver);
 -}
 -
 -module_init(mod_init);
 -module_exit(mod_exit);
 +module_platform_driver_probe(mxc_rnga_driver, mxc_rnga_probe);
  
  MODULE_AUTHOR("Freescale Semiconductor, Inc.");
  MODULE_DESCRIPTION("H/W RNGA driver for i.MX");
@@@ -1650,7 -1650,11 +1650,7 @@@ struct caam_alg_template 
  };
  
  static struct caam_alg_template driver_algs[] = {
 -      /*
 -       * single-pass ipsec_esp descriptor
 -       * authencesn(*,*) is also registered, although not present
 -       * explicitly here.
 -       */
 +      /* single-pass ipsec_esp descriptor */
        {
                .name = "authenc(hmac(md5),cbc(aes))",
                .driver_name = "authenc-hmac-md5-cbc-aes-caam",
                .name = "authenc(hmac(sha224),cbc(aes))",
                .driver_name = "authenc-hmac-sha224-cbc-aes-caam",
                .blocksize = AES_BLOCK_SIZE,
+               .type = CRYPTO_ALG_TYPE_AEAD,
                .template_aead = {
                        .setkey = aead_setkey,
                        .setauthsize = aead_setauthsize,
                .name = "authenc(hmac(sha384),cbc(aes))",
                .driver_name = "authenc-hmac-sha384-cbc-aes-caam",
                .blocksize = AES_BLOCK_SIZE,
+               .type = CRYPTO_ALG_TYPE_AEAD,
                .template_aead = {
                        .setkey = aead_setkey,
                        .setauthsize = aead_setauthsize,
                .name = "authenc(hmac(sha224),cbc(des3_ede))",
                .driver_name = "authenc-hmac-sha224-cbc-des3_ede-caam",
                .blocksize = DES3_EDE_BLOCK_SIZE,
+               .type = CRYPTO_ALG_TYPE_AEAD,
                .template_aead = {
                        .setkey = aead_setkey,
                        .setauthsize = aead_setauthsize,
                .name = "authenc(hmac(sha384),cbc(des3_ede))",
                .driver_name = "authenc-hmac-sha384-cbc-des3_ede-caam",
                .blocksize = DES3_EDE_BLOCK_SIZE,
+               .type = CRYPTO_ALG_TYPE_AEAD,
                .template_aead = {
                        .setkey = aead_setkey,
                        .setauthsize = aead_setauthsize,
                .name = "authenc(hmac(sha224),cbc(des))",
                .driver_name = "authenc-hmac-sha224-cbc-des-caam",
                .blocksize = DES_BLOCK_SIZE,
+               .type = CRYPTO_ALG_TYPE_AEAD,
                .template_aead = {
                        .setkey = aead_setkey,
                        .setauthsize = aead_setauthsize,
                .name = "authenc(hmac(sha384),cbc(des))",
                .driver_name = "authenc-hmac-sha384-cbc-des-caam",
                .blocksize = DES_BLOCK_SIZE,
+               .type = CRYPTO_ALG_TYPE_AEAD,
                .template_aead = {
                        .setkey = aead_setkey,
                        .setauthsize = aead_setauthsize,
@@@ -2213,7 -2223,9 +2219,7 @@@ static int __init caam_algapi_init(void
        for (i = 0; i < ARRAY_SIZE(driver_algs); i++) {
                /* TODO: check if h/w supports alg */
                struct caam_crypto_alg *t_alg;
 -              bool done = false;
  
 -authencesn:
                t_alg = caam_alg_alloc(ctrldev, &driver_algs[i]);
                if (IS_ERR(t_alg)) {
                        err = PTR_ERR(t_alg);
                        dev_warn(ctrldev, "%s alg registration failed\n",
                                t_alg->crypto_alg.cra_driver_name);
                        kfree(t_alg);
 -              } else {
 +              } else
                        list_add_tail(&t_alg->entry, &priv->alg_list);
 -                      if (driver_algs[i].type == CRYPTO_ALG_TYPE_AEAD &&
 -                          !memcmp(driver_algs[i].name, "authenc", 7) &&
 -                          !done) {
 -                              char *name;
 -
 -                              name = driver_algs[i].name;
 -                              memmove(name + 10, name + 7, strlen(name) - 7);
 -                              memcpy(name + 7, "esn", 3);
 -
 -                              name = driver_algs[i].driver_name;
 -                              memmove(name + 10, name + 7, strlen(name) - 7);
 -                              memcpy(name + 7, "esn", 3);
 -
 -                              done = true;
 -                              goto authencesn;
 -                      }
 -              }
        }
        if (!list_empty(&priv->alg_list))
                dev_info(ctrldev, "%s algorithms registered in /proc/crypto\n",
@@@ -66,7 -66,7 +66,7 @@@ static void build_instantiation_desc(u3
  
        /*
         * load 1 to clear written reg:
 -       * resets the done interrrupt and returns the RNG to idle.
 +       * resets the done interrupt and returns the RNG to idle.
         */
        append_load_imm_u32(desc, 1, LDST_SRCDST_WORD_CLRW);
  
@@@ -304,6 -304,9 +304,9 @@@ static int caam_probe(struct platform_d
                        caam_remove(pdev);
                        return ret;
                }
+               /* Enable RDB bit so that RNG works faster */
+               setbits32(&topregs->ctrl.scfgr, SCFGR_RDBENABLE);
        }
  
        /* NOTE: RTIC detection ought to go here, around Si time */
@@@ -32,6 -32,7 +32,6 @@@
  #include <crypto/algapi.h>
  
  #include <linux/platform_data/crypto-ux500.h>
 -#include <mach/hardware.h>
  
  #include "hash_alg.h"
  
@@@ -938,6 -939,7 +938,7 @@@ static int hash_dma_final(struct ahash_
        if (!ctx->device->dma.nents) {
                dev_err(device_data->dev, "[%s] "
                                "ctx->device->dma.nents = 0", __func__);
+               ret = ctx->device->dma.nents;
                goto out;
        }
  
        if (bytes_written != req->nbytes) {
                dev_err(device_data->dev, "[%s] "
                                "hash_dma_write() failed!", __func__);
+               ret = bytes_written;
                goto out;
        }
  
@@@ -1367,14 -1370,12 +1369,12 @@@ static int hash_setkey(struct crypto_ah
        /**
         * Freed in final.
         */
-       ctx->key = kmalloc(keylen, GFP_KERNEL);
+       ctx->key = kmemdup(key, keylen, GFP_KERNEL);
        if (!ctx->key) {
                pr_err(DEV_DBG_NAME " [%s] Failed to allocate ctx->key "
                       "for %d\n", __func__, alg);
                return -ENOMEM;
        }
-       memcpy(ctx->key, key, keylen);
        ctx->keylen = keylen;
  
        return ret;