Home
last modified time | relevance | path

Searched full:hmac (Results 1 – 25 of 567) sorted by relevance

12345678910>>...23

/freebsd/crypto/openssl/providers/implementations/rands/
H A Ddrbg_hmac.c43 * hmac is an object that holds the input/output Key and Value (K and V).
49 * hmac->K = HMAC(hmac->K, hmac->V || inbyte || [in1] || [in2] || [in3])
50 * hmac->V = HMAC(hmac->K, hmac->V)
54 static int do_hmac(PROV_DRBG_HMAC *hmac, unsigned char inbyte, in do_hmac() argument
59 EVP_MAC_CTX *ctx = hmac->ctx; in do_hmac()
61 if (!EVP_MAC_init(ctx, hmac->K, hmac->blocklen, NULL) in do_hmac()
62 /* K = HMAC(K, V || inbyte || [in1] || [in2] || [in3]) */ in do_hmac()
63 || !EVP_MAC_update(ctx, hmac->V, hmac->blocklen) in do_hmac()
68 || !EVP_MAC_final(ctx, hmac->K, NULL, sizeof(hmac->K))) in do_hmac()
71 /* V = HMAC(K, V) */ in do_hmac()
[all …]
/freebsd/contrib/bearssl/inc/
H A Dbearssl_hmac.h39 * # HMAC
41 * HMAC is initialized with a key and an underlying hash function; it
45 * With the key context, a HMAC context can be initialized to process
49 * IMPORTANT: HMAC shall be used only with functions that have the
58 * \brief HMAC key context.
60 * The HMAC key context is initialised with a hash function implementation
74 * \brief HMAC key context initialisation.
79 * \param kc HMAC key context to initialise.
81 * \param key pointer to the HMAC secret key.
82 * \param key_len HMAC secret key length (in bytes).
[all …]
/freebsd/crypto/openssl/test/recipes/30-test_evp_data/
H A Devpkdf_ss.txt439 Ctrl.mac = mac:HMAC
447 Ctrl.mac = mac:HMAC
455 Ctrl.mac = mac:HMAC
463 Ctrl.mac = mac:HMAC
471 Ctrl.mac = mac:HMAC
479 Ctrl.mac = mac:HMAC
487 Ctrl.mac = mac:HMAC
495 Ctrl.mac = mac:HMAC
503 Ctrl.mac = mac:HMAC
511 Ctrl.mac = mac:HMAC
[all …]
H A Devpmac_common.txt15 Title = HMAC tests (from RFC2104 and others)
18 MAC = HMAC
27 MAC = HMAC
35 MAC = HMAC
44 # HMAC tests from NIST test data
46 MAC = HMAC
54 MAC = HMAC
61 MAC = HMAC
71 MAC = HMAC
80 MAC = HMAC
[all …]
H A Devpciph_aes_stitched.txt1 Title = AES-128-CBC-HMAC-SHA1 test vectors
3 Cipher = AES-128-CBC-HMAC-SHA1
13 Cipher = AES-128-CBC-HMAC-SHA1
23 Cipher = AES-128-CBC-HMAC-SHA1
33 Title = AES-256-CBC-HMAC-SHA1 test vectors
35 Cipher = AES-256-CBC-HMAC-SHA1
45 Cipher = AES-256-CBC-HMAC-SHA1
55 Cipher = AES-256-CBC-HMAC-SHA1
64 Title = AES-128-CBC-HMAC-SHA256 test vectors
66 Cipher = AES-128-CBC-HMAC-SHA256
[all …]
H A Devpkdf_kbkdf_counter.txt714 Ctrl.mac = mac:HMAC
727 Ctrl.mac = mac:HMAC
740 Ctrl.mac = mac:HMAC
753 Ctrl.mac = mac:HMAC
771 Ctrl.mac = mac:HMAC
784 Ctrl.mac = mac:HMAC
797 Ctrl.mac = mac:HMAC
810 Ctrl.mac = mac:HMAC
828 Ctrl.mac = mac:HMAC
841 Ctrl.mac = mac:HMAC
[all …]
H A Devpkdf_hmac_drbg.txt12 Title = HMAC-DRBG-KDF Tests
14 KDF = HMAC-DRBG-KDF
21 KDF = HMAC-DRBG-KDF
27 KDF = HMAC-DRBG-KDF
34 KDF = HMAC-DRBG-KDF
40 KDF = HMAC-DRBG-KDF
46 KDF = HMAC-DRBG-KDF
/freebsd/contrib/libfido2/tools/
H A Dtest.sh12 # - assumes CTAP 2.1-like hmac-secret;
54 dd if=/dev/urandom bs=32 count=1 | base64 > hmac-salt
81 # wrap (non-resident) + hmac-secret
102 # resident + hmac-secret
148 get_assert no.tld "-h" wrap-cred hmac-salt wrap-assert
151 get_assert no.tld "-h -t pin=true" wrap-cred hmac-salt wrap-assert
155 get_assert no.tld "-h -t pin=false" wrap-cred hmac-salt wrap-assert
158 get_assert no.tld "-h -t up=true" wrap-cred hmac-salt wrap-assert
162 get_assert no.tld "-h -t up=true -t pin=true" wrap-cred hmac-salt wrap-assert
168 get_assert no.tld "-h -t up=true -t pin=false" wrap-cred hmac-salt wrap-assert
[all …]
/freebsd/crypto/krb5/src/lib/crypto/krb/
H A Dcksumtypes.c56 "hmac-sha1-des3", { "hmac-sha1-des3-kd" }, "HMAC-SHA1 DES3 key",
62 "hmac-md5-rc4", { "hmac-md5-enc", "hmac-md5-earcfour" },
63 "Microsoft HMAC MD5",
69 "hmac-sha1-96-aes128", { 0 }, "HMAC-SHA1 AES128 key",
75 "hmac-sha1-96-aes256", { 0 }, "HMAC-SHA1 AES256 key",
81 "md5-hmac-rc4", { 0 }, "Microsoft MD5 HMAC",
99 "hmac-sha256-128-aes128", { 0 }, "HMAC-SHA256 AES128 key",
105 "hmac-sha384-192-aes256", { 0 }, "HMAC-SHA384 AES256 key",
H A Detypes.c49 "des3-cbc-sha1", { "des3-hmac-sha1", "des3-cbc-sha1-kd" },
50 "Triple DES cbc mode with HMAC/sha1",
59 /* rc4-hmac uses a 128-bit key, but due to weaknesses in the RC4 cipher, we
62 "arcfour-hmac", { "rc4-hmac", "arcfour-hmac-md5" },
63 "ArcFour with HMAC/md5",
73 "arcfour-hmac-exp", { "rc4-hmac-exp", "arcfour-hmac-md5-exp" },
74 "Exportable ArcFour with HMAC/md5",
86 "aes128-cts-hmac-sha1-96", { "aes128-cts", "aes128-sha1" },
87 "AES-128 CTS mode with 96-bit SHA-1 HMAC",
96 "aes256-cts-hmac-sha1-96", { "aes256-cts", "aes256-sha1" },
[all …]
H A Dchecksum_hmac_md5.c28 * Microsoft HMAC-MD5 and MD5-HMAC checksums (see RFC 4757):
29 * HMAC(KS, hash(msusage || input))
30 * KS is HMAC(key, "signaturekey\0") for HMAC-MD5, or just the key for
31 * MD5-HMAC.
52 /* Compute HMAC(key, "signaturekey\0") to get the signing key ks. */ in krb5int_hmacmd5_checksum()
65 } else /* For md5-hmac, just use the key. */ in krb5int_hmacmd5_checksum()
84 /* Compute HMAC(ks, md5value). */ in krb5int_hmacmd5_checksum()
/freebsd/crypto/openssl/test/recipes/
H A D20-test_dgst.t187 subtest "HMAC generation with `dgst` CLI" => sub {
191 #HMAC the data twice to check consistency
192 my @hmacdata = run(app(['openssl', 'dgst', '-sha256', '-hmac', '123456',
195 …my $expected = qr/HMAC-SHA2-256\(\Q$testdata\E\)= 6f12484129c4a761747f13d8234a1ff0e074adb34e9e9bf3…
196 …ok($hmacdata[0] =~ $expected, "HMAC: Check HMAC value is as expected ($hmacdata[0]) vs ($expected)…
198 "HMAC: Check second HMAC value is consistent with the first ($hmacdata[1]) vs ($expected)");
201 subtest "HMAC generation with `dgst` CLI, default digest" => sub {
205 #HMAC the data twice to check consistency
206 my @hmacdata = run(app(['openssl', 'dgst', '-hmac', '123456',
209 …my $expected = qr/HMAC-SHA256\(\Q$testdata\E\)= 6f12484129c4a761747f13d8234a1ff0e074adb34e9e9bf3a1…
[all …]
H A D03-test_fipsinstall.t148 '-provider_name', 'fips', '-mac_name', 'HMAC',
155 '-provider_name', 'fips', '-mac_name', 'HMAC',
162 '-provider_name', 'fips', '-mac_name', 'HMAC',
193 '-provider_name', 'fips', '-mac_name', 'HMAC',
202 '-provider_name', 'fips', '-mac_name', 'HMAC',
212 '-provider_name', 'fips', '-mac_name', 'HMAC',
222 '-provider_name', 'fips', '-mac_name', 'HMAC',
232 '-provider_name', 'fips', '-mac_name', 'HMAC',
240 '-provider_name', 'fips', '-mac_name', 'HMAC',
248 '-provider_name', 'fips', '-mac_name', 'HMAC',
[all …]
/freebsd/crypto/openssl/doc/man7/
H A DEVP_KDF-HMAC-DRBG.pod5 EVP_KDF-HMAC-DRBG
6 - The HMAC DRBG DETERMINISTIC EVP_KDF implementation
10 Support for a deterministic HMAC DRBG using the B<EVP_KDF> API. This is similar
11 to L<EVP_RAND-HMAC-DRBG(7)>, but uses fixed values for its entropy and nonce
17 "HMAC-DRBG-KDF" is the name for this implementation; it can be used
34 Sets the entropy bytes supplied to the HMAC-DRBG.
38 Sets the nonce bytes supplied to the HMAC-DRBG.
44 A context for KDF HMAC DRBG can be obtained by calling:
46 EVP_KDF *kdf = EVP_KDF_fetch(NULL, "HMAC-DRBG-KDF", NULL);
60 The EVP_KDF-HMAC-DRBG functionality was added in OpenSSL 3.2.
/freebsd/sbin/setkey/
H A Dsample.cf38 # hmac-sha2-512 whose key is "this is the test key".
53 -A hmac-sha2-512 "this is the test key" ;
57 -A hmac-sha2-512 "this is the test key" ;
62 # Security protocol is old AH tunnel mode, i.e. RFC1826, with hmac-sha2-256
78 -A hmac-sha2-256 "this is the test" ;
81 -A hmac-sha2-256 "this is the test" ;
95 -A hmac-sha2-256 "this is the test" ;
98 -A hmac-sha2-256 "this is the test" ;
103 # is hmac-sha2-512. Authentication algorithm for AH is hmac-sha2-256.
121 -A hmac-sha2-512 "this is the test key" ;
[all …]
/freebsd/contrib/wpa/src/tls/
H A Dtlsv1_record.c140 * header, IV (TLS v1.1), and HMAC)
147 * This function fills in the TLS record layer header, adds HMAC, and encrypts
155 struct crypto_hash *hmac; in tlsv1_record_send() local
207 hmac = crypto_hash_init(rl->hash_alg, rl->write_mac_secret, in tlsv1_record_send()
209 if (hmac == NULL) { in tlsv1_record_send()
211 "to initialize HMAC"); in tlsv1_record_send()
214 crypto_hash_update(hmac, rl->write_seq_num, TLS_SEQ_NUM_LEN); in tlsv1_record_send()
216 crypto_hash_update(hmac, ct_start, TLS_RECORD_HEADER_LEN); in tlsv1_record_send()
217 crypto_hash_update(hmac, payload, payload_len); in tlsv1_record_send()
222 crypto_hash_finish(hmac, NULL, NULL); in tlsv1_record_send()
[all …]
/freebsd/secure/lib/libcrypto/man/man7/
H A DEVP_KDF-HMAC-DRBG.757 .IX Title "EVP_KDF-HMAC-DRBG 7ossl"
58 .TH EVP_KDF-HMAC-DRBG 7ossl 2025-09-30 3.5.4 OpenSSL
64 EVP_KDF\-HMAC\-DRBG
65 \&\- The HMAC DRBG DETERMINISTIC EVP_KDF implementation
68 Support for a deterministic HMAC DRBG using the \fBEVP_KDF\fR API. This is similar
69 to \fBEVP_RAND\-HMAC\-DRBG\fR\|(7), but uses fixed values for its entropy and nonce
88 Sets the entropy bytes supplied to the HMAC-DRBG.
91 Sets the nonce bytes supplied to the HMAC-DRBG.
94 A context for KDF HMAC DRBG can be obtained by calling:
97 \& EVP_KDF *kdf = EVP_KDF_fetch(NULL, "HMAC\-DRBG\-KDF", NULL);
[all …]
H A DOSSL_PROVIDER-FIPS.7140 .IP "HMAC, see \fBEVP_MAC\-HMAC\fR\|(7)" 4
141 .IX Item "HMAC, see EVP_MAC-HMAC"
211 .IP "HMAC, see \fBEVP_SIGNATURE\-HMAC\fR\|(7)" 4
212 .IX Item "HMAC, see EVP_SIGNATURE-HMAC"
261 .IP "HMAC, see \fBEVP_KEYMGMT\-HMAC\fR\|(7)" 4
262 .IX Item "HMAC, see EVP_KEYMGMT-HMAC"
305 .IP "HMAC-DRBG, see \fBEVP_RAND\-HMAC\-DRBG\fR\|(7)" 4
306 .IX Item "HMAC-DRBG, see EVP_RAND-HMAC-DRBG"
332 Uses HMAC SHA256 on the module file to validate that the module has not been
338 HMAC SHA256 prior to using it.
[all …]
H A DEVP_RAND-HMAC-DRBG.757 .IX Title "EVP_RAND-HMAC-DRBG 7ossl"
58 .TH EVP_RAND-HMAC-DRBG 7ossl 2025-09-30 3.5.4 OpenSSL
64 EVP_RAND\-HMAC\-DRBG \- The HMAC DRBG EVP_RAND implementation
67 Support for the HMAC deterministic random bit generator through the
121 The default HMAC-DRBG implementation attempts to fetch the required internal
139 A context for HMAC DRBG can be obtained by calling:
142 \& EVP_RAND *rand = EVP_RAND_fetch(NULL, "HMAC\-DRBG", NULL);
154 \& rand = EVP_RAND_fetch(NULL, "HMAC\-DRBG", NULL);
/freebsd/share/man/man4/
H A Dccr.453 SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC
62 SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, or SHA2-512-HMAC for
/freebsd/sys/geom/eli/
H A Dg_eli_key.c56 const unsigned char *odhmac; /* On-disk HMAC. */ in g_eli_mkey_verify()
57 unsigned char chmac[SHA512_MDLEN]; /* Calculated HMAC. */ in g_eli_mkey_verify()
58 unsigned char hmkey[SHA512_MDLEN]; /* Key for HMAC. */ in g_eli_mkey_verify()
61 * The key for HMAC calculations is: hmkey = HMAC_SHA512(Derived-Key, 0) in g_eli_mkey_verify()
67 /* Calculate HMAC from Data-Key and IV-Key. */ in g_eli_mkey_verify()
74 * Compare calculated HMAC with HMAC from metadata. in g_eli_mkey_verify()
81 * Calculate HMAC from Data-Key and IV-Key.
86 unsigned char hmkey[SHA512_MDLEN]; /* Key for HMAC. */ in g_eli_mkey_hmac()
87 unsigned char *odhmac; /* On-disk HMAC. */ in g_eli_mkey_hmac()
90 * The key for HMAC calculations is: hmkey = HMAC_SHA512(Derived-Key, 0) in g_eli_mkey_hmac()
[all …]
/freebsd/crypto/openssl/providers/implementations/kdfs/
H A Dhmacdrbg_kdf.c141 KDF_HMAC_DRBG *hmac = (KDF_HMAC_DRBG *)vctx; in hmac_drbg_kdf_get_ctx_params() local
142 PROV_DRBG_HMAC *drbg = &hmac->base; in hmac_drbg_kdf_get_ctx_params()
179 KDF_HMAC_DRBG *hmac = (KDF_HMAC_DRBG *)vctx; in hmac_drbg_kdf_set_ctx_params() local
180 PROV_DRBG_HMAC *drbg = &hmac->base; in hmac_drbg_kdf_set_ctx_params()
181 OSSL_LIB_CTX *libctx = PROV_LIBCTX_OF(hmac->provctx); in hmac_drbg_kdf_set_ctx_params()
195 OPENSSL_free(hmac->entropy); in hmac_drbg_kdf_set_ctx_params()
196 hmac->entropy = ptr; in hmac_drbg_kdf_set_ctx_params()
197 hmac->entropylen = size; in hmac_drbg_kdf_set_ctx_params()
198 hmac->init = 0; in hmac_drbg_kdf_set_ctx_params()
206 OPENSSL_free(hmac->nonce); in hmac_drbg_kdf_set_ctx_params()
[all …]
/freebsd/crypto/openssh/
H A Dmac.c35 #include "hmac.h"
60 { "hmac-sha1", SSH_DIGEST, SSH_DIGEST_SHA1, 0, 0, 0, 0 },
61 { "hmac-sha1-96", SSH_DIGEST, SSH_DIGEST_SHA1, 96, 0, 0, 0 },
62 { "hmac-sha2-256", SSH_DIGEST, SSH_DIGEST_SHA256, 0, 0, 0, 0 },
63 { "hmac-sha2-512", SSH_DIGEST, SSH_DIGEST_SHA512, 0, 0, 0, 0 },
64 { "hmac-md5", SSH_DIGEST, SSH_DIGEST_MD5, 0, 0, 0, 0 },
65 { "hmac-md5-96", SSH_DIGEST, SSH_DIGEST_MD5, 96, 0, 0, 0 },
70 { "hmac-sha1-etm@openssh.com", SSH_DIGEST, SSH_DIGEST_SHA1, 0, 0, 0, 1 },
71 { "hmac-sha1-96-etm@openssh.com", SSH_DIGEST, SSH_DIGEST_SHA1, 96, 0, 0, 1 },
72 { "hmac-sha2-256-etm@openssh.com", SSH_DIGEST, SSH_DIGEST_SHA256, 0, 0, 0, 1 },
[all …]
/freebsd/contrib/libfido2/src/
H A Dconfig.c17 config_prepare_hmac(uint8_t subcmd, const cbor_item_t *item, fido_blob_t *hmac) in config_prepare_hmac() argument
32 if ((hmac->ptr = malloc(cbor_len + sizeof(prefix))) == NULL) { in config_prepare_hmac()
36 memcpy(hmac->ptr, prefix, sizeof(prefix)); in config_prepare_hmac()
37 memcpy(hmac->ptr + sizeof(prefix), cbor, cbor_len); in config_prepare_hmac()
38 hmac->len = cbor_len + sizeof(prefix); in config_prepare_hmac()
49 fido_blob_t *ecdh = NULL, f, hmac; in config_tx() local
54 memset(&hmac, 0, sizeof(hmac)); in config_tx()
73 if (config_prepare_hmac(subcmd, argv[1], &hmac) < 0) { in config_tx()
81 if ((r = cbor_add_uv_params(dev, cmd, &hmac, pk, ecdh, pin, in config_tx()
102 free(hmac.ptr); in config_tx()
/freebsd/contrib/wpa/src/eap_common/
H A Deap_peap_common.c37 * T1 = HMAC-SHA1(K, S | 0x01 | 0x00 | 0x00) in peap_prfplus()
38 * T2 = HMAC-SHA1(K, T1 | S | 0x02 | 0x00 | 0x00) in peap_prfplus()
40 * Tn = HMAC-SHA1(K, Tn-1 | S | n | 0x00 | 0x00) in peap_prfplus()
53 * T1 = HMAC-SHA1(K, S | LEN | 0x01) in peap_prfplus()
54 * T2 = HMAC-SHA1 (K, T1 | S | LEN | 0x02) in peap_prfplus()
55 * T3 = HMAC-SHA1 (K, T2 | S | LEN | 0x03) in peap_prfplus()
56 * T4 = HMAC-SHA1 (K, T3 | S | LEN | 0x04) in peap_prfplus()

12345678910>>...23