Home
last modified time | relevance | path

Searched refs:cipher (Results 1 – 25 of 188) sorted by relevance

12345678

/dflybsd-src/crypto/libressl/crypto/evp/
H A Devp_enc.c78 EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, in EVP_CipherInit() argument
81 if (cipher) in EVP_CipherInit()
83 return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); in EVP_CipherInit()
87 EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, in EVP_CipherInit_ex() argument
102 if (ctx->engine && ctx->cipher && in EVP_CipherInit_ex()
103 (!cipher || (cipher && (cipher->nid == ctx->cipher->nid)))) in EVP_CipherInit_ex()
106 if (cipher) { in EVP_CipherInit_ex()
110 if (ctx->cipher) { in EVP_CipherInit_ex()
125 impl = ENGINE_get_cipher_engine(cipher->nid); in EVP_CipherInit_ex()
129 ENGINE_get_cipher(impl, cipher->nid); in EVP_CipherInit_ex()
[all …]
H A Devp_lib.c74 if (c->cipher->set_asn1_parameters != NULL) in EVP_CIPHER_param_to_asn1()
75 ret = c->cipher->set_asn1_parameters(c, type); in EVP_CIPHER_param_to_asn1()
76 else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) in EVP_CIPHER_param_to_asn1()
88 if (c->cipher->get_asn1_parameters != NULL) in EVP_CIPHER_asn1_to_param()
89 ret = c->cipher->get_asn1_parameters(c, type); in EVP_CIPHER_asn1_to_param()
90 else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) in EVP_CIPHER_asn1_to_param()
197 return ctx->cipher->block_size; in EVP_CIPHER_CTX_block_size()
204 return ctx->cipher->do_cipher(ctx, out, in, inl); in EVP_Cipher()
210 return ctx->cipher; in EVP_CIPHER_CTX_cipher()
220 EVP_CIPHER_flags(const EVP_CIPHER *cipher) in EVP_CIPHER_flags() argument
[all …]
H A Dbio_enc.c86 EVP_CIPHER_CTX cipher; member
118 EVP_CIPHER_CTX_init(&ctx->cipher); in enc_new()
140 EVP_CIPHER_CTX_cleanup(&(b->cipher)); in enc_free()
192 i = EVP_CipherFinal_ex(&(ctx->cipher), in enc_read()
202 EVP_CipherUpdate(&(ctx->cipher), in enc_read()
262 EVP_CipherUpdate(&(ctx->cipher), in enc_write()
301 EVP_CipherInit_ex(&(ctx->cipher), NULL, NULL, NULL, NULL, in enc_ctrl()
302 ctx->cipher.encrypt); in enc_ctrl()
333 ret = EVP_CipherFinal_ex(&(ctx->cipher), in enc_ctrl()
357 (*c_ctx) = &(ctx->cipher); in enc_ctrl()
[all …]
H A Dp5_crpt.c79 ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de) in PKCS5_PBE_keyivgen() argument
142 if ((size_t)EVP_CIPHER_key_length(cipher) > sizeof(md_tmp)) { in PKCS5_PBE_keyivgen()
146 memcpy(key, md_tmp, EVP_CIPHER_key_length(cipher)); in PKCS5_PBE_keyivgen()
147 if ((size_t)EVP_CIPHER_iv_length(cipher) > 16) { in PKCS5_PBE_keyivgen()
151 memcpy(iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)), in PKCS5_PBE_keyivgen()
152 EVP_CIPHER_iv_length(cipher)); in PKCS5_PBE_keyivgen()
153 if (!EVP_CipherInit_ex(cctx, cipher, NULL, key, iv, en_de)) in PKCS5_PBE_keyivgen()
H A Devp_pbe.c125 const EVP_CIPHER *cipher; in EVP_PBE_CipherInit() local
148 cipher = NULL; in EVP_PBE_CipherInit()
150 cipher = EVP_get_cipherbynid(cipher_nid); in EVP_PBE_CipherInit()
151 if (!cipher) { in EVP_PBE_CipherInit()
167 if (!keygen(ctx, pass, passlen, param, cipher, md, en_de)) { in EVP_PBE_CipherInit()
251 EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, in EVP_PBE_alg_add() argument
256 if (cipher) in EVP_PBE_alg_add()
257 cipher_nid = EVP_CIPHER_nid(cipher); in EVP_PBE_alg_add()
/dflybsd-src/sys/crypto/rijndael/
H A Drijndael-api-fst.c69 int rijndael_cipherInit(cipherInstance *cipher, BYTE mode, char *IV) { in rijndael_cipherInit() argument
71 cipher->mode = mode; in rijndael_cipherInit()
76 memcpy(cipher->IV, IV, RIJNDAEL_MAX_IV_SIZE); in rijndael_cipherInit()
78 memset(cipher->IV, 0, RIJNDAEL_MAX_IV_SIZE); in rijndael_cipherInit()
83 int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key, in rijndael_blockEncrypt() argument
88 if (cipher == NULL || in rijndael_blockEncrypt()
99 switch (cipher->mode) { in rijndael_blockEncrypt()
110 memcpy(block, cipher->IV, 16); in rijndael_blockEncrypt()
117 ((u_int32_t*)block)[0] = ((u_int32_t*)cipher->IV)[0] ^ ((u_int32_t*)input)[0]; in rijndael_blockEncrypt()
118 ((u_int32_t*)block)[1] = ((u_int32_t*)cipher->IV)[1] ^ ((u_int32_t*)input)[1]; in rijndael_blockEncrypt()
[all …]
/dflybsd-src/crypto/libressl/ssl/
H A Dssl_ciphers.c26 ssl_cipher_in_list(STACK_OF(SSL_CIPHER) *ciphers, const SSL_CIPHER *cipher) in ssl_cipher_in_list() argument
31 if (sk_SSL_CIPHER_value(ciphers, i)->id == cipher->id) in ssl_cipher_in_list()
39 ssl_cipher_allowed_in_tls_version_range(const SSL_CIPHER *cipher, uint16_t min_ver, in ssl_cipher_allowed_in_tls_version_range() argument
42 switch(cipher->algorithm_ssl) { in ssl_cipher_allowed_in_tls_version_range()
56 SSL_CIPHER *cipher; in ssl_cipher_list_to_bytes() local
68 if ((cipher = sk_SSL_CIPHER_value(ciphers, i)) == NULL) in ssl_cipher_list_to_bytes()
70 if (!ssl_cipher_allowed_in_tls_version_range(cipher, min_vers, in ssl_cipher_list_to_bytes()
73 if (!ssl_security_cipher_check(s, cipher)) in ssl_cipher_list_to_bytes()
75 if (!CBB_add_u16(cbb, ssl3_cipher_get_value(cipher))) in ssl_cipher_list_to_bytes()
97 const SSL_CIPHER *cipher; in STACK_OF() local
[all …]
H A Dssl_seclevel.c98 const SSL_CIPHER *cipher = arg; in ssl_security_secop_cipher() local
112 if (cipher->algorithm_auth & SSL_aNULL) in ssl_security_secop_cipher()
115 if (cipher->algorithm_mac & SSL_MD5) in ssl_security_secop_cipher()
121 if (cipher->algorithm_enc & SSL_RC4) in ssl_security_secop_cipher()
128 if ((cipher->algorithm_mkey & (SSL_kDHE | SSL_kECDHE)) == 0 && in ssl_security_secop_cipher()
129 cipher->algorithm_ssl != SSL_TLSV1_3) in ssl_security_secop_cipher()
135 if (cipher->algorithm_mac & SSL_SHA1) in ssl_security_secop_cipher()
204 int version, void *cipher, void *ex_data) in ssl_security_default_cb() argument
210 return ssl_security_secop_cipher(ctx, ssl, bits, cipher); in ssl_security_default_cb()
261 ssl_security_cipher(const SSL *ssl, SSL_CIPHER *cipher, int secop) in ssl_security_cipher() argument
[all …]
H A Dssl_ciph.c161 const SSL_CIPHER *cipher; member
446 if (ss->cipher == NULL) in ssl_cipher_get_evp()
453 if (ss->cipher->algorithm_mac & SSL_AEAD) in ssl_cipher_get_evp()
456 switch (ss->cipher->algorithm_enc) { in ssl_cipher_get_evp()
483 switch (ss->cipher->algorithm_mac) { in ssl_cipher_get_evp()
519 if (ss->cipher->algorithm_mac == SSL_GOST89MAC) { in ssl_cipher_get_evp()
539 if (ss->cipher == NULL) in ssl_cipher_get_evp_aead()
541 if ((ss->cipher->algorithm_mac & SSL_AEAD) == 0) in ssl_cipher_get_evp_aead()
544 switch (ss->cipher->algorithm_enc) { in ssl_cipher_get_evp_aead()
567 if (s->s3->hs.cipher == NULL) in ssl_get_handshake_evp_md()
[all …]
/dflybsd-src/crypto/openssh/
H A Dcipher.c64 const struct sshcipher *cipher; member
239 if (cc == NULL || cc->cipher == NULL) in cipher_warning_message()
246 cipher_init(struct sshcipher_ctx **ccp, const struct sshcipher *cipher, in cipher_init() argument
261 cc->plaintext = (cipher->flags & CFLAG_NONE) != 0; in cipher_init()
264 if (keylen < cipher->key_len || in cipher_init()
265 (iv != NULL && ivlen < cipher_ivlen(cipher))) { in cipher_init()
270 cc->cipher = cipher; in cipher_init()
271 if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) { in cipher_init()
276 if ((cc->cipher->flags & CFLAG_NONE) != 0) { in cipher_init()
281 if ((cc->cipher->flags & CFLAG_AESCTR) != 0) { in cipher_init()
[all …]
/dflybsd-src/lib/libtcplay/
H A Dcrypto-dev.c75 get_cryptodev_cipher_id(struct tc_crypto_algo *cipher) in get_cryptodev_cipher_id() argument
77 if (strcmp(cipher->name, "AES-128-XTS") == 0) in get_cryptodev_cipher_id()
79 else if (strcmp(cipher->name, "AES-256-XTS") == 0) in get_cryptodev_cipher_id()
81 else if (strcmp(cipher->name, "TWOFISH-128-XTS") == 0) in get_cryptodev_cipher_id()
83 else if (strcmp(cipher->name, "TWOFISH-256-XTS") == 0) in get_cryptodev_cipher_id()
85 else if (strcmp(cipher->name, "SERPENT-128-XTS") == 0) in get_cryptodev_cipher_id()
87 else if (strcmp(cipher->name, "SERPENT-256-XTS") == 0) in get_cryptodev_cipher_id()
94 syscrypt(struct tc_crypto_algo *cipher, unsigned char *key, size_t klen, unsigned char *iv, in syscrypt() argument
102 cipher_id = get_cryptodev_cipher_id(cipher); in syscrypt()
105 cipher->name); in syscrypt()
[all …]
H A Dcrypto.c64 dummy_chain->key = alloc_safe_mem(dummy_chain->cipher->klen); in tc_cipher_chain_populate_keys()
74 dummy_chain->cipher->klen/2); in tc_cipher_chain_populate_keys()
75 memcpy(dummy_chain->key + dummy_chain->cipher->klen/2, in tc_cipher_chain_populate_keys()
77 dummy_chain->cipher->klen/2); in tc_cipher_chain_populate_keys()
80 used_key_bytes += dummy_chain->cipher->klen; in tc_cipher_chain_populate_keys()
124 cipher_chain->cipher->name); in tc_encrypt()
127 err = syscrypt(cipher_chain->cipher, cipher_chain->key, in tc_encrypt()
128 cipher_chain->cipher->klen, iv, in, out, in_len, 1); in tc_encrypt()
176 cipher_chain->cipher->name); in tc_decrypt()
179 err = syscrypt(cipher_chain->cipher, cipher_chain->key, in tc_decrypt()
[all …]
/dflybsd-src/lib/libutil/
H A Dlogin_crypt.c38 const char *cipher; in login_setcryptfmt() local
40 cipher = login_getcapstr(lc, "passwd_format", def, NULL); in login_setcryptfmt()
43 "passwd_format = %s\n", cipher); in login_setcryptfmt()
44 if (cipher == NULL) in login_setcryptfmt()
46 if (!crypt_set_format(cipher)) in login_setcryptfmt()
48 return (cipher); in login_setcryptfmt()
/dflybsd-src/contrib/wpa_supplicant/src/tls/
H A Dtlsv1_server.c531 char *cipher; in tlsv1_server_get_cipher() local
535 cipher = "RC4-MD5"; in tlsv1_server_get_cipher()
538 cipher = "RC4-SHA"; in tlsv1_server_get_cipher()
541 cipher = "DES-CBC-SHA"; in tlsv1_server_get_cipher()
544 cipher = "DES-CBC3-SHA"; in tlsv1_server_get_cipher()
547 cipher = "DHE-RSA-DES-CBC-SHA"; in tlsv1_server_get_cipher()
550 cipher = "DHE-RSA-DES-CBC3-SHA"; in tlsv1_server_get_cipher()
553 cipher = "ADH-RC4-MD5"; in tlsv1_server_get_cipher()
556 cipher = "ADH-DES-SHA"; in tlsv1_server_get_cipher()
559 cipher = "ADH-DES-CBC3-SHA"; in tlsv1_server_get_cipher()
[all …]
H A Dtlsv1_client.c583 char *cipher; in tlsv1_client_get_cipher() local
587 cipher = "RC4-MD5"; in tlsv1_client_get_cipher()
590 cipher = "RC4-SHA"; in tlsv1_client_get_cipher()
593 cipher = "DES-CBC-SHA"; in tlsv1_client_get_cipher()
596 cipher = "DES-CBC3-SHA"; in tlsv1_client_get_cipher()
599 cipher = "DHE-RSA-DES-CBC-SHA"; in tlsv1_client_get_cipher()
602 cipher = "DHE-RSA-DES-CBC3-SHA"; in tlsv1_client_get_cipher()
605 cipher = "ADH-RC4-MD5"; in tlsv1_client_get_cipher()
608 cipher = "ADH-DES-SHA"; in tlsv1_client_get_cipher()
611 cipher = "ADH-DES-CBC3-SHA"; in tlsv1_client_get_cipher()
[all …]
/dflybsd-src/sys/opencrypto/
H A Dskipjack.c127 skipjack_forwards(u_int8_t *plain, u_int8_t *cipher, u_int8_t **key_tables) in skipjack_forwards() argument
186 cipher [0] = wh1; cipher [1] = wl1; in skipjack_forwards()
187 cipher [2] = wh2; cipher [3] = wl2; in skipjack_forwards()
188 cipher [4] = wh3; cipher [5] = wl3; in skipjack_forwards()
189 cipher [6] = wh4; cipher [7] = wl4; in skipjack_forwards()
194 skipjack_backwards (u_int8_t *cipher, u_int8_t *plain, u_int8_t **key_tables) in skipjack_backwards() argument
197 u_int8_t wh1 = cipher[0]; u_int8_t wl1 = cipher[1]; in skipjack_backwards()
198 u_int8_t wh2 = cipher[2]; u_int8_t wl2 = cipher[3]; in skipjack_backwards()
199 u_int8_t wh3 = cipher[4]; u_int8_t wl3 = cipher[5]; in skipjack_backwards()
200 u_int8_t wh4 = cipher[6]; u_int8_t wl4 = cipher[7]; in skipjack_backwards()
/dflybsd-src/sys/netproto/802_11/wlan/
H A Dieee80211_crypto.c231 ieee80211_crypto_available(u_int cipher) in ieee80211_crypto_available() argument
233 return cipher < IEEE80211_CIPHER_MAX && ciphers[cipher] != NULL; in ieee80211_crypto_available()
264 int cipher, int flags, struct ieee80211_key *key) in ieee80211_crypto_newkey() argument
274 __func__, cipher, flags, key->wk_keyix); in ieee80211_crypto_newkey()
279 if (cipher >= IEEE80211_CIPHER_MAX) { in ieee80211_crypto_newkey()
281 "%s: invalid cipher %u\n", __func__, cipher); in ieee80211_crypto_newkey()
285 cip = ciphers[cipher]; in ieee80211_crypto_newkey()
295 __func__, cipher, cipher_modnames[cipher]); in ieee80211_crypto_newkey()
296 ieee80211_load_module(cipher_modnames[cipher]); in ieee80211_crypto_newkey()
302 cip = ciphers[cipher]; in ieee80211_crypto_newkey()
[all …]
/dflybsd-src/crypto/libressl/crypto/cms/
H A Dcms_enc.c85 enc = ec->cipher ? 1 : 0; in cms_EncryptedContent_init_bio()
96 ciph = ec->cipher; in cms_EncryptedContent_init_bio()
101 ec->cipher = NULL; in cms_EncryptedContent_init_bio()
209 const EVP_CIPHER *cipher, const unsigned char *key, size_t keylen) in cms_EncryptedContent_init() argument
211 ec->cipher = cipher; in cms_EncryptedContent_init()
220 if (cipher) in cms_EncryptedContent_init()
258 if (enc->encryptedContentInfo->cipher && enc->unprotectedAttrs) in cms_EncryptedData_init_bio()
/dflybsd-src/crypto/libressl/apps/openssl/
H A Denc.c81 const EVP_CIPHER *cipher; member
114 enc_config.cipher = NULL; in enc_opt_cipher()
119 if ((enc_config.cipher = EVP_get_cipherbyname(name)) != NULL) { in enc_opt_cipher()
368 enc_config.cipher = EVP_get_cipherbyname(pname); in enc_main()
372 enc_config.cipher == NULL && strcmp(pname, "enc") != 0) in enc_main()
374 if (!enc_config.base64 && enc_config.cipher == NULL && in enc_main()
492 if (enc_config.keystr == NULL && enc_config.cipher != NULL && in enc_main()
500 OBJ_nid2ln(EVP_CIPHER_nid(enc_config.cipher)), in enc_main()
563 if (enc_config.cipher != NULL) { in enc_main()
619 int iklen = EVP_CIPHER_key_length(enc_config.cipher); in enc_main()
[all …]
/dflybsd-src/crypto/libressl/crypto/gost/
H A Dgostr341194.c142 Gost2814789_set_key(&c->cipher, Key, 256); in hash_step()
143 Gost2814789_encrypt(H, S, &c->cipher); in hash_step()
152 Gost2814789_set_key(&c->cipher, Key, 256); in hash_step()
153 Gost2814789_encrypt(H+8, S+8, &c->cipher); in hash_step()
178 Gost2814789_set_key(&c->cipher, Key, 256); in hash_step()
179 Gost2814789_encrypt(H+16, S+16, &c->cipher); in hash_step()
188 Gost2814789_set_key(&c->cipher, Key, 256); in hash_step()
189 Gost2814789_encrypt(H+24, S+24, &c->cipher); in hash_step()
206 return Gost2814789_set_sbox(&c->cipher, nid); in GOSTR341194_Init()
/dflybsd-src/crypto/libressl/crypto/asn1/
H A Dp5_pbev2.c186 PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, unsigned char *salt, in PKCS5_pbe2_set_iv() argument
196 alg_nid = EVP_CIPHER_type(cipher); in PKCS5_pbe2_set_iv()
214 if (EVP_CIPHER_iv_length(cipher)) { in PKCS5_pbe2_set_iv()
216 memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher)); in PKCS5_pbe2_set_iv()
218 arc4random_buf(iv, EVP_CIPHER_iv_length(cipher)); in PKCS5_pbe2_set_iv()
224 if (!EVP_CipherInit_ex(&ctx, cipher, NULL, NULL, iv, 0)) in PKCS5_pbe2_set_iv()
244 keylen = EVP_CIPHER_key_length(cipher); in PKCS5_pbe2_set_iv()
290 PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, unsigned char *salt, in PKCS5_pbe2_set() argument
293 return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, NULL, -1); in PKCS5_pbe2_set()
/dflybsd-src/crypto/libressl/crypto/pem/
H A Dpem_lib.c285 EVP_CIPHER_INFO cipher; in PEM_bytes_read_bio() local
304 if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) in PEM_bytes_read_bio()
306 if (!PEM_do_header(&cipher, data, &len, cb, u)) in PEM_bytes_read_bio()
443 PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, in PEM_do_header() argument
454 if (cipher->cipher == NULL) in PEM_do_header()
464 if (!EVP_BytesToKey(cipher->cipher, EVP_md5(), &(cipher->iv[0]), in PEM_do_header()
470 o = EVP_DecryptInit_ex(&ctx, cipher->cipher, NULL, key, in PEM_do_header()
471 &(cipher->iv[0])); in PEM_do_header()
488 PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) in PEM_get_EVP_CIPHER_INFO() argument
494 cipher->cipher = NULL; in PEM_get_EVP_CIPHER_INFO()
[all …]
/dflybsd-src/contrib/wpa_supplicant/src/crypto/
H A Daes-wrap.c26 int aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain, u8 *cipher) in aes_wrap() argument
33 a = cipher; in aes_wrap()
34 r = cipher + 8; in aes_wrap()
52 r = cipher + 8; in aes_wrap()
/dflybsd-src/contrib/wpa_supplicant/src/common/
H A Dwpa_common.c352 struct wpa_ptk *ptk, int akmp, int cipher, in wpa_pmk_to_ptk() argument
394 ptk->tk_len = wpa_cipher_key_len(cipher); in wpa_pmk_to_ptk()
398 cipher); in wpa_pmk_to_ptk()
554 u8 *ick, size_t *ick_len, int akmp, int cipher, in fils_pmk_to_ptk() argument
593 ptk->tk_len = wpa_cipher_key_len(cipher); in fils_pmk_to_ptk()
1166 int wpa_cipher_valid_group(int cipher) in wpa_cipher_valid_group() argument
1168 return wpa_cipher_valid_pairwise(cipher) || in wpa_cipher_valid_group()
1169 cipher == WPA_CIPHER_GTK_NOT_USED; in wpa_cipher_valid_group()
1174 int wpa_cipher_valid_mgmt_group(int cipher) in wpa_cipher_valid_mgmt_group() argument
1176 return cipher == WPA_CIPHER_AES_128_CMAC || in wpa_cipher_valid_mgmt_group()
[all …]
H A Dwpa_common.h350 struct wpa_ptk *ptk, int akmp, int cipher,
360 u8 *ick, size_t *ick_len, int akmp, int cipher,
390 struct wpa_ptk *ptk, u8 *ptk_name, int akmp, int cipher);
436 const char * wpa_cipher_txt(int cipher);
474 int wpa_cipher_key_len(int cipher);
475 int wpa_cipher_rsc_len(int cipher);
476 enum wpa_alg wpa_cipher_to_alg(int cipher);
477 int wpa_cipher_valid_group(int cipher);
478 int wpa_cipher_valid_pairwise(int cipher);
479 int wpa_cipher_valid_mgmt_group(int cipher);
[all …]

12345678