Home
last modified time | relevance | path

Searched refs:ks (Results 1 – 25 of 135) sorted by relevance

123456

/openssl/test/
H A Ddestest.c320 DES_key_schedule ks; in test_des_ecb() local
356 DES_ecb3_encrypt(&in, &out, &ks, &ks2, &ks, DES_ENCRYPT); in test_des_ede_ecb()
357 DES_ecb3_encrypt(&out, &outin, &ks, &ks2, &ks, DES_DECRYPT); in test_des_ede_ecb()
377 DES_key_schedule ks; in test_des_cbc() local
399 DES_key_schedule ks; in test_des_ede_cbc() local
600 DES_ede3_cfb64_encrypt(plain, cfb_buf1, 12, &ks, &ks, &ks, &cfb_tmp, &n, in test_des_ede_cfb64()
603 &ks, &ks, &cfb_tmp, &n, DES_ENCRYPT); in test_des_ede_cfb64()
608 DES_ede3_cfb64_encrypt(cfb_buf1, cfb_buf2, (long)17, &ks, &ks, &ks, in test_des_ede_cfb64()
611 &ks, &ks, &ks, &cfb_tmp, &n, DES_DECRYPT); in test_des_ede_cfb64()
666 DES_ede3_ofb64_encrypt(&plain[i], &ofb_buf1[i], 1, &ks, &ks, in test_des_ede_ofb64()
[all …]
/openssl/crypto/des/
H A Dstr2key.c21 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()
/openssl/providers/implementations/ciphers/
H A Dcipher_sm4_gcm_hw.c17 # define SM4_GCM_HW_SET_KEY_CTR_FN(ks, fn_set_enc_key, fn_block, fn_ctr) \ argument
18 fn_set_enc_key(key, ks); \
19 CRYPTO_gcm128_init(&ctx->gcm, ks, (block128_f)fn_block); \
27 SM4_KEY *ks = &actx->ks.ks; in sm4_gcm_initkey() local
32 SM4_GCM_HW_SET_KEY_CTR_FN(ks, HWSM4_set_encrypt_key, HWSM4_encrypt, in sm4_gcm_initkey()
35 SM4_GCM_HW_SET_KEY_CTR_FN(ks, HWSM4_set_encrypt_key, HWSM4_encrypt, NULL); in sm4_gcm_initkey()
42 SM4_GCM_HW_SET_KEY_CTR_FN(ks, vpsm4_ex_set_encrypt_key, vpsm4_ex_encrypt, in sm4_gcm_initkey()
49 SM4_GCM_HW_SET_KEY_CTR_FN(ks, vpsm4_set_encrypt_key, vpsm4_encrypt, in sm4_gcm_initkey()
54 SM4_GCM_HW_SET_KEY_CTR_FN(ks, ossl_sm4_set_key, ossl_sm4_encrypt, NULL); in sm4_gcm_initkey()
H A Dcipher_aes_gcm_hw_rv64i.inc22 AES_KEY *ks = &actx->ks.ks;
23 GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zkne_set_encrypt_key, rv64i_zkne_encrypt,
44 AES_KEY *ks = &actx->ks.ks;
51 GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zvkned_set_encrypt_key,
54 GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key,
77 AES_KEY *ks = &actx->ks.ks;
84 GCM_HW_SET_KEY_CTR_FN(ks, rv64i_zvkned_set_encrypt_key,
88 GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key,
H A Dcipher_aes_hw_rv32i.inc36 AES_KEY *ks = &adat->ks.ks;
38 dat->ks = ks;
42 ret = rv32i_zknd_zkne_set_decrypt_key(key, keylen * 8, ks);
46 ret = rv32i_zkne_set_encrypt_key(key, keylen * 8, ks);
64 AES_KEY *ks = &adat->ks.ks;
66 dat->ks = ks;
70 ret = rv32i_zbkb_zknd_zkne_set_decrypt_key(key, keylen * 8, ks);
74 ret = rv32i_zbkb_zkne_set_encrypt_key(key, keylen * 8, ks);
H A Dcipher_aes_hw.c24 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 Dcipher_sm4_hw.c16 SM4_KEY *ks = &sctx->ks.ks; in cipher_hw_sm4_initkey() local
18 ctx->ks = ks; in cipher_hw_sm4_initkey()
24 HWSM4_set_encrypt_key(key, ks); in cipher_hw_sm4_initkey()
47 vpsm4_ex_set_encrypt_key(key, ks); in cipher_hw_sm4_initkey()
60 vpsm4_set_encrypt_key(key, ks); in cipher_hw_sm4_initkey()
72 ossl_sm4_set_key(key, ks); in cipher_hw_sm4_initkey()
78 HWSM4_set_decrypt_key(key, ks); in cipher_hw_sm4_initkey()
93 vpsm4_ex_set_decrypt_key(key, ks); in cipher_hw_sm4_initkey()
104 vpsm4_set_decrypt_key(key, ks); in cipher_hw_sm4_initkey()
114 ossl_sm4_set_key(key, ks); in cipher_hw_sm4_initkey()
H A Dcipher_aria_hw.c18 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 Dcipher_aes_hw_aesni.inc26 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 Dcipher_aes_hw_rv64i.inc28 AES_KEY *ks = &adat->ks.ks;
30 dat->ks = ks;
34 ret = rv64i_zknd_set_decrypt_key(key, keylen * 8, ks);
38 ret = rv64i_zkne_set_encrypt_key(key, keylen * 8, ks);
70 AES_KEY *ks = &adat->ks.ks;
72 dat->ks = ks;
81 ret = rv64i_zvkned_set_encrypt_key(key, keylen * 8, ks);
83 ret = AES_set_encrypt_key(key, keylen * 8, ks);
H A Dcipher_idea_hw.c23 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 Dcipher_aes_gcm_hw_rv32i.inc19 AES_KEY *ks = &actx->ks.ks;
21 GCM_HW_SET_KEY_CTR_FN(ks, rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt,
31 AES_KEY *ks = &actx->ks.ks;
33 GCM_HW_SET_KEY_CTR_FN(ks, rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt,
H A Dciphercommon_hw.c20 (*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()
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()
103 CRYPTO_cfb128_1_encrypt(in, out, len * 8, dat->ks, dat->iv, &num, in ossl_cipher_hw_generic_cfb1()
[all …]
H A Dcipher_desx_hw.c23 #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()
H A Dcipher_rc4_hmac_md5_hw.c40 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 Dcipher_des_hw.c24 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()
166 DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks); in cipher_hw_des_cfb8_cipher()
H A Dcipher_aes_gcm_hw.c24 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 Dcipher_camellia_hw.c25 CAMELLIA_KEY *ks = &adat->ks.ks; in cipher_hw_camellia_initkey() local
27 dat->ks = ks; in cipher_hw_camellia_initkey()
28 ret = Camellia_set_key(key, keylen * 8, ks); in cipher_hw_camellia_initkey()
/openssl/crypto/evp/
H A De_sm4.c26 SM4_KEY ks; member
27 } ks; member
67 HWSM4_set_decrypt_key(key, &dat->ks.ks); in sm4_init_key()
82 vpsm4_set_decrypt_key(key, &dat->ks.ks); in sm4_init_key()
98 HWSM4_set_encrypt_key(key, &dat->ks.ks); in sm4_init_key()
121 vpsm4_set_encrypt_key(key, &dat->ks.ks); in sm4_init_key()
145 (*dat->stream.cbc) (in, out, len, &dat->ks.ks, ctx->iv, in sm4_cbc_cipher()
151 CRYPTO_cbc128_decrypt(in, out, len, &dat->ks, in sm4_cbc_cipher()
162 CRYPTO_cfb128_encrypt(in, out, len, &dat->ks, in sm4_cfb_cipher()
180 (*dat->stream.ecb) (in, out, len, &dat->ks.ks, in sm4_ecb_cipher()
[all …]
H A De_idea.c30 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()
/openssl/include/openssl/
H A Dseed.h78 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,
H A Didea.h44 IDEA_KEY_SCHEDULE *ks);
46 IDEA_KEY_SCHEDULE *ks);
51 IDEA_KEY_SCHEDULE *ks,
55 IDEA_KEY_SCHEDULE *ks,
60 IDEA_KEY_SCHEDULE *ks,
63 IDEA_KEY_SCHEDULE *ks);
/openssl/crypto/seed/
H A Dseed.c447 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 …]
/openssl/crypto/sm4/
H A Dsm4.c281 int ossl_sm4_set_key(const uint8_t *key, SM4_KEY *ks) in ossl_sm4_set_key() argument
317 ks->rk[i ] = K[0]; in ossl_sm4_set_key()
318 ks->rk[i + 1] = K[1]; in ossl_sm4_set_key()
319 ks->rk[i + 2] = K[2]; in ossl_sm4_set_key()
320 ks->rk[i + 3] = K[3]; in ossl_sm4_set_key()
328 B0 ^= F(B1 ^ B2 ^ B3 ^ ks->rk[k0]); \
329 B1 ^= F(B0 ^ B2 ^ B3 ^ ks->rk[k1]); \
330 B2 ^= F(B0 ^ B1 ^ B3 ^ ks->rk[k2]); \
331 B3 ^= F(B0 ^ B1 ^ B2 ^ ks->rk[k3]); \
334 void ossl_sm4_encrypt(const uint8_t *in, uint8_t *out, const SM4_KEY *ks) in ossl_sm4_encrypt() argument
[all …]
/openssl/include/crypto/
H A Ddes_platform.h22 void des_t4_key_expand(const void *key, DES_key_schedule *ks);
24 const DES_key_schedule ks[3], unsigned char iv[8]);
26 const DES_key_schedule ks[3], unsigned char iv[8]);
28 const DES_key_schedule *ks, unsigned char iv[8]);
30 const DES_key_schedule *ks, unsigned char iv[8]);

Completed in 40 milliseconds

123456