/freebsd/contrib/netbsd-tests/lib/libdes/ |
H A D | t_des.c | 291 static unsigned char plain[24] = variable 391 des_cfb_encrypt(plain, cfb_buf1, bits, sizeof(plain), ks, &cfb_tmp, in cfb_test() 393 if (memcmp(cfb_cipher, cfb_buf1, sizeof(plain)) != 0) in cfb_test() 396 des_cfb_encrypt(cfb_buf1, cfb_buf2, bits, sizeof(plain), ks, &cfb_tmp, in cfb_test() 398 if (memcmp(plain, cfb_buf2, sizeof(plain)) != 0) in cfb_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() 416 if (memcmp(cfb_cipher, cfb_buf1, sizeof(plain)) != 0) in cfb64_test() 422 sizeof(plain) - 17, ks, &cfb_tmp, &n, DES_DECRYPT); in cfb64_test() 423 if (memcmp(plain, cfb_buf2, sizeof(plain)) != 0) in cfb64_test() [all …]
|
/freebsd/crypto/openssl/test/ |
H A D | destest.c | 247 static unsigned char plain[24] = { variable 513 DES_cfb_encrypt(plain, cfb_buf1, bits, sizeof(plain), &ks, &cfb_tmp, in cfb_test() 515 if (!TEST_mem_eq(cfb_cipher, sizeof(plain), cfb_buf1, sizeof(plain))) in cfb_test() 518 DES_cfb_encrypt(cfb_buf1, cfb_buf2, bits, sizeof(plain), &ks, &cfb_tmp, in cfb_test() 520 return TEST_mem_eq(plain, sizeof(plain), cfb_buf2, sizeof(plain)); in cfb_test() 555 DES_cfb64_encrypt(plain, cfb_buf1, 12, &ks, &cfb_tmp, &n, DES_ENCRYPT); in test_des_cfb64() 556 DES_cfb64_encrypt(&plain[12], &cfb_buf1[12], sizeof(plain) - 12, &ks, in test_des_cfb64() 558 if (!TEST_mem_eq(cfb_cipher64, sizeof(plain), cfb_buf1, sizeof(plain))) in test_des_cfb64() 564 sizeof(plain) - 17, &ks, &cfb_tmp, &n, DES_DECRYPT); in test_des_cfb64() 565 if (!TEST_mem_eq(plain, sizeof(plain), cfb_buf2, sizeof(plain))) in test_des_cfb64() [all …]
|
H A D | ideatest.c | 45 static const unsigned char plain[CFB_TEST_SIZE] = { variable 100 IDEA_cfb64_encrypt(plain, cfb_buf1, (long)12, &eks, in test_idea_cfb64() 102 IDEA_cfb64_encrypt(&plain[12], &cfb_buf1[12], in test_idea_cfb64() 114 return TEST_mem_eq(plain, CFB_TEST_SIZE, cfb_buf2, CFB_TEST_SIZE); in test_idea_cfb64()
|
/freebsd/contrib/wpa/src/crypto/ |
H A D | crypto_internal-cipher.c | 103 int crypto_cipher_encrypt(struct crypto_cipher *ctx, const u8 *plain, in crypto_cipher_encrypt() argument 110 if (plain != crypt) in crypto_cipher_encrypt() 111 os_memcpy(crypt, plain, len); in crypto_cipher_encrypt() 122 ctx->u.aes.cbc[j] ^= plain[j]; in crypto_cipher_encrypt() 126 plain += AES_BLOCK_SIZE; in crypto_cipher_encrypt() 136 ctx->u.des3.cbc[j] ^= plain[j]; in crypto_cipher_encrypt() 140 plain += 8; in crypto_cipher_encrypt() 150 ctx->u.des3.cbc[j] ^= plain[j]; in crypto_cipher_encrypt() 154 plain += 8; in crypto_cipher_encrypt() 167 u8 *plain, size_t len) in crypto_cipher_decrypt() argument [all …]
|
H A D | crypto_libtomcrypt.c | 100 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt) in aes_encrypt() argument 103 return aes_ecb_encrypt(plain, crypt, skey) == CRYPT_OK ? 0 : -1; in aes_encrypt() 129 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain) in aes_decrypt() argument 132 return aes_ecb_encrypt(plain, (u8 *) crypt, skey) == CRYPT_OK ? 0 : -1; in aes_decrypt() 354 int crypto_cipher_encrypt(struct crypto_cipher *ctx, const u8 *plain, in crypto_cipher_encrypt() argument 360 if (plain != crypt) in crypto_cipher_encrypt() 361 os_memcpy(crypt, plain, len); in crypto_cipher_encrypt() 368 res = cbc_encrypt(plain, crypt, len, &ctx->u.cbc); in crypto_cipher_encrypt() 379 u8 *plain, size_t len) in crypto_cipher_decrypt() argument 384 if (plain != crypt) in crypto_cipher_decrypt() [all …]
|
H A D | des-internal.c | 435 void des_block_encrypt(const u8 *plain, const u32 *ek, u8 *crypt) in des_block_encrypt() argument 438 work[0] = WPA_GET_BE32(plain); in des_block_encrypt() 439 work[1] = WPA_GET_BE32(plain + 4); in des_block_encrypt() 446 void des_block_decrypt(const u8 *crypt, const u32 *dk, u8 *plain) in des_block_decrypt() argument 452 WPA_PUT_BE32(plain, work[0]); in des_block_decrypt() 453 WPA_PUT_BE32(plain + 4, work[1]); in des_block_decrypt() 469 void des3_encrypt(const u8 *plain, const struct des3_key_s *key, u8 *crypt) in des3_encrypt() argument 473 work[0] = WPA_GET_BE32(plain); in des3_encrypt() 474 work[1] = WPA_GET_BE32(plain + 4); in des3_encrypt() 483 void des3_decrypt(const u8 *crypt, const struct des3_key_s *key, u8 *plain) in des3_decrypt() argument [all …]
|
H A D | des_i.h | 18 void des_block_encrypt(const u8 *plain, const u32 *ek, u8 *crypt); 19 void des_block_decrypt(const u8 *crypt, const u32 *dk, u8 *plain); 22 void des3_encrypt(const u8 *plain, const struct des3_key_s *key, u8 *crypt); 23 void des3_decrypt(const u8 *crypt, const struct des3_key_s *key, u8 *plain);
|
H A D | aes_wrap.h | 21 int __must_check aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain, 24 const u8 *cipher, u8 *plain); 54 const u8 *plain, size_t plain_len, 61 u8 *plain); 66 size_t M, const u8 *plain, size_t plain_len, 71 u8 *plain);
|
H A D | aes-ccm.c | 149 size_t M, const u8 *plain, size_t plain_len, in aes_ccm_ae() argument 164 aes_ccm_auth(aes, plain, plain_len, x); in aes_ccm_ae() 168 aes_ccm_encr(aes, L, plain, plain_len, crypt, a); in aes_ccm_ae() 180 const u8 *aad, size_t aad_len, const u8 *auth, u8 *plain) in aes_ccm_ad() argument 199 aes_ccm_encr(aes, L, crypt, crypt_len, plain, a); in aes_ccm_ad() 202 aes_ccm_auth(aes, plain, crypt_len, x); in aes_ccm_ad()
|
H A D | aes-unwrap.c | 27 u8 *plain) in aes_unwrap() argument 36 r = plain; in aes_unwrap() 51 r = plain + (n - 1) * 8; in aes_unwrap()
|
H A D | crypto_nettle.c | 261 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt) in aes_encrypt() argument 264 nettle_aes_encrypt(actx, AES_BLOCK_SIZE, crypt, plain); in aes_encrypt() 292 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain) in aes_decrypt() argument 295 nettle_aes_decrypt(actx, AES_BLOCK_SIZE, plain, crypt); in aes_decrypt() 436 int crypto_cipher_encrypt(struct crypto_cipher *ctx, const u8 *plain, in crypto_cipher_encrypt() argument 441 nettle_arcfour_crypt(&ctx->u.arcfour_ctx, len, crypt, plain); in crypto_cipher_encrypt() 452 u8 *plain, size_t len) in crypto_cipher_decrypt() argument 456 nettle_arcfour_crypt(&ctx->u.arcfour_ctx, len, plain, crypt); in crypto_cipher_decrypt()
|
H A D | aes.h | 15 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt); 18 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain);
|
H A D | crypto_gnutls.c | 237 int aes_encrypt(void *ctx, const u8 *plain, u8 *crypt) in aes_encrypt() argument 240 gcry_cipher_encrypt(hd, crypt, 16, plain, 16); in aes_encrypt() 271 int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain) in aes_decrypt() argument 274 gcry_cipher_decrypt(hd, plain, 16, crypt, 16); in aes_decrypt() 481 int crypto_cipher_encrypt(struct crypto_cipher *ctx, const u8 *plain, in crypto_cipher_encrypt() argument 484 if (gcry_cipher_encrypt(ctx->enc, crypt, len, plain, len) != in crypto_cipher_encrypt() 492 u8 *plain, size_t len) in crypto_cipher_decrypt() argument 494 if (gcry_cipher_decrypt(ctx->dec, plain, len, crypt, len) != in crypto_cipher_decrypt()
|
/freebsd/contrib/wpa/src/tls/ |
H A D | pkcs1.c | 136 u8 *plain, size_t *plain_len) in pkcs1_decrypt_public_key() argument 142 if (crypto_rsa_exptmod(crypt, crypt_len, plain, &len, key, 0) < 0) in pkcs1_decrypt_public_key() 157 plain[0] != 0x00 || plain[1] != 0x01) { in pkcs1_decrypt_public_key() 160 wpa_hexdump_key(MSG_DEBUG, "Signature EB", plain, len); in pkcs1_decrypt_public_key() 164 pos = plain + 3; in pkcs1_decrypt_public_key() 166 if (plain[2] != 0xff) { in pkcs1_decrypt_public_key() 169 wpa_hexdump_key(MSG_DEBUG, "Signature EB", plain, len); in pkcs1_decrypt_public_key() 172 while (pos < plain + len && *pos == 0xff) in pkcs1_decrypt_public_key() 175 if (pos - plain - 2 < 8) { in pkcs1_decrypt_public_key() 179 wpa_hexdump_key(MSG_DEBUG, "Signature EB", plain, len); in pkcs1_decrypt_public_key() [all …]
|
/freebsd/crypto/openssh/ |
H A D | cipher-aes.c | 76 u_char *cprev, *cnow, *plain, *ivp; in ssh_rijndael_cbc() local 89 plain = (u_char *)src; in ssh_rijndael_cbc() 91 for (i = 0; i < blocks; i++, plain+=RIJNDAEL_BLOCKSIZE, in ssh_rijndael_cbc() 94 buf[j] = plain[j] ^ cprev[j]; in ssh_rijndael_cbc() 101 plain = dest+len-RIJNDAEL_BLOCKSIZE; in ssh_rijndael_cbc() 105 plain-=RIJNDAEL_BLOCKSIZE) { in ssh_rijndael_cbc() 106 rijndael_decrypt(&c->r_ctx, cnow, plain); in ssh_rijndael_cbc() 109 plain[j] ^= ivp[j]; in ssh_rijndael_cbc()
|
/freebsd/contrib/file/magic/Magdir/ |
H A D | ssh | 12 #!:mime text/plain 19 #!:mime text/plain 26 #!:mime text/plain 32 #!:mime text/plain 36 #!:mime text/plain 41 #!:mime text/plain 45 #!:mime text/plain 49 #!:mime text/plain 53 #!:mime text/plain 57 #!:mime text/plain [all …]
|
/freebsd/share/mk/ |
H A D | plain.test.mk | 9 .error plain.test.mk cannot be included directly. 31 TEST_INTERFACE.${_T}= plain 42 TEST_INTERFACE.${_T}= plain 52 TEST_INTERFACE.${_T}= plain 62 TEST_INTERFACE.${_T}= plain
|
/freebsd/contrib/bearssl/test/ |
H A D | test_crypto.c | 3604 unsigned char plain[16]; in monte_carlo_AES_decrypt() local 3613 hextobin(plain, splain); in monte_carlo_AES_decrypt() 3649 check_equals("MC AES decrypt", buf, plain, sizeof buf); in monte_carlo_AES_decrypt() 3673 unsigned char plain[16]; in test_AES_generic() local 3686 hextobin(plain, KAT_AES[u + 1]); in test_AES_generic() 3689 memcpy(buf, plain, sizeof plain); in test_AES_generic() 3696 check_equals("KAT AES decrypt", buf, plain, sizeof plain); in test_AES_generic() 3703 unsigned char plain[200]; in test_AES_generic() local 3717 data_len = hextobin(plain, KAT_AES_CBC[u + 2]); in test_AES_generic() 3721 memcpy(buf, plain, data_len); in test_AES_generic() [all …]
|
/freebsd/contrib/wpa/src/wps/ |
H A D | wps_enrollee.c | 210 struct wpabuf *msg, *plain; in wps_build_m5() local 214 plain = wpabuf_alloc(200); in wps_build_m5() 215 if (plain == NULL) in wps_build_m5() 220 wpabuf_free(plain); in wps_build_m5() 227 wps_build_e_snonce1(wps, plain) || in wps_build_m5() 228 wps_build_key_wrap_auth(wps, plain) || in wps_build_m5() 229 wps_build_encr_settings(wps, msg, plain) || in wps_build_m5() 232 wpabuf_clear_free(plain); in wps_build_m5() 236 wpabuf_clear_free(plain); in wps_build_m5() 349 static int wps_build_ap_settings(struct wps_data *wps, struct wpabuf *plain) in wps_build_ap_settings() argument [all …]
|
/freebsd/tools/lua/ |
H A D | template.lua | 157 return function(view, plain) 158 if plain == true then return view end 165 return plain == false and assert(read_file(path)) or read_file(path) or view 326 function template.precompile(view, path, strip, plain) 327 local chunk = dump(template.compile(view, nil, plain), strip ~= false) 344 function template.compile(view, cache_key, plain) 347 return load_chunk(template.parse(view, plain)), false 352 local func = load_chunk(template.parse(view, plain)) 365 function template.parse(view, plain) 367 if plain ~= true then [all …]
|
/freebsd/crypto/heimdal/lib/krb5/ |
H A D | rd_priv.c | 47 krb5_data plain; in krb5_rd_priv() local 96 &plain); in krb5_rd_priv() 101 ret = decode_EncKrbPrivPart (plain.data, plain.length, &part, &len); in krb5_rd_priv() 102 krb5_data_free (&plain); in krb5_rd_priv()
|
H A D | aes-test.c | 481 krb5_data *plain) in krb_checksum_iov() argument 488 p = plain->data; in krb_checksum_iov() 489 len = plain->length; in krb_checksum_iov() 595 krb5_data cipher, plain; in krb_enc_test() local 608 plain.length = krbencs[i].plen; in krb_enc_test() 609 plain.data = krbencs[i].pdata; in krb_enc_test() 611 ret = krb_enc(context, crypto, krbencs[i].usage, &cipher, &plain); in krb_enc_test() 616 ret = krb_enc_iov(context, crypto, krbencs[i].usage, &cipher, &plain); in krb_enc_test() 621 cipher.length, &plain); in krb_enc_test() 625 ret = krb_checksum_iov(context, crypto, krbencs[i].usage, &plain); in krb_enc_test() [all …]
|
/freebsd/contrib/wpa/src/eap_peer/ |
H A D | ikev2.c | 1110 struct wpabuf *plain = wpabuf_alloc(data->IDr_len + 1000); in ikev2_build_sa_init() local 1111 if (plain == NULL) { in ikev2_build_sa_init() 1115 if (ikev2_build_idr(data, plain, in ikev2_build_sa_init() 1119 &data->keys, 0, msg, plain, in ikev2_build_sa_init() 1121 wpabuf_free(plain); in ikev2_build_sa_init() 1125 wpabuf_free(plain); in ikev2_build_sa_init() 1143 struct wpabuf *msg, *plain; in ikev2_build_sa_auth() local 1152 plain = wpabuf_alloc(data->IDr_len + 1000); in ikev2_build_sa_auth() 1153 if (plain == NULL) { in ikev2_build_sa_auth() 1158 if (ikev2_build_idr(data, plain, IKEV2_PAYLOAD_AUTHENTICATION) || in ikev2_build_sa_auth() [all …]
|
/freebsd/contrib/wpa/src/eap_common/ |
H A D | ikev2_common.c | 176 const u8 *plain, u8 *crypt, size_t len) in ikev2_encr_encrypt() argument 199 if (crypto_cipher_encrypt(cipher, plain, crypt, len) < 0) { in ikev2_encr_encrypt() 211 const u8 *crypt, u8 *plain, size_t len) in ikev2_encr_decrypt() argument 234 if (crypto_cipher_decrypt(cipher, crypt, plain, len) < 0) { in ikev2_encr_decrypt() 532 struct wpabuf *plain, u8 next_payload) in ikev2_build_encrypted() argument 580 pad_len = iv_len - (wpabuf_len(plain) + 1) % iv_len; in ikev2_build_encrypted() 583 wpabuf_put(plain, pad_len); in ikev2_build_encrypted() 584 wpabuf_put_u8(plain, pad_len); in ikev2_build_encrypted() 587 wpabuf_head(plain), wpabuf_mhead(plain), in ikev2_build_encrypted() 588 wpabuf_len(plain)) < 0) in ikev2_build_encrypted() [all …]
|
/freebsd/contrib/wpa/src/eap_server/ |
H A D | eap_server_tls_common.c | 387 struct wpabuf *plain, *encr; in eap_server_tls_phase1() local 408 plain = wpabuf_alloc(1); in eap_server_tls_phase1() 409 if (!plain) in eap_server_tls_phase1() 411 wpabuf_put_u8(plain, 0); in eap_server_tls_phase1() 412 encr = eap_server_tls_encrypt(sm, data, plain); in eap_server_tls_phase1() 413 wpabuf_free(plain); in eap_server_tls_phase1() 514 const struct wpabuf *plain) in eap_server_tls_encrypt() argument 518 buf = tls_connection_encrypt(sm->cfg->ssl_ctx, data->conn, plain); in eap_server_tls_encrypt()
|