Home
last modified time | relevance | path

Searched refs:klen (Results 1 – 25 of 81) sorted by relevance

1234

/freebsd/crypto/openssl/crypto/pem/
H A Dpem_pk8.c23 const char *kstr, int klen,
30 const char *kstr, int klen,
90 klen = strlen(u); in do_pk8pkey()
138 klen = cb(buf, PEM_BUFSIZE, 1, u); in do_pk8pkey()
139 if (klen < 0) { in do_pk8pkey()
148 OPENSSL_cleanse(buf, klen); in do_pk8pkey()
174 int klen; in d2i_PKCS8PrivateKey_bio() local
182 klen = cb(psbuf, PEM_BUFSIZE, 0, u); in d2i_PKCS8PrivateKey_bio()
185 if (klen < 0) { in d2i_PKCS8PrivateKey_bio()
190 p8inf = PKCS8_decrypt(p8, psbuf, klen); in d2i_PKCS8PrivateKey_bio()
[all …]
H A Dpem_pkey.c149 int klen; in pem_read_bio_key_legacy() local
155 klen = cb(psbuf, PEM_BUFSIZE, 0, u); in pem_read_bio_key_legacy()
157 klen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u); in pem_read_bio_key_legacy()
158 if (klen < 0) { in pem_read_bio_key_legacy()
163 p8inf = PKCS8_decrypt(p8, psbuf, klen); in pem_read_bio_key_legacy()
165 OPENSSL_cleanse(psbuf, klen); in pem_read_bio_key_legacy()
325 (const char *)kstr, klen, cb, u); in PEM_write_cb_ex_fnsig()
331 return PEM_write_bio_PrivateKey_ex(out, x, enc, kstr, klen, cb, u, in PEM_write_cb_fnsig()
341 const unsigned char *kstr, int klen, in PEM_write_bio_PrivateKey_traditional() argument
363 pem_str, bp, x, enc, kstr, klen, cb, u); in PEM_write_bio_PrivateKey_traditional()
[all …]
/freebsd/tools/tools/net80211/w00t/libw00t/
H A Dw00t.c277 int klen; in str2wep() local
279 klen = strlen(str); in str2wep()
280 if (klen % 2) in str2wep()
282 klen /= 2; in str2wep()
284 if (klen != 5 && klen != 13) in str2wep()
287 *len = klen; in str2wep()
289 while (klen--) { in str2wep()
313 memcpy(&seed[3], key, klen); in wep_decrypt()
315 RC4_set_key(&k, klen+3, seed); in wep_decrypt()
341 memcpy(&seed[3], key, klen); in wep_encrypt()
[all …]
H A Dw00t.h48 int wep_decrypt(struct ieee80211_frame *wh, int len, char *key, int klen);
49 void wep_encrypt(struct ieee80211_frame *wh, int len, char *key, int klen);
/freebsd/contrib/libucl/tests/
H A Dtest_msgpack.c108 size_t klen, elen, elen2; in main() local
143 key = random_key (&klen); in main()
147 assert (klen != 0); in main()
152 key = random_key (&klen); in main()
156 key = random_key (&klen); in main()
160 key = random_key (&klen); in main()
324 size_t klen; in ucl_test_map() local
347 key = random_key (&klen); in ucl_test_map()
350 assert (klen != 0); in ucl_test_map()
370 size_t klen; in ucl_test_large_map() local
[all …]
/freebsd/sys/crypto/blake2/
H A Dblake2_cryptodev.c184 blake2_check_klen(const struct crypto_session_params *csp, unsigned klen) in blake2_check_klen() argument
188 return (klen <= BLAKE2S_KEYBYTES); in blake2_check_klen()
190 return (klen <= BLAKE2B_KEYBYTES); in blake2_check_klen()
261 unsigned klen; in blake2_cipher_process() local
268 klen = csp->csp_auth_klen; in blake2_cipher_process()
274 if (klen > 0) in blake2_cipher_process()
275 rc = blake2b_init_key(&bctx.sb, ses->mlen, key, klen); in blake2_cipher_process()
291 if (klen > 0) in blake2_cipher_process()
292 rc = blake2s_init_key(&bctx.ss, ses->mlen, key, klen); in blake2_cipher_process()
H A Dblake2-sw.c44 blake2b_xform_setkey(void *vctx, const uint8_t *key, u_int klen) in blake2b_xform_setkey() argument
50 klen); in blake2b_xform_setkey()
107 blake2s_xform_setkey(void *vctx, const uint8_t *key, u_int klen) in blake2s_xform_setkey() argument
113 klen); in blake2s_xform_setkey()
/freebsd/crypto/openssh/
H A Dkexecdh.c145 size_t klen = 0; in kex_ecdh_dec_key_group() local
173 klen = (EC_GROUP_get_degree(group) + 7) / 8; in kex_ecdh_dec_key_group()
174 if ((kbuf = malloc(klen)) == NULL || in kex_ecdh_dec_key_group()
179 if (ECDH_compute_key(kbuf, klen, dh_pub, key, NULL) != (int)klen || in kex_ecdh_dec_key_group()
180 BN_bin2bn(kbuf, klen, shared_secret) == NULL) { in kex_ecdh_dec_key_group()
185 dump_digest("shared secret", kbuf, klen); in kex_ecdh_dec_key_group()
194 freezero(kbuf, klen); in kex_ecdh_dec_key_group()
H A Dhmac.c66 ssh_hmac_init(struct ssh_hmac_ctx *ctx, const void *key, size_t klen) in ssh_hmac_init() argument
73 if (klen <= ctx->buf_len) in ssh_hmac_init()
74 memcpy(ctx->buf, key, klen); in ssh_hmac_init()
75 else if (ssh_digest_memory(ctx->alg, key, klen, ctx->buf, in ssh_hmac_init()
142 hmac_test(void *key, size_t klen, void *m, size_t mlen, u_char *e, size_t elen) in hmac_test() argument
150 if (ssh_hmac_init(ctx, key, klen) < 0 || in hmac_test()
H A Dkexdh.c77 size_t klen = 0; in kex_dh_compute_key() local
93 klen = DH_size(kex->dh); in kex_dh_compute_key()
94 if ((kbuf = malloc(klen)) == NULL || in kex_dh_compute_key()
109 freezero(kbuf, klen); in kex_dh_compute_key()
/freebsd/sys/crypto/ccp/
H A Dccp.c232 ccp_init_hmac_digest(struct ccp_session *s, const char *key, int klen) in ccp_init_hmac_digest() argument
243 if (klen > axf->blocksize) { in ccp_init_hmac_digest()
245 axf->Update(&auth_ctx, key, klen); in ccp_init_hmac_digest()
248 klen = axf->hashsize; in ccp_init_hmac_digest()
250 memcpy(s->hmac.ipad, key, klen); in ccp_init_hmac_digest()
252 memset(s->hmac.ipad + klen, 0, axf->blocksize - klen); in ccp_init_hmac_digest()
262 ccp_aes_check_keylen(int alg, int klen) in ccp_aes_check_keylen() argument
265 switch (klen * 8) { in ccp_aes_check_keylen()
289 kbits = (klen / 2) * 8; in ccp_aes_setkey()
291 kbits = klen * 8; in ccp_aes_setkey()
[all …]
/freebsd/sys/crypto/via/
H A Dpadlock_cipher.c97 padlock_cipher_key_setup(struct padlock_session *ses, const void *key, int klen) in padlock_cipher_key_setup() argument
105 rijndaelKeySetupEnc(ses->ses_ekey, key, klen * 8); in padlock_cipher_key_setup()
106 rijndaelKeySetupDec(ses->ses_dkey, key, klen * 8); in padlock_cipher_key_setup()
112 bcopy(key, ses->ses_ekey, klen); in padlock_cipher_key_setup()
113 bcopy(key, ses->ses_dkey, klen); in padlock_cipher_key_setup()
/freebsd/sys/contrib/libsodium/test/default/
H A Dmetamorphic.c16 size_t klen; in mm_generichash() local
24 klen = randombytes_uniform(crypto_generichash_KEYBYTES_MAX - in mm_generichash()
27 k = (unsigned char *) sodium_malloc(klen); in mm_generichash()
34 randombytes_buf(k, klen); in mm_generichash()
37 crypto_generichash_init(&st, k, klen, hlen); in mm_generichash()
45 crypto_generichash(h2, hlen, m, mlen, k, klen); in mm_generichash()
/freebsd/crypto/openssl/include/openssl/
H A Dpem.h392 const unsigned char *kstr, int klen,
403 const unsigned char *kstr, int klen,
415 const unsigned char *kstr, int klen,
483 const char *kstr, int klen,
486 const char *kstr, int klen,
489 const char *kstr, int klen,
492 const char *kstr, int klen,
499 const char *kstr, int klen,
502 const char *kstr, int klen,
505 const char *kstr, int klen,
[all …]
/freebsd/sys/opencrypto/
H A Dxform_poly1305.c24 xform_Poly1305_Setkey(void *ctx, const uint8_t *key, u_int klen) in xform_Poly1305_Setkey() argument
29 if (klen != POLY1305_KEY_LEN) in xform_Poly1305_Setkey()
30 panic("%s: Bogus keylen: %u bytes", __func__, (unsigned)klen); in xform_Poly1305_Setkey()
/freebsd/usr.sbin/ppp/
H A Dpap.c184 u_char nlen, klen, *key; in pap_Input() local
254 bp = mbuf_Read(bp, &klen, 1); in pap_Input()
255 if (m_length(bp) < klen) { in pap_Input()
259 if ((key = malloc(klen+1)) == NULL) { in pap_Input()
263 bp = mbuf_Read(bp, key, klen); in pap_Input()
264 key[klen] = '\0'; in pap_Input()
/freebsd/crypto/openssl/doc/man3/
H A Dd2i_PKCS8PrivateKey_bio.pod17 char *kstr, int klen,
21 char *kstr, int klen,
25 char *kstr, int klen,
29 char *kstr, int klen,
/freebsd/contrib/bearssl/src/ec/
H A Dec_p256_m62.c1252 const unsigned char *k, size_t klen) in point_mul_inner() argument
1259 while (klen -- > 0) { in point_mul_inner()
1485 point_mul_inner(P, window.aff, k, klen); in p256_mul()
1597 point_mul_inner(P, P256_Gwin, k, klen); in p256_mulgen()
1616 if (klen > 32) { in check_scalar()
1620 for (u = 0; u < klen; u ++) { in check_scalar()
1623 if (klen == 32) { in check_scalar()
1625 for (u = 0; u < klen; u ++) { in check_scalar()
1645 r = check_scalar(k, klen); in api_mul()
1647 p256_mul(&P, k, klen); in api_mul()
[all …]
H A Dec_p256_m64.c1270 const unsigned char *k, size_t klen) in point_mul_inner() argument
1277 while (klen -- > 0) { in point_mul_inner()
1501 point_mul_inner(P, window.aff, k, klen); in p256_mul()
1613 point_mul_inner(P, P256_Gwin, k, klen); in p256_mulgen()
1632 if (klen > 32) { in check_scalar()
1636 for (u = 0; u < klen; u ++) { in check_scalar()
1639 if (klen == 32) { in check_scalar()
1641 for (u = 0; u < klen; u ++) { in check_scalar()
1661 r = check_scalar(k, klen); in api_mul()
1663 p256_mul(&P, k, klen); in api_mul()
[all …]
/freebsd/contrib/ntp/libntp/
H A Da_md5encrypt.c199 size_t klen, /* key length */ in MD5authencrypt() argument
206 robuffT keyb = { key, klen }; in MD5authencrypt()
229 size_t klen, /* key length */ in MD5authdecrypt() argument
238 robuffT keyb = { key, klen }; in MD5authdecrypt()
/freebsd/crypto/openssl/providers/implementations/ciphers/
H A Dcipher_aes_siv_hw.c24 size_t klen = keylen / 2; in aes_siv_initkey() local
33 switch (klen) { in aes_siv_initkey()
55 return ossl_siv128_init(sctx, key, klen, ctx->cbc, ctx->ctr, libctx, in aes_siv_initkey()
/freebsd/sys/dev/glxsb/
H A Dglxsb_hash.c50 glxsb_hash_key_setup(struct glxsb_session *ses, const char *key, int klen) in glxsb_hash_key_setup() argument
55 hmac_init_ipad(axf, key, klen, ses->ses_ictx); in glxsb_hash_key_setup()
56 hmac_init_opad(axf, key, klen, ses->ses_octx); in glxsb_hash_key_setup()
/freebsd/crypto/openssl/include/crypto/
H A Dsiv.h14 SIV128_CONTEXT *ossl_siv128_new(const unsigned char *key, int klen,
17 int ossl_siv128_init(SIV128_CONTEXT *ctx, const unsigned char *key, int klen,
/freebsd/tests/sys/opencrypto/
H A Dblake2_test.c97 create_session(int fd, int alg, int crid, const void *key, size_t klen) in create_session() argument
105 sop.mackeylen = klen; in create_session()
109 "alg %d keylen %zu, errno=%d (%s)", alg, klen, errno, in create_session()
/freebsd/crypto/openssl/crypto/modes/
H A Dsiv128.c143 SIV128_CONTEXT *ossl_siv128_new(const unsigned char *key, int klen, in ossl_siv128_new() argument
151 ret = ossl_siv128_init(ctx, key, klen, cbc, ctr, libctx, propq); in ossl_siv128_new()
163 int ossl_siv128_init(SIV128_CONTEXT *ctx, const unsigned char *key, int klen, in ossl_siv128_init() argument
191 (void *)key, klen); in ossl_siv128_init()
199 || !EVP_EncryptInit_ex(ctx->cipher_ctx, ctr, NULL, key + klen, NULL) in ossl_siv128_init()

1234