Home
last modified time | relevance | path

Searched refs:ktp (Results 1 – 25 of 34) sorted by relevance

12

/freebsd/crypto/krb5/src/lib/crypto/krb/
H A Denctype_util.c60 const struct krb5_keytypes *ktp; in krb5int_c_weak_enctype() local
62 ktp = find_enctype(etype); in krb5int_c_weak_enctype()
63 return (ktp != NULL && (ktp->flags & ETYPE_WEAK) != 0); in krb5int_c_weak_enctype()
69 const struct krb5_keytypes *ktp = find_enctype(etype); in krb5int_c_deprecated_enctype() local
70 return ktp == NULL || (ktp->flags & ETYPE_DEPRECATED) != 0; in krb5int_c_deprecated_enctype()
94 const struct krb5_keytypes *ktp; in krb5_string_to_enctype() local
97 ktp = &krb5int_enctypes_list[i]; in krb5_string_to_enctype()
98 if (strcasecmp(ktp->name, string) == 0) { in krb5_string_to_enctype()
99 *enctypep = ktp->etype; in krb5_string_to_enctype()
103 alias = ktp->aliases[j]; in krb5_string_to_enctype()
[all …]
H A Dcrypto_length.c33 const struct krb5_keytypes *ktp; in krb5_c_crypto_length() local
35 ktp = find_enctype(enctype); in krb5_c_crypto_length()
36 if (ktp == NULL) in krb5_c_crypto_length()
51 *size = ktp->crypto_length(ktp, type); in krb5_c_crypto_length()
64 const struct krb5_keytypes *ktp; in krb5_c_padding_length() local
66 ktp = find_enctype(enctype); in krb5_c_padding_length()
67 if (ktp == NULL) in krb5_c_padding_length()
70 *pad_length = krb5int_c_padding_length(ktp, data_length); in krb5_c_padding_length()
79 const struct krb5_keytypes *ktp; in krb5_c_crypto_length_iov() local
88 ktp = find_enctype(enctype); in krb5_c_crypto_length_iov()
[all …]
H A Denc_etm.c36 krb5int_aes2_crypto_length(const struct krb5_keytypes *ktp, in krb5int_aes2_crypto_length() argument
41 return ktp->enc->block_size; in krb5int_aes2_crypto_length()
46 return ktp->hash->hashsize / 2; in krb5int_aes2_crypto_length()
55 derive_keys(const struct krb5_keytypes *ktp, krb5_key key, in derive_keys() argument
69 ret = krb5int_derive_key(ktp->enc, ktp->hash, key, &ke, &label_data, in derive_keys()
76 ret = alloc_data(&ki, ktp->hash->hashsize / 2); in derive_keys()
79 ret = krb5int_derive_random(NULL, ktp->hash, key, &ki, &label_data, in derive_keys()
98 hmac_ivec_data(const struct krb5_keytypes *ktp, const krb5_data *ki, in hmac_ivec_data() argument
108 ret = ktp->enc->init_state(NULL, 0, &zeroivec); in hmac_ivec_data()
122 ret = alloc_data(out, ktp->hash->hashsize); in hmac_ivec_data()
[all …]
H A Dprf.c38 const struct krb5_keytypes *ktp; in krb5_c_prf_length() local
41 ktp = find_enctype(enctype); in krb5_c_prf_length()
42 if (ktp == NULL) in krb5_c_prf_length()
44 *len = ktp->prf_length; in krb5_c_prf_length()
52 const struct krb5_keytypes *ktp; in krb5_k_prf() local
58 ktp = find_enctype(key->keyblock.enctype); in krb5_k_prf()
59 if (ktp == NULL) in krb5_k_prf()
61 if (ktp->prf == NULL) in krb5_k_prf()
65 if (ktp->prf_length != output->length) in krb5_k_prf()
67 ret = ktp->prf(ktp, key, input, output); in krb5_k_prf()
H A Denc_raw.c31 krb5int_raw_crypto_length(const struct krb5_keytypes *ktp, in krb5int_raw_crypto_length() argument
36 return ktp->enc->block_size; in krb5int_raw_crypto_length()
43 krb5int_raw_encrypt(const struct krb5_keytypes *ktp, krb5_key key, in krb5int_raw_encrypt() argument
51 blocksize = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_PADDING); in krb5int_raw_encrypt()
75 return ktp->enc->encrypt(key, ivec, data, num_data); in krb5int_raw_encrypt()
79 krb5int_raw_decrypt(const struct krb5_keytypes *ktp, krb5_key key, in krb5int_raw_decrypt() argument
89 blocksize = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_PADDING); in krb5int_raw_decrypt()
100 if (ktp->enc->block_size != 0 && cipherlen < ktp->enc->block_size) in krb5int_raw_decrypt()
108 return ktp->enc->decrypt(key, ivec, data, num_data); in krb5int_raw_decrypt()
H A Ds2k_pbkdf2.c34 krb5int_dk_string_to_key(const struct krb5_keytypes *ktp, in krb5int_dk_string_to_key() argument
47 keybytes = ktp->enc->keybytes; in krb5int_dk_string_to_key()
48 keylength = ktp->enc->keylength; in krb5int_dk_string_to_key()
75 foldkeyblock.enctype = ktp->etype; in krb5int_dk_string_to_key()
77 ret = ktp->rand2key(&indata, &foldkeyblock); in krb5int_dk_string_to_key()
90 ret = krb5int_derive_keyblock(ktp->enc, NULL, foldkey, keyblock, &indata, in krb5int_dk_string_to_key()
109 pbkdf2_string_to_key(const struct krb5_keytypes *ktp, const krb5_data *string, in pbkdf2_string_to_key() argument
162 hash = (ktp->hash != NULL) ? ktp->hash : &krb5int_hash_sha1; in pbkdf2_string_to_key()
171 err = krb5int_derive_keyblock(ktp->enc, ktp->hash, tempkey, key, &usage, in pbkdf2_string_to_key()
184 krb5int_aes_string_to_key(const struct krb5_keytypes *ktp, in krb5int_aes_string_to_key() argument
[all …]
H A Dencrypt_length.c34 const struct krb5_keytypes *ktp; in krb5_c_encrypt_length() local
37 ktp = find_enctype(enctype); in krb5_c_encrypt_length()
38 if (ktp == NULL) in krb5_c_encrypt_length()
41 header_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_HEADER); in krb5_c_encrypt_length()
42 padding_len = krb5int_c_padding_length(ktp, inputlen); in krb5_c_encrypt_length()
43 trailer_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_TRAILER); in krb5_c_encrypt_length()
H A Denc_dk_hmac.c35 krb5int_dk_crypto_length(const struct krb5_keytypes *ktp, krb5_cryptotype type) in krb5int_dk_crypto_length() argument
40 return ktp->enc->block_size; in krb5int_dk_crypto_length()
43 return ktp->hash->hashsize; in krb5int_dk_crypto_length()
51 krb5int_aes_crypto_length(const struct krb5_keytypes *ktp, in krb5int_aes_crypto_length() argument
56 return ktp->enc->block_size; in krb5int_aes_crypto_length()
69 krb5int_dk_encrypt(const struct krb5_keytypes *ktp, krb5_key key, in krb5int_dk_encrypt() argument
73 const struct krb5_enc_provider *enc = ktp->enc; in krb5int_dk_encrypt()
74 const struct krb5_hash_provider *hash = ktp->hash; in krb5int_dk_encrypt()
86 blocksize = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_PADDING); in krb5int_dk_encrypt()
87 hmacsize = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_TRAILER); in krb5int_dk_encrypt()
[all …]
H A Dcrypto_int.h133 typedef unsigned int (*crypto_length_func)(const struct krb5_keytypes *ktp,
136 typedef krb5_error_code (*crypt_func)(const struct krb5_keytypes *ktp,
141 typedef krb5_error_code (*str2key_func)(const struct krb5_keytypes *ktp,
150 typedef krb5_error_code (*prf_func)(const struct krb5_keytypes *ktp,
239 unsigned int krb5int_raw_crypto_length(const struct krb5_keytypes *ktp,
241 unsigned int krb5int_arcfour_crypto_length(const struct krb5_keytypes *ktp,
243 unsigned int krb5int_dk_crypto_length(const struct krb5_keytypes *ktp,
245 unsigned int krb5int_aes_crypto_length(const struct krb5_keytypes *ktp,
247 unsigned int krb5int_camellia_crypto_length(const struct krb5_keytypes *ktp,
249 unsigned int krb5int_aes2_crypto_length(const struct krb5_keytypes *ktp,
[all …]
H A Dstate.c41 const struct krb5_keytypes *ktp; in krb5_c_init_state() local
43 ktp = find_enctype(key->enctype); in krb5_c_init_state()
44 if (ktp == NULL) in krb5_c_init_state()
46 return ktp->enc->init_state(key, keyusage, new_state); in krb5_c_init_state()
53 const struct krb5_keytypes *ktp; in krb5_c_free_state() local
55 ktp = find_enctype(key->enctype); in krb5_c_free_state()
56 if (ktp == NULL) in krb5_c_free_state()
58 ktp->enc->free_state(state); in krb5_c_free_state()
H A Dcf2.c87 const struct krb5_keytypes *ktp; in krb5_c_derive_prfplus() local
93 ktp = find_enctype((enctype == ENCTYPE_NULL) ? k->enctype : enctype); in krb5_c_derive_prfplus()
94 if (ktp == NULL) in krb5_c_derive_prfplus()
98 ret = alloc_data(&rnd, ktp->enc->keybytes); in krb5_c_derive_prfplus()
106 ret = krb5int_c_init_keyblock(context, ktp->etype, ktp->enc->keylength, in krb5_c_derive_prfplus()
110 ret = (*ktp->rand2key)(&rnd, kb); in krb5_c_derive_prfplus()
130 const struct krb5_keytypes *ktp = NULL; in krb5_c_fx_cf2_simple() local
139 ktp = find_enctype(k1->enctype); in krb5_c_fx_cf2_simple()
140 if (ktp == NULL) in krb5_c_fx_cf2_simple()
144 ret = alloc_data(&prf1, ktp->enc->keybytes); in krb5_c_fx_cf2_simple()
[all …]
H A Dencrypt.c35 const struct krb5_keytypes *ktp; in krb5_k_encrypt() local
40 ktp = find_enctype(key->keyblock.enctype); in krb5_k_encrypt()
41 if (ktp == NULL) in krb5_k_encrypt()
49 header_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_HEADER); in krb5_k_encrypt()
50 padding_len = krb5int_c_padding_length(ktp, input->length); in krb5_k_encrypt()
51 trailer_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_TRAILER); in krb5_k_encrypt()
72 ret = ktp->encrypt(ktp, key, usage, cipher_state, iov, 4); in krb5_k_encrypt()
H A Ddecrypt.c35 const struct krb5_keytypes *ktp; in krb5_k_decrypt() local
41 ktp = find_enctype(key->keyblock.enctype); in krb5_k_decrypt()
42 if (ktp == NULL) in krb5_k_decrypt()
45 if (input->enctype != ENCTYPE_UNKNOWN && ktp->etype != input->enctype) in krb5_k_decrypt()
49 header_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_HEADER); in krb5_k_decrypt()
50 trailer_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_TRAILER); in krb5_k_decrypt()
78 ret = ktp->decrypt(ktp, key, usage, cipher_state, iov, 4); in krb5_k_decrypt()
H A Dkeyed_checksum_types.c32 const struct krb5_keytypes *ktp) in is_keyed_for() argument
36 return (!ctp->enc || ktp->enc == ctp->enc); in is_keyed_for()
46 const struct krb5_keytypes *ktp; in krb5_c_keyed_checksum_types() local
51 ktp = find_enctype(enctype); in krb5_c_keyed_checksum_types()
52 if (ktp == NULL) in krb5_c_keyed_checksum_types()
58 if (is_keyed_for(ctp, ktp)) in krb5_c_keyed_checksum_types()
69 if (is_keyed_for(ctp, ktp)) in krb5_c_keyed_checksum_types()
H A Daead.c52 krb5int_c_iov_decrypt_stream(const struct krb5_keytypes *ktp, krb5_key key, in krb5int_c_iov_decrypt_stream() argument
66 header_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_HEADER); in krb5int_c_iov_decrypt_stream()
67 trailer_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_TRAILER); in krb5int_c_iov_decrypt_stream()
112 ret = ktp->decrypt(ktp, key, keyusage, ivec, iov, i); in krb5int_c_iov_decrypt_stream()
118 krb5int_c_padding_length(const struct krb5_keytypes *ktp, size_t data_length) in krb5int_c_padding_length() argument
129 header = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_HEADER); in krb5int_c_padding_length()
132 padding = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_PADDING); in krb5int_c_padding_length()
H A Ddecrypt_iov.c34 const struct krb5_keytypes *ktp; in krb5_k_decrypt_iov() local
36 ktp = find_enctype(key->keyblock.enctype); in krb5_k_decrypt_iov()
37 if (ktp == NULL) in krb5_k_decrypt_iov()
42 return krb5int_c_iov_decrypt_stream(ktp, key, usage, cipher_state, in krb5_k_decrypt_iov()
46 return ktp->decrypt(ktp, key, usage, cipher_state, data, num_data); in krb5_k_decrypt_iov()
H A Dkeylengths.c42 const struct krb5_keytypes *ktp; in krb5_c_keylengths() local
47 ktp = find_enctype(enctype); in krb5_c_keylengths()
48 if (ktp == NULL) in krb5_c_keylengths()
52 *keybytes = ktp->enc->keybytes; in krb5_c_keylengths()
54 *keylength = ktp->enc->keylength; in krb5_c_keylengths()
H A Dstring_to_key.c47 const struct krb5_keytypes *ktp; in krb5_c_string_to_key_with_params() local
50 ktp = find_enctype(enctype); in krb5_c_string_to_key_with_params()
51 if (ktp == NULL) in krb5_c_string_to_key_with_params()
53 keylength = ktp->enc->keylength; in krb5_c_string_to_key_with_params()
71 ret = (*ktp->str2key)(ktp, string, salt, params, key); in krb5_c_string_to_key_with_params()
H A Dprf_cmac.c30 krb5int_dk_cmac_prf(const struct krb5_keytypes *ktp, krb5_key key, in krb5int_dk_cmac_prf() argument
38 if (ktp->prf_length != ktp->enc->block_size) in krb5int_dk_cmac_prf()
45 ret = krb5int_derive_key(ktp->enc, NULL, key, &kp, &prfconst, in krb5int_dk_cmac_prf()
51 ret = krb5int_cmac_checksum(ktp->enc, kp, &iov, 1, out); in krb5int_dk_cmac_prf()
H A Dencrypt_iov.c34 const struct krb5_keytypes *ktp; in krb5_k_encrypt_iov() local
36 ktp = find_enctype(key->keyblock.enctype); in krb5_k_encrypt_iov()
37 if (ktp == NULL) in krb5_k_encrypt_iov()
40 return ktp->encrypt(ktp, key, usage, cipher_state, data, num_data); in krb5_k_encrypt_iov()
H A Dmandatory_sumtype.c32 const struct krb5_keytypes *ktp; in krb5int_c_mandatory_cksumtype() local
34 ktp = find_enctype(etype); in krb5int_c_mandatory_cksumtype()
35 if (ktp == NULL) in krb5int_c_mandatory_cksumtype()
37 *cksumtype = ktp->required_ctype; in krb5int_c_mandatory_cksumtype()
H A Dmake_random_key.c35 const struct krb5_keytypes *ktp; in krb5_c_make_random_key() local
41 ktp = find_enctype(enctype); in krb5_c_make_random_key()
42 if (ktp == NULL) in krb5_c_make_random_key()
44 enc = ktp->enc; in krb5_c_make_random_key()
67 ret = (*ktp->rand2key)(&random_data, random_key); in krb5_c_make_random_key()
H A Dblock_size.c34 const struct krb5_keytypes *ktp; in krb5_c_block_size() local
36 ktp = find_enctype(enctype); in krb5_c_block_size()
37 if (ktp == NULL) in krb5_c_block_size()
39 *blocksize = ktp->enc->block_size; in krb5_c_block_size()
H A Dprf_dk.c30 krb5int_dk_prf(const struct krb5_keytypes *ktp, krb5_key key, in krb5int_dk_prf() argument
33 const struct krb5_enc_provider *enc = ktp->enc; in krb5int_dk_prf()
34 const struct krb5_hash_provider *hash = ktp->hash; in krb5int_dk_prf()
51 ret = krb5int_derive_key(ktp->enc, NULL, key, &kp, &prfconst, in krb5int_dk_prf()
61 ret = ktp->enc->encrypt(kp, NULL, &iov, 1); in krb5int_dk_prf()
H A Drandom_to_key.c44 const struct krb5_keytypes *ktp; in krb5_c_random_to_key() local
50 ktp = find_enctype(enctype); in krb5_c_random_to_key()
51 if (ktp == NULL) in krb5_c_random_to_key()
54 if (random_key->length != ktp->enc->keylength) in krb5_c_random_to_key()
57 ret = ktp->rand2key(random_data, random_key); in krb5_c_random_to_key()

12