Lines Matching full:et

87     struct _krb5_encryption_type *et = _krb5_find_enctype(type);  in krb5_enctype_keysize()  local
88 if(et == NULL) { in krb5_enctype_keysize()
91 *keysize = et->keytype->size; in krb5_enctype_keysize()
100 struct _krb5_encryption_type *et = _krb5_find_enctype(type); in krb5_enctype_keybits() local
101 if(et == NULL) { in krb5_enctype_keybits()
104 *keybits = et->keytype->bits; in krb5_enctype_keybits()
114 struct _krb5_encryption_type *et = _krb5_find_enctype(type); in krb5_generate_random_keyblock() local
115 if(et == NULL) { in krb5_generate_random_keyblock()
118 ret = krb5_data_alloc(&key->keyvalue, et->keytype->size); in krb5_generate_random_keyblock()
122 if(et->keytype->random_key) in krb5_generate_random_keyblock()
123 (*et->keytype->random_key)(context, key); in krb5_generate_random_keyblock()
135 struct _krb5_encryption_type *et = _krb5_find_enctype(key->key->keytype); in _key_schedule() local
138 if (et == NULL) { in _key_schedule()
143 kt = et->keytype; in _key_schedule()
406 ct = crypto->et->keyed_checksum; in krb5_create_checksum()
408 ct = crypto->et->checksum; in krb5_create_checksum()
469 kct = crypto->et->keyed_checksum; in verify_checksum()
475 ct->name, crypto->et->name); in verify_checksum()
496 ct->name, (crypto != NULL)? crypto->et->name : "(none)"); in verify_checksum()
515 ct->name, crypto ? crypto->et->name : "(unkeyed)"); in verify_checksum()
560 ct = crypto->et->keyed_checksum; in krb5_crypto_get_checksum_type()
562 ct = crypto->et->checksum; in krb5_crypto_get_checksum_type()
798 return (crypto->et->flags & F_DERIVED) != 0; in derived_crypto()
805 return (crypto->et->flags & F_SPECIAL) != 0; in special_crypto()
825 const struct _krb5_encryption_type *et = crypto->et; in encrypt_internal_derived() local
827 checksum_sz = CHECKSUMSIZE(et->keyed_checksum); in encrypt_internal_derived()
829 sz = et->confoundersize + len; in encrypt_internal_derived()
830 block_sz = (sz + et->padsize - 1) &~ (et->padsize - 1); /* pad */ in encrypt_internal_derived()
839 krb5_generate_random_block(q, et->confoundersize); /* XXX */ in encrypt_internal_derived()
840 q += et->confoundersize; in encrypt_internal_derived()
844 et->keyed_checksum, in encrypt_internal_derived()
865 ret = (*et->encrypt)(context, dkey, p, block_sz, 1, usage, ivec); in encrypt_internal_derived()
890 const struct _krb5_encryption_type *et = crypto->et; in encrypt_internal() local
892 checksum_sz = CHECKSUMSIZE(et->checksum); in encrypt_internal()
894 sz = et->confoundersize + checksum_sz + len; in encrypt_internal()
895 block_sz = (sz + et->padsize - 1) &~ (et->padsize - 1); /* pad */ in encrypt_internal()
903 krb5_generate_random_block(q, et->confoundersize); /* XXX */ in encrypt_internal()
904 q += et->confoundersize; in encrypt_internal()
910 et->checksum, in encrypt_internal()
923 memcpy(p + et->confoundersize, cksum.checksum.data, cksum.checksum.length); in encrypt_internal()
928 ret = (*et->encrypt)(context, &crypto->key, p, block_sz, 1, 0, ivec); in encrypt_internal()
952 struct _krb5_encryption_type *et = crypto->et; in encrypt_internal_special() local
953 size_t cksum_sz = CHECKSUMSIZE(et->checksum); in encrypt_internal_special()
954 size_t sz = len + cksum_sz + et->confoundersize; in encrypt_internal_special()
966 krb5_generate_random_block(p, et->confoundersize); in encrypt_internal_special()
967 p += et->confoundersize; in encrypt_internal_special()
969 ret = (*et->encrypt)(context, &crypto->key, tmp, sz, TRUE, usage, ivec); in encrypt_internal_special()
994 struct _krb5_encryption_type *et = crypto->et; in decrypt_internal_derived() local
997 checksum_sz = CHECKSUMSIZE(et->keyed_checksum); in decrypt_internal_derived()
998 if (len < checksum_sz + et->confoundersize) { in decrypt_internal_derived()
1005 if (((len - checksum_sz) % et->padsize) != 0) { in decrypt_internal_derived()
1029 ret = (*et->encrypt)(context, dkey, p, len, 0, usage, ivec); in decrypt_internal_derived()
1037 cksum.cksumtype = CHECKSUMTYPE(et->keyed_checksum); in decrypt_internal_derived()
1049 l = len - et->confoundersize; in decrypt_internal_derived()
1050 memmove(p, p + et->confoundersize, l); in decrypt_internal_derived()
1073 struct _krb5_encryption_type *et = crypto->et; in decrypt_internal() local
1075 if ((len % et->padsize) != 0) { in decrypt_internal()
1079 checksum_sz = CHECKSUMSIZE(et->checksum); in decrypt_internal()
1080 if (len < checksum_sz + et->confoundersize) { in decrypt_internal()
1099 ret = (*et->encrypt)(context, &crypto->key, p, len, 0, 0, ivec); in decrypt_internal()
1104 ret = krb5_data_copy(&cksum.checksum, p + et->confoundersize, checksum_sz); in decrypt_internal()
1109 memset(p + et->confoundersize, 0, checksum_sz); in decrypt_internal()
1110 cksum.cksumtype = CHECKSUMTYPE(et->checksum); in decrypt_internal()
1117 l = len - et->confoundersize - checksum_sz; in decrypt_internal()
1118 memmove(p, p + et->confoundersize + checksum_sz, l); in decrypt_internal()
1138 struct _krb5_encryption_type *et = crypto->et; in decrypt_internal_special() local
1139 size_t cksum_sz = CHECKSUMSIZE(et->checksum); in decrypt_internal_special()
1140 size_t sz = len - cksum_sz - et->confoundersize; in decrypt_internal_special()
1144 if ((len % et->padsize) != 0) { in decrypt_internal_special()
1148 if (len < cksum_sz + et->confoundersize) { in decrypt_internal_special()
1162 ret = (*et->encrypt)(context, &crypto->key, p, len, FALSE, usage, ivec); in decrypt_internal_special()
1168 memmove (p, p + cksum_sz + et->confoundersize, sz); in decrypt_internal_special()
1228 const struct _krb5_encryption_type *et = crypto->et; in krb5_encrypt_iov_ivec() local
1241 headersz = et->confoundersize; in krb5_encrypt_iov_ivec()
1242 trailersz = CHECKSUMSIZE(et->keyed_checksum); in krb5_encrypt_iov_ivec()
1251 block_sz = (sz + et->padsize - 1) &~ (et->padsize - 1); /* pad */ in krb5_encrypt_iov_ivec()
1311 et->keyed_checksum, in krb5_encrypt_iov_ivec()
1359 ret = (*et->encrypt)(context, dkey, p, block_sz, 1, usage, ivec); in krb5_encrypt_iov_ivec()
1420 struct _krb5_encryption_type *et = crypto->et; in krb5_decrypt_iov_ivec() local
1428 headersz = et->confoundersize; in krb5_decrypt_iov_ivec()
1435 trailersz = CHECKSUMSIZE(et->keyed_checksum); in krb5_decrypt_iov_ivec()
1450 if ((len % et->padsize) != 0) { in krb5_decrypt_iov_ivec()
1482 ret = (*et->encrypt)(context, dkey, p, len, 0, usage, ivec); in krb5_decrypt_iov_ivec()
1523 cksum.cksumtype = CHECKSUMTYPE(et->keyed_checksum); in krb5_decrypt_iov_ivec()
1635 struct _krb5_encryption_type *et = crypto->et; in krb5_verify_checksum_iov() local
1670 cksum.cksumtype = CHECKSUMTYPE(et->keyed_checksum); in krb5_verify_checksum_iov()
1700 *len = crypto->et->blocksize; in krb5_crypto_length()
1707 if (crypto->et->padsize > 1) in krb5_crypto_length()
1708 *len = crypto->et->padsize; in krb5_crypto_length()
1713 *len = CHECKSUMSIZE(crypto->et->keyed_checksum); in krb5_crypto_length()
1716 if (crypto->et->keyed_checksum) in krb5_crypto_length()
1717 *len = CHECKSUMSIZE(crypto->et->keyed_checksum); in krb5_crypto_length()
1719 *len = CHECKSUMSIZE(crypto->et->checksum); in krb5_crypto_length()
1844 struct _krb5_encryption_type *et, in _krb5_derive_key() argument
1852 struct _krb5_key_type *kt = et->keytype; in _krb5_derive_key()
1857 if(et->blocksize * 8 < kt->bits || len != et->blocksize) { in _krb5_derive_key()
1858 nblocks = (kt->bits + et->blocksize * 8 - 1) / (et->blocksize * 8); in _krb5_derive_key()
1859 k = malloc(nblocks * et->blocksize); in _krb5_derive_key()
1865 ret = _krb5_n_fold(constant, len, k, et->blocksize); in _krb5_derive_key()
1873 memcpy(k + i * et->blocksize, in _krb5_derive_key()
1874 k + (i - 1) * et->blocksize, in _krb5_derive_key()
1875 et->blocksize); in _krb5_derive_key()
1876 (*et->encrypt)(context, key, k + i * et->blocksize, et->blocksize, in _krb5_derive_key()
1890 (*et->encrypt)(context, key, c, len, 1, 0, NULL); in _krb5_derive_key()
1909 _krb5_DES3_random_to_key(context, key->key, k, nblocks * et->blocksize); in _krb5_derive_key()
1924 free_key_schedule(context, key, et); in _krb5_derive_key()
1928 memset(k, 0, nblocks * et->blocksize); in _krb5_derive_key()
1957 struct _krb5_encryption_type *et; in krb5_derive_key() local
1962 et = _krb5_find_enctype (etype); in krb5_derive_key()
1963 if (et == NULL) { in krb5_derive_key()
1972 ret = _krb5_derive_key(context, et, &d, constant, constant_len); in krb5_derive_key()
1975 _krb5_free_key_data(context, &d, et); in krb5_derive_key()
2001 _krb5_derive_key(context, crypto->et, d, constant, sizeof(constant)); in _get_derived_key()
2038 (*crypto)->et = _krb5_find_enctype(etype); in krb5_crypto_init()
2039 if((*crypto)->et == NULL || ((*crypto)->et->flags & F_DISABLED)) { in krb5_crypto_init()
2044 if((*crypto)->et->keytype->size != key->keyvalue.length) { in krb5_crypto_init()
2069 struct _krb5_encryption_type *et) in free_key_schedule() argument
2071 if (et->keytype->cleanup) in free_key_schedule()
2072 (*et->keytype->cleanup)(context, key); in free_key_schedule()
2079 struct _krb5_encryption_type *et) in _krb5_free_key_data() argument
2083 free_key_schedule(context, key, et); in _krb5_free_key_data()
2090 struct _krb5_encryption_type *et) in free_key_usage() argument
2092 _krb5_free_key_data(context, &ku->key, et); in free_key_usage()
2113 free_key_usage(context, &crypto->key_usage[i], crypto->et); in krb5_crypto_destroy()
2115 _krb5_free_key_data(context, &crypto->key, crypto->et); in krb5_crypto_destroy()
2137 *blocksize = crypto->et->blocksize; in krb5_crypto_getblocksize()
2158 *enctype = crypto->et->type; in krb5_crypto_getenctype()
2179 *padsize = crypto->et->padsize; in krb5_crypto_getpadsize()
2200 *confoundersize = crypto->et->confoundersize; in krb5_crypto_getconfoundersize()
2220 struct _krb5_encryption_type *et = _krb5_find_enctype(enctype); in krb5_enctype_disable() local
2221 if(et == NULL) { in krb5_enctype_disable()
2228 et->flags |= F_DISABLED; in krb5_enctype_disable()
2247 struct _krb5_encryption_type *et = _krb5_find_enctype(enctype); in krb5_enctype_enable() local
2248 if(et == NULL) { in krb5_enctype_enable()
2255 et->flags &= ~F_DISABLED; in krb5_enctype_enable()
2291 struct _krb5_encryption_type *et = crypto->et; in wrapped_length() local
2292 size_t padsize = et->padsize; in wrapped_length()
2293 size_t checksumsize = CHECKSUMSIZE(et->checksum); in wrapped_length()
2296 res = et->confoundersize + checksumsize + data_len; in wrapped_length()
2306 struct _krb5_encryption_type *et = crypto->et; in wrapped_length_dervied() local
2307 size_t padsize = et->padsize; in wrapped_length_dervied()
2310 res = et->confoundersize + data_len; in wrapped_length_dervied()
2312 if (et->keyed_checksum) in wrapped_length_dervied()
2313 res += et->keyed_checksum->checksumsize; in wrapped_length_dervied()
2315 res += et->checksum->checksumsize; in wrapped_length_dervied()
2342 struct _krb5_encryption_type *et = crypto->et; in crypto_overhead() local
2345 res = CHECKSUMSIZE(et->checksum); in crypto_overhead()
2346 res += et->confoundersize; in crypto_overhead()
2347 if (et->padsize > 1) in crypto_overhead()
2348 res += et->padsize; in crypto_overhead()
2356 struct _krb5_encryption_type *et = crypto->et; in crypto_overhead_dervied() local
2359 if (et->keyed_checksum) in crypto_overhead_dervied()
2360 res = CHECKSUMSIZE(et->keyed_checksum); in crypto_overhead_dervied()
2362 res = CHECKSUMSIZE(et->checksum); in crypto_overhead_dervied()
2363 res += et->confoundersize; in crypto_overhead_dervied()
2364 if (et->padsize > 1) in crypto_overhead_dervied()
2365 res += et->padsize; in crypto_overhead_dervied()
2403 struct _krb5_encryption_type *et = _krb5_find_enctype(type); in krb5_random_to_key() local
2404 if(et == NULL) { in krb5_random_to_key()
2410 if ((et->keytype->bits + 7) / 8 > size) { in krb5_random_to_key()
2415 et->name, (int)et->keytype->size); in krb5_random_to_key()
2418 ret = krb5_data_alloc(&key->keyvalue, et->keytype->size); in krb5_random_to_key()
2422 if (et->keytype->random_to_key) in krb5_random_to_key()
2423 (*et->keytype->random_to_key)(context, key, data, size); in krb5_random_to_key()
2425 memcpy(key->keyvalue.data, data, et->keytype->size); in krb5_random_to_key()
2437 struct _krb5_encryption_type *et = _krb5_find_enctype(type); in krb5_crypto_prf_length() local
2439 if(et == NULL || et->prf_length == 0) { in krb5_crypto_prf_length()
2446 *length = et->prf_length; in krb5_crypto_prf_length()
2456 struct _krb5_encryption_type *et = crypto->et; in krb5_crypto_prf() local
2460 if(et->prf == NULL) { in krb5_crypto_prf()
2463 et->name); in krb5_crypto_prf()
2467 return (*et->prf)(context, crypto, input, output); in krb5_crypto_prf()