Lines Matching defs:arg
1146 static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
1161 if (arg <= 0)
1164 if ((arg > EVP_MAX_IV_LENGTH) && (arg > gctx->ivlen)) {
1167 gctx->iv = OPENSSL_malloc(arg);
1171 gctx->ivlen = arg;
1175 if (arg <= 0 || arg > 16 || c->encrypt)
1177 memcpy(c->buf, ptr, arg);
1178 gctx->taglen = arg;
1182 if (arg <= 0 || arg > 16 || !c->encrypt || gctx->taglen < 0)
1184 memcpy(ptr, c->buf, arg);
1189 if (arg == -1) {
1198 if ((arg < 4) || (gctx->ivlen - arg) < 8)
1200 if (arg)
1201 memcpy(gctx->iv, ptr, arg);
1202 if (c->encrypt && RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0)
1211 if (arg <= 0 || arg > gctx->ivlen)
1212 arg = gctx->ivlen;
1213 memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg);
1225 memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg);
1232 if (arg != 13)
1234 memcpy(c->buf, ptr, arg);
1235 gctx->tls_aad_len = arg;
1237 unsigned int len = c->buf[arg - 2] << 8 | c->buf[arg - 1];
1243 c->buf[arg - 2] = len >> 8;
1244 c->buf[arg - 1] = len & 0xff;
1613 static int aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
1751 static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
1765 arg = 15 - arg;
1767 if (arg < 2 || arg > 8)
1769 cctx->L = arg;
1773 if ((arg & 1) || arg < 4 || arg > 16)
1779 memcpy(c->buf, ptr, arg);
1781 cctx->M = arg;
1787 if (!CRYPTO_ccm128_tag(&cctx->ccm, ptr, (size_t)arg))