/freebsd/sys/security/mac/ |
H A D | mac_posix_sem.c | 67 mac_posixsem_init(struct ksem *ks) in mac_posixsem_init() argument 71 ks->ks_label = mac_posixsem_label_alloc(); in mac_posixsem_init() 73 ks->ks_label = NULL; in mac_posixsem_init() 85 mac_posixsem_destroy(struct ksem *ks) in mac_posixsem_destroy() argument 88 if (ks->ks_label != NULL) { in mac_posixsem_destroy() 89 mac_posixsem_label_free(ks->ks_label); in mac_posixsem_destroy() 90 ks->ks_label = NULL; in mac_posixsem_destroy() 95 mac_posixsem_create(struct ucred *cred, struct ksem *ks) in mac_posixsem_create() argument 98 MAC_POLICY_PERFORM_NOSLEEP(posixsem_create, cred, ks, ks->ks_label); in mac_posixsem_create() 105 mac_posixsem_check_open(struct ucred *cred, struct ksem *ks) in mac_posixsem_check_open() argument [all …]
|
/freebsd/sys/contrib/openzfs/module/icp/algs/skein/ |
H A D | skein_block.c | 54 #define ks (kw + KW_KEY_BASE) macro 110 ks[0] = ctx->X[0]; in Skein_256_Process_Block() 111 ks[1] = ctx->X[1]; in Skein_256_Process_Block() 112 ks[2] = ctx->X[2]; in Skein_256_Process_Block() 113 ks[3] = ctx->X[3]; in Skein_256_Process_Block() 114 ks[4] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^ SKEIN_KS_PARITY; in Skein_256_Process_Block() 121 Skein_Show_Block(BLK_BITS, &ctx->h, ctx->X, blkPtr, w, ks, ts); in Skein_256_Process_Block() 123 X0 = w[0] + ks[0]; /* do the first full key injection */ in Skein_256_Process_Block() 124 X1 = w[1] + ks[1] + ts[0]; in Skein_256_Process_Block() 125 X2 = w[2] + ks[2] + ts[1]; in Skein_256_Process_Block() [all …]
|
/freebsd/sys/crypto/skein/ |
H A D | skein_block.c | 40 #define ks (kw + KW_KEY_BASE) macro 95 ks[0] = ctx->X[0]; in Skein_256_Process_Block() 96 ks[1] = ctx->X[1]; in Skein_256_Process_Block() 97 ks[2] = ctx->X[2]; in Skein_256_Process_Block() 98 ks[3] = ctx->X[3]; in Skein_256_Process_Block() 99 ks[4] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^ SKEIN_KS_PARITY; in Skein_256_Process_Block() 105 Skein_Show_Block(BLK_BITS,&ctx->h,ctx->X,blkPtr,w,ks,ts); in Skein_256_Process_Block() 107 X0 = w[0] + ks[0]; /* do the first full key injection */ in Skein_256_Process_Block() 108 X1 = w[1] + ks[1] + ts[0]; in Skein_256_Process_Block() 109 X2 = w[2] + ks[2] + ts[1]; in Skein_256_Process_Block() [all …]
|
/freebsd/sys/kern/ |
H A D | uipc_sem.c | 119 static int ksem_access(struct ksem *ks, struct ucred *ucred); 125 static void ksem_drop(struct ksem *ks); 128 static struct ksem *ksem_hold(struct ksem *ks); 129 static void ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks); 165 struct ksem *ks; in ksem_stat() local 170 ks = fp->f_data; in ksem_stat() 173 error = mac_posixsem_check_stat(active_cred, fp->f_cred, ks); in ksem_stat() 185 sb->st_atim = ks->ks_atime; in ksem_stat() 186 sb->st_ctim = ks->ks_ctime; in ksem_stat() 187 sb->st_mtim = ks->ks_mtime; in ksem_stat() [all …]
|
/freebsd/contrib/netbsd-tests/lib/libdes/ |
H A D | t_des.c | 387 des_key_schedule ks; in cfb_test() local 389 des_set_key_checked(&cfb_key, ks); in cfb_test() 391 des_cfb_encrypt(plain, cfb_buf1, bits, sizeof(plain), ks, &cfb_tmp, in cfb_test() 396 des_cfb_encrypt(cfb_buf1, cfb_buf2, bits, sizeof(plain), ks, &cfb_tmp, in cfb_test() 408 des_key_schedule ks; in cfb64_test() local 410 des_set_key_checked(&cfb_key, ks); in cfb64_test() 413 des_cfb64_encrypt(plain, cfb_buf1, 12, ks, &cfb_tmp, &n, DES_ENCRYPT); in cfb64_test() 414 des_cfb64_encrypt(&(plain[12]), &(cfb_buf1[12]), sizeof(plain) - 12, ks, in cfb64_test() 420 des_cfb64_encrypt(cfb_buf1, cfb_buf2, 17, ks, &cfb_tmp, &n, DES_DECRYPT); in cfb64_test() 422 sizeof(plain) - 17, ks, &cfb_tmp, &n, DES_DECRYPT); in cfb64_test() [all …]
|
/freebsd/crypto/openssl/test/ |
H A D | destest.c | 310 DES_key_schedule ks; in test_des_ecb() local 314 DES_set_key_unchecked(&key_data[i], &ks); in test_des_ecb() 318 DES_ecb_encrypt(&in, &out, &ks, DES_ENCRYPT); in test_des_ecb() 319 DES_ecb_encrypt(&out, &outin, &ks, DES_DECRYPT); in test_des_ecb() 337 DES_key_schedule ks, ks2, ks3; in test_des_ede_ecb() local 340 DES_set_key_unchecked(&key_data[i], &ks); in test_des_ede_ecb() 346 DES_ecb3_encrypt(&in, &out, &ks, &ks2, &ks, DES_ENCRYPT); in test_des_ede_ecb() 347 DES_ecb3_encrypt(&out, &outin, &ks, &ks2, &ks, DES_DECRYPT); in test_des_ede_ecb() 367 DES_key_schedule ks; in test_des_cbc() local 370 if (!TEST_int_eq(DES_set_key_checked(&cbc_key, &ks), 0)) in test_des_cbc() [all …]
|
/freebsd/sys/kgssapi/krb5/ |
H A D | kcrypto.h | 61 typedef void init_func(struct krb5_key_state *ks); 62 typedef void destroy_func(struct krb5_key_state *ks); 63 typedef void set_key_func(struct krb5_key_state *ks, const void *in); 64 typedef void random_to_key_func(struct krb5_key_state *ks, const void *in); 65 typedef void encrypt_func(const struct krb5_key_state *ks, 67 typedef void checksum_func(const struct krb5_key_state *ks, int usage, 100 krb5_set_key(struct krb5_key_state *ks, const void *keydata) in krb5_set_key() argument 103 ks->ks_class->ec_set_key(ks, keydata); in krb5_set_key() 107 krb5_random_to_key(struct krb5_key_state *ks, const void *keydata) in krb5_random_to_key() argument 110 ks->ks_class->ec_random_to_key(ks, keydata); in krb5_random_to_key() [all …]
|
H A D | kcrypto_aes.c | 50 aes_init(struct krb5_key_state *ks) in aes_init() argument 56 ks->ks_priv = as; in aes_init() 60 aes_destroy(struct krb5_key_state *ks) in aes_destroy() argument 62 struct aes_state *as = ks->ks_priv; in aes_destroy() 69 free(ks->ks_priv, M_GSSAPI); in aes_destroy() 73 aes_set_key(struct krb5_key_state *ks, const void *in) in aes_set_key() argument 75 void *kp = ks->ks_key; in aes_set_key() 76 struct aes_state *as = ks->ks_priv; in aes_set_key() 80 bcopy(in, kp, ks->ks_class->ec_keylen); in aes_set_key() 93 csp.csp_auth_klen = ks->ks_class->ec_keybits / 8; in aes_set_key() [all …]
|
H A D | kcrypto.c | 62 struct krb5_key_state *ks; in krb5_create_key() local 64 ks = malloc(sizeof(struct krb5_key_state), M_GSSAPI, M_WAITOK); in krb5_create_key() 65 ks->ks_class = ec; in krb5_create_key() 66 refcount_init(&ks->ks_refs, 1); in krb5_create_key() 67 ks->ks_key = malloc(ec->ec_keylen, M_GSSAPI, M_WAITOK); in krb5_create_key() 68 ec->ec_init(ks); in krb5_create_key() 70 return (ks); in krb5_create_key() 74 krb5_free_key(struct krb5_key_state *ks) in krb5_free_key() argument 77 if (refcount_release(&ks->ks_refs)) { in krb5_free_key() 78 ks->ks_class->ec_destroy(ks); in krb5_free_key() [all …]
|
/freebsd/contrib/llvm-project/openmp/runtime/src/ |
H A D | kmp_debug.h | 114 int ks; \ 115 __kmp_disable(&ks); \ 117 __kmp_enable(ks); \ 121 int ks; \ 122 __kmp_disable(&ks); \ 124 __kmp_enable(ks); \ 128 int ks; \ 129 __kmp_disable(&ks); \ 131 __kmp_enable(ks); \ 135 int ks; \ [all …]
|
/freebsd/crypto/openssl/crypto/des/ |
H A D | str2key.c | 21 DES_key_schedule ks; in DES_string_to_key() local 40 DES_set_key_unchecked(key, &ks); in DES_string_to_key() 41 DES_cbc_cksum((const unsigned char *)str, key, length, &ks, key); in DES_string_to_key() 42 OPENSSL_cleanse(&ks, sizeof(ks)); in DES_string_to_key() 48 DES_key_schedule ks; in DES_string_to_2keys() local 76 DES_set_key_unchecked(key1, &ks); in DES_string_to_2keys() 77 DES_cbc_cksum((const unsigned char *)str, key1, length, &ks, key1); in DES_string_to_2keys() 78 DES_set_key_unchecked(key2, &ks); in DES_string_to_2keys() 79 DES_cbc_cksum((const unsigned char *)str, key2, length, &ks, key2); in DES_string_to_2keys() 80 OPENSSL_cleanse(&ks, sizeof(ks)); in DES_string_to_2keys()
|
/freebsd/sys/vm/ |
H A D | vm_glue.c | 281 static vm_pindex_t vm_kstack_pindex(vm_offset_t ks, int npages); 449 vm_offset_t ks; in vm_thread_stack_create() local 460 ks = vm_thread_alloc_kstack_kva(ptoa(pages + KSTACK_GUARD_PAGES), in vm_thread_stack_create() 462 if (ks == 0) in vm_thread_stack_create() 464 ks += ptoa(KSTACK_GUARD_PAGES); in vm_thread_stack_create() 469 if (vm_thread_stack_back(ks, ma, pages, req, domain) != 0) { in vm_thread_stack_create() 470 vm_thread_free_kstack_kva(ks - ptoa(KSTACK_GUARD_PAGES), in vm_thread_stack_create() 475 pmap_qremove(ks - ptoa(KSTACK_GUARD_PAGES), in vm_thread_stack_create() 480 pmap_qenter(ks, ma, pages); in vm_thread_stack_create() 481 return (ks); in vm_thread_stack_create() [all …]
|
/freebsd/crypto/openssl/providers/implementations/ciphers/ |
H A D | cipher_aes_hw.c | 24 AES_KEY *ks = &adat->ks.ks; in cipher_hw_aes_initkey() local 26 dat->ks = ks; in cipher_hw_aes_initkey() 32 ret = HWAES_set_decrypt_key(key, keylen * 8, ks); in cipher_hw_aes_initkey() 47 ret = AES_set_decrypt_key(key, keylen * 8, ks); in cipher_hw_aes_initkey() 54 ret = vpaes_set_decrypt_key(key, keylen * 8, ks); in cipher_hw_aes_initkey() 61 ret = AES_set_decrypt_key(key, keylen * 8, ks); in cipher_hw_aes_initkey() 69 ret = HWAES_set_encrypt_key(key, keylen * 8, ks); in cipher_hw_aes_initkey() 92 ret = AES_set_encrypt_key(key, keylen * 8, ks); in cipher_hw_aes_initkey() 99 ret = vpaes_set_encrypt_key(key, keylen * 8, ks); in cipher_hw_aes_initkey() 106 ret = AES_set_encrypt_key(key, keylen * 8, ks); in cipher_hw_aes_initkey()
|
H A D | cipher_aes_hw_aesni.inc | 26 AES_KEY *ks = &adat->ks.ks; 28 dat->ks = ks; 32 ret = aesni_set_decrypt_key(key, keylen * 8, ks); 37 ret = aesni_set_encrypt_key(key, keylen * 8, ks); 58 const AES_KEY *ks = ctx->ks; 60 aesni_cbc_encrypt(in, out, len, ks, ctx->iv, ctx->enc); 71 aesni_ecb_encrypt(in, out, len, ctx->ks, ctx->enc);
|
H A D | cipher_aria_hw.c | 18 ARIA_KEY *ks = &adat->ks.ks; in cipher_hw_aria_initkey() local 21 ret = ossl_aria_set_encrypt_key(key, keylen * 8, ks); in cipher_hw_aria_initkey() 23 ret = ossl_aria_set_decrypt_key(key, keylen * 8, ks); in cipher_hw_aria_initkey() 28 dat->ks = ks; in cipher_hw_aria_initkey()
|
H A D | ciphercommon_hw.c | 20 (*dat->stream.cbc) (in, out, len, dat->ks, dat->iv, dat->enc); in ossl_cipher_hw_generic_cbc() 22 CRYPTO_cbc128_encrypt(in, out, len, dat->ks, dat->iv, dat->block); in ossl_cipher_hw_generic_cbc() 24 CRYPTO_cbc128_decrypt(in, out, len, dat->ks, dat->iv, dat->block); in ossl_cipher_hw_generic_cbc() 38 (*dat->stream.ecb) (in, out, len, dat->ks, dat->enc); in ossl_cipher_hw_generic_ecb() 42 (*dat->block) (in + i, out + i, dat->ks); in ossl_cipher_hw_generic_ecb() 53 CRYPTO_ofb128_encrypt(in, out, len, dat->ks, dat->iv, &num, dat->block); in ossl_cipher_hw_generic_ofb128() 64 CRYPTO_cfb128_encrypt(in, out, len, dat->ks, dat->iv, &num, dat->enc, in ossl_cipher_hw_generic_cfb128() 76 CRYPTO_cfb128_8_encrypt(in, out, len, dat->ks, dat->iv, &num, dat->enc, in ossl_cipher_hw_generic_cfb8() 89 CRYPTO_cfb128_1_encrypt(in, out, len, dat->ks, dat->iv, &num, in ossl_cipher_hw_generic_cfb1() 96 CRYPTO_cfb128_1_encrypt(in, out, MAXBITCHUNK * 8, dat->ks, in ossl_cipher_hw_generic_cfb1() [all …]
|
H A D | cipher_idea_hw.c | 23 IDEA_KEY_SCHEDULE *ks = &(ictx->ks.ks); in cipher_hw_idea_initkey() local 28 IDEA_set_encrypt_key(key, ks); in cipher_hw_idea_initkey() 33 IDEA_set_decrypt_key(&tmp, ks); in cipher_hw_idea_initkey() 61 #define IDEA2_ecb_encrypt(in, out, ks, enc) IDEA_ecb_encrypt(in, out, ks) argument
|
H A D | cipher_rc4_hmac_md5_hw.c | 40 RC4_set_key(&ctx->ks.ks, keylen, key); in cipher_hw_rc4_hmac_md5_initkey() 54 RC4_KEY *ks = &ctx->ks.ks; in cipher_hw_rc4_hmac_md5_cipher() local 57 size_t rc4_off = MOD - 1 - (ks->x & (MOD - 1)); in cipher_hw_rc4_hmac_md5_cipher() 78 RC4(ks, rc4_off, in, out); in cipher_hw_rc4_hmac_md5_cipher() 80 rc4_md5_enc(ks, in + rc4_off, out + rc4_off, in cipher_hw_rc4_hmac_md5_cipher() 106 RC4(ks, len - rc4_off, out + rc4_off, out + rc4_off); in cipher_hw_rc4_hmac_md5_cipher() 108 RC4(ks, len - rc4_off, in + rc4_off, out + rc4_off); in cipher_hw_rc4_hmac_md5_cipher() 123 RC4(ks, rc4_off, in, out); in cipher_hw_rc4_hmac_md5_cipher() 126 rc4_md5_enc(ks, in + rc4_off, out + rc4_off, in cipher_hw_rc4_hmac_md5_cipher() 142 RC4(ks, len - rc4_off, in + rc4_off, out + rc4_off); in cipher_hw_rc4_hmac_md5_cipher()
|
H A D | cipher_des_hw.c | 24 DES_key_schedule *ks = &dctx->dks.ks; in cipher_hw_des_initkey() local 30 des_t4_key_expand(&deskey[0], ks); in cipher_hw_des_initkey() 37 DES_set_key_unchecked(deskey, ks); in cipher_hw_des_initkey() 48 dst->ks = &dctx->dks.ks; in cipher_hw_des_copyctx() 55 DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks); in cipher_hw_des_ecb_cipher() 69 DES_key_schedule *key = &(dctx->dks.ks); in cipher_hw_des_cbc_cipher() 93 DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks); in cipher_hw_des_ofb64_cipher() 112 DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks); in cipher_hw_des_cfb64_cipher() 138 DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks); in cipher_hw_des_cfb1_cipher() 165 DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks); in cipher_hw_des_cfb8_cipher()
|
H A D | cipher_aes_gcm_hw.c | 24 AES_KEY *ks = &actx->ks.ks; in aes_gcm_initkey() local 29 GCM_HW_SET_KEY_CTR_FN(ks, HWAES_set_encrypt_key, HWAES_encrypt, in aes_gcm_initkey() 32 GCM_HW_SET_KEY_CTR_FN(ks, HWAES_set_encrypt_key, HWAES_encrypt, NULL); in aes_gcm_initkey() 39 GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt, in aes_gcm_initkey() 46 GCM_HW_SET_KEY_CTR_FN(ks, vpaes_set_encrypt_key, vpaes_encrypt, NULL); in aes_gcm_initkey() 52 GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt, in aes_gcm_initkey() 55 GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt, NULL); in aes_gcm_initkey()
|
H A D | cipher_desx_hw.c | 23 #define ks1 tks.ks[0] 24 #define ks2 tks.ks[1].ks[0].cblock 25 #define ks3 tks.ks[2].ks[0].cblock 47 dst->ks = &dctx->tks.ks; in cipher_hw_desx_copyctx()
|
/freebsd/crypto/openssl/crypto/seed/ |
H A D | seed.c | 447 SEED_KEY_SCHEDULE *ks) in SEED_set_key() argument 459 KEYUPDATE_TEMP(t0, t1, &ks->data[0]); in SEED_set_key() 461 KEYUPDATE_TEMP(t0, t1, &ks->data[2]); in SEED_set_key() 465 KEYUPDATE_TEMP(t0, t1, &ks->data[4]); in SEED_set_key() 467 KEYUPDATE_TEMP(t0, t1, &ks->data[6]); in SEED_set_key() 469 KEYUPDATE_TEMP(t0, t1, &ks->data[8]); in SEED_set_key() 471 KEYUPDATE_TEMP(t0, t1, &ks->data[10]); in SEED_set_key() 473 KEYUPDATE_TEMP(t0, t1, &ks->data[12]); in SEED_set_key() 475 KEYUPDATE_TEMP(t0, t1, &ks->data[14]); in SEED_set_key() 477 KEYUPDATE_TEMP(t0, t1, &ks->data[16]); in SEED_set_key() [all …]
|
/freebsd/crypto/openssl/include/openssl/ |
H A D | seed.h | 78 SEED_KEY_SCHEDULE *ks); 82 const SEED_KEY_SCHEDULE *ks); 86 const SEED_KEY_SCHEDULE *ks); 90 const SEED_KEY_SCHEDULE *ks, int enc); 93 const SEED_KEY_SCHEDULE *ks, 98 size_t len, const SEED_KEY_SCHEDULE *ks, 103 size_t len, const SEED_KEY_SCHEDULE *ks,
|
/freebsd/crypto/openssl/crypto/evp/ |
H A D | e_idea.c | 30 IDEA_KEY_SCHEDULE ks; member 45 IDEA_ecb_encrypt(in + i, out + i, &EVP_C_DATA(EVP_IDEA_KEY,ctx)->ks); in idea_ecb_cipher() 49 BLOCK_CIPHER_func_cbc(idea, IDEA, EVP_IDEA_KEY, ks) in BLOCK_CIPHER_func_cbc() argument 50 BLOCK_CIPHER_func_ofb(idea, IDEA, 64, EVP_IDEA_KEY, ks) in BLOCK_CIPHER_func_cbc() 51 BLOCK_CIPHER_func_cfb(idea, IDEA, 64, EVP_IDEA_KEY, ks) in BLOCK_CIPHER_func_cbc() 67 IDEA_set_encrypt_key(key, &EVP_C_DATA(EVP_IDEA_KEY,ctx)->ks); in BLOCK_CIPHER_func_cbc() 72 IDEA_set_decrypt_key(&tmp, &EVP_C_DATA(EVP_IDEA_KEY,ctx)->ks); in BLOCK_CIPHER_func_cbc()
|
/freebsd/crypto/libecc/src/hash/ |
H A D | belt-hash.c | 76 int belt_init(const u8 *k, u32 k_len, u8 ks[BELT_KEY_SCHED_LEN]) in belt_init() 84 ks[i] = k[i]; in belt_init() 85 ks[i + 16] = k[i]; in belt_init() 91 ks[i] = k[i]; in belt_init() 94 ks[i] = k[i - 24] ^ k[i - 20] ^ k[i - 16]; in belt_init() 100 ks[i] = k[i]; in belt_init() 117 void belt_encrypt(const u8 in[BELT_BLOCK_LEN], u8 out[BELT_BLOCK_LEN], const u8 ks[BELT_KEY_SCHED_L… in belt_encrypt() 129 GET_UINT32_LE(key, ks, 4*KIdx[i][0]); in belt_encrypt() 131 GET_UINT32_LE(key, ks, 4*KIdx[i][1]); in belt_encrypt() 133 GET_UINT32_LE(key, ks, 4*KIdx[i][2]); in belt_encrypt() [all …]
|