Lines Matching refs:cipher
66 const struct sshcipher *cipher; member
230 return cc->cipher->number; in cipher_ctx_get_number()
316 if (cc == NULL || cc->cipher == NULL) in cipher_warning_message()
318 if (cc->cipher->number == SSH_CIPHER_DES) in cipher_warning_message()
325 cipher_init(struct sshcipher_ctx **ccp, const struct sshcipher *cipher, in cipher_init() argument
341 if (cipher->number == SSH_CIPHER_DES) { in cipher_init()
346 cc->plaintext = (cipher->number == SSH_CIPHER_NONE); in cipher_init()
349 if (keylen < cipher->key_len || in cipher_init()
350 (iv != NULL && ivlen < cipher_ivlen(cipher))) { in cipher_init()
355 cc->cipher = cipher; in cipher_init()
356 if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) { in cipher_init()
361 if ((cc->cipher->flags & CFLAG_AESCTR) != 0) { in cipher_init()
367 if ((cc->cipher->flags & CFLAG_NONE) != 0) { in cipher_init()
374 type = (*cipher->evptype)(); in cipher_init()
384 if (cipher_authlen(cipher) && in cipher_init()
402 if (cipher->discard_len > 0) { in cipher_init()
403 if ((junk = malloc(cipher->discard_len)) == NULL || in cipher_init()
404 (discard = malloc(cipher->discard_len)) == NULL) { in cipher_init()
409 ret = EVP_Cipher(cc->evp, discard, junk, cipher->discard_len); in cipher_init()
410 explicit_bzero(discard, cipher->discard_len); in cipher_init()
451 if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) { in cipher_crypt()
456 if ((cc->cipher->flags & CFLAG_AESCTR) != 0) { in cipher_crypt()
463 if ((cc->cipher->flags & CFLAG_NONE) != 0) { in cipher_crypt()
472 if (authlen != cipher_authlen(cc->cipher)) in cipher_crypt()
490 if (len % cc->cipher->block_size) in cipher_crypt()
514 if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) in cipher_get_length()
528 if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) in cipher_free()
530 else if ((cc->cipher->flags & CFLAG_AESCTR) != 0) in cipher_free()
548 const struct sshcipher *cipher, const char *passphrase, int do_encrypt) in cipher_set_key_string() argument
558 r = cipher_init(ccp, cipher, digest, 16, NULL, 0, do_encrypt); in cipher_set_key_string()
572 const struct sshcipher *c = cc->cipher; in cipher_get_keyiv_len()
577 else if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) in cipher_get_keyiv_len()
579 else if ((cc->cipher->flags & CFLAG_AESCTR) != 0) in cipher_get_keyiv_len()
591 const struct sshcipher *c = cc->cipher; in cipher_get_keyiv()
596 if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) { in cipher_get_keyiv()
601 if ((cc->cipher->flags & CFLAG_AESCTR) != 0) { in cipher_get_keyiv()
607 if ((cc->cipher->flags & CFLAG_NONE) != 0) in cipher_get_keyiv()
648 const struct sshcipher *c = cc->cipher; in cipher_set_keyiv()
653 if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) in cipher_set_keyiv()
655 if ((cc->cipher->flags & CFLAG_NONE) != 0) in cipher_set_keyiv()
693 #define EVP_X_STATE_LEN(evp) (evp)->cipher->ctx_size
700 const struct sshcipher *c = cc->cipher; in cipher_get_keycontext()
719 const struct sshcipher *c = cc->cipher; in cipher_set_keycontext()