Home
last modified time | relevance | path

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

12345678910>>...12

/openbmc/qemu/include/crypto/
H A Dhmac.h2 * QEMU Crypto hmac algorithms
26 * @alg: the hmac algorithm
28 * Determine if @alg hmac algorithm is supported by
38 * @alg: the hmac algorithm
43 * Creates a new hmac object with the algorithm @alg
50 * returned hmac object when no longer required
53 * a new hmac object, or NULL on error
61 * @hmac: the hmac object
63 * Release the memory associated with @hmac that was
66 void qcrypto_hmac_free(QCryptoHmac *hmac);
[all …]
/openbmc/qemu/crypto/
H A Dhmac.c2 * QEMU Crypto hmac algorithms
13 #include "crypto/hmac.h"
18 int qcrypto_hmac_bytesv(QCryptoHmac *hmac, in qcrypto_hmac_bytesv() argument
25 QCryptoHmacDriver *drv = hmac->driver; in qcrypto_hmac_bytesv()
27 return drv->hmac_bytesv(hmac, iov, niov, result, resultlen, errp); in qcrypto_hmac_bytesv()
30 int qcrypto_hmac_bytes(QCryptoHmac *hmac, in qcrypto_hmac_bytes() argument
42 return qcrypto_hmac_bytesv(hmac, &iov, 1, result, resultlen, errp); in qcrypto_hmac_bytes()
45 int qcrypto_hmac_digestv(QCryptoHmac *hmac, in qcrypto_hmac_digestv() argument
55 if (qcrypto_hmac_bytesv(hmac, iov, niov, &result, &resultlen, errp) < 0) { in qcrypto_hmac_digestv()
72 int qcrypto_hmac_digest(QCryptoHmac *hmac, in qcrypto_hmac_digest() argument
[all …]
H A Dhmac-glib.c2 * QEMU Crypto hmac algorithms (based on glib)
17 #include "crypto/hmac.h"
52 error_setg(errp, "Unsupported hmac algorithm %s", in qcrypto_hmac_ctx_new()
62 error_setg(errp, "Cannot initialize hmac and set key"); in qcrypto_hmac_ctx_new()
74 qcrypto_glib_hmac_ctx_free(QCryptoHmac *hmac) in qcrypto_glib_hmac_ctx_free() argument
78 ctx = hmac->opaque; in qcrypto_glib_hmac_ctx_free()
85 qcrypto_glib_hmac_bytesv(QCryptoHmac *hmac, in qcrypto_glib_hmac_bytesv() argument
95 ctx = hmac->opaque; in qcrypto_glib_hmac_bytesv()
101 ret = g_checksum_type_get_length(qcrypto_hmac_alg_map[hmac->alg]); in qcrypto_glib_hmac_bytesv()
103 error_setg(errp, "Unable to get hmac length"); in qcrypto_glib_hmac_bytesv()
[all …]
H A Dhmac-gnutls.c2 * QEMU Crypto hmac algorithms
6 * Derived from hmac-gcrypt.c:
20 #include "crypto/hmac.h"
63 error_setg(errp, "Unsupported hmac algorithm %s", in qcrypto_hmac_ctx_new()
74 error_setg(errp, "Cannot initialize hmac: %s", in qcrypto_hmac_ctx_new()
87 qcrypto_gnutls_hmac_ctx_free(QCryptoHmac *hmac) in qcrypto_gnutls_hmac_ctx_free() argument
91 ctx = hmac->opaque; in qcrypto_gnutls_hmac_ctx_free()
98 qcrypto_gnutls_hmac_bytesv(QCryptoHmac *hmac, in qcrypto_gnutls_hmac_bytesv() argument
109 ctx = hmac->opaque; in qcrypto_gnutls_hmac_bytesv()
115 ret = gnutls_hmac_get_len(qcrypto_hmac_alg_map[hmac->alg]); in qcrypto_gnutls_hmac_bytesv()
[all …]
H A Dhmac-gcrypt.c2 * QEMU Crypto hmac algorithms (based on libgcrypt)
17 #include "crypto/hmac.h"
57 error_setg(errp, "Unsupported hmac algorithm %s", in qcrypto_hmac_ctx_new()
67 error_setg(errp, "Cannot initialize hmac: %s", in qcrypto_hmac_ctx_new()
88 qcrypto_gcrypt_hmac_ctx_free(QCryptoHmac *hmac) in qcrypto_gcrypt_hmac_ctx_free() argument
92 ctx = hmac->opaque; in qcrypto_gcrypt_hmac_ctx_free()
99 qcrypto_gcrypt_hmac_bytesv(QCryptoHmac *hmac, in qcrypto_gcrypt_hmac_bytesv() argument
111 ctx = hmac->opaque; in qcrypto_gcrypt_hmac_bytesv()
117 ret = gcry_mac_get_algo_maclen(qcrypto_hmac_alg_map[hmac->alg]); in qcrypto_gcrypt_hmac_bytesv()
119 error_setg(errp, "Unable to get hmac length: %s", in qcrypto_gcrypt_hmac_bytesv()
[all …]
H A Dhmac-nettle.c2 * QEMU Crypto hmac algorithms (based on nettle)
17 #include "crypto/hmac.h"
19 #include <nettle/hmac.h>
122 error_setg(errp, "Unsupported hmac algorithm %s", in qcrypto_hmac_ctx_new()
135 qcrypto_nettle_hmac_ctx_free(QCryptoHmac *hmac) in qcrypto_nettle_hmac_ctx_free() argument
139 ctx = hmac->opaque; in qcrypto_nettle_hmac_ctx_free()
144 qcrypto_nettle_hmac_bytesv(QCryptoHmac *hmac, in qcrypto_nettle_hmac_bytesv() argument
154 ctx = (QCryptoHmacNettle *)hmac->opaque; in qcrypto_nettle_hmac_bytesv()
161 qcrypto_hmac_alg_map[hmac->alg].update(&ctx->u, len, base); in qcrypto_nettle_hmac_bytesv()
168 *resultlen = qcrypto_hmac_alg_map[hmac->alg].len; in qcrypto_nettle_hmac_bytesv()
[all …]
H A Dhash-afalg.c2 * QEMU Crypto af_alg-backend hash/hmac support
19 #include "crypto/hmac.h"
60 name = g_strdup_printf("hmac(%s)", alg_name); in qcrypto_afalg_hash_format_name()
89 /* HMAC needs setkey */ in qcrypto_afalg_hash_hmac_ctx_new()
93 error_setg_errno(errp, errno, "Set hmac key failed"); in qcrypto_afalg_hash_hmac_ctx_new()
240 qcrypto_afalg_hash_hmac_bytesv(QCryptoAFAlgo *hmac, in qcrypto_afalg_hash_hmac_bytesv() argument
249 ret = qcrypto_afalg_send_to_kernel(hmac, iov, niov, false, errp); in qcrypto_afalg_hash_hmac_bytesv()
251 ret = qcrypto_afalg_recv_from_kernel(hmac, alg, result, in qcrypto_afalg_hash_hmac_bytesv()
259 qcrypto_afalg_hmac_bytesv(QCryptoHmac *hmac, in qcrypto_afalg_hmac_bytesv() argument
265 return qcrypto_afalg_hash_hmac_bytesv(hmac->opaque, hmac->alg, in qcrypto_afalg_hmac_bytesv()
[all …]
H A Dmeson.build11 'hmac.c',
32 crypto_ss.add(nettle, files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'))
40 crypto_ss.add(gcrypt, files('hash-gcrypt.c', 'hmac-gcrypt.c', 'pbkdf-gcrypt.c'))
42 crypto_ss.add(gnutls, files('hash-gnutls.c', 'hmac-gnutls.c', 'pbkdf-gnutls.c'))
44 crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
/openbmc/linux/fs/ubifs/
H A Dauth.c39 * ubifs_hash_calc_hmac - calculate a HMAC from a hash
41 * @hash: the node to calculate a HMAC for
42 * @hmac: the returned HMAC
47 u8 *hmac) in ubifs_hash_calc_hmac() argument
49 return crypto_shash_tfm_digest(c->hmac_tfm, hash, c->hash_len, hmac); in ubifs_hash_calc_hmac()
59 * It creates a HMAC from the given input hash and writes it to the node.
81 err = ubifs_hash_calc_hmac(c, hash, auth->hmac); in ubifs_prepare_auth_node()
276 snprintf(hmac_name, CRYPTO_MAX_ALG_NAME, "hmac(%s)", in ubifs_init_authentication()
327 ubifs_err(c, "hmac %s is bigger than maximum allowed hmac size (%d > %d)", in ubifs_init_authentication()
377 * ubifs_node_calc_hmac - calculate the HMAC of a UBIFS node
[all …]
/openbmc/qemu/tests/unit/
H A Dtest-crypto-hmac.c2 * QEMU Crypto hmac algorithms tests
17 #include "crypto/hmac.h"
97 QCryptoHmac *hmac = NULL; in test_hmac_alloc() local
110 hmac = qcrypto_hmac_new(data->alg, (const uint8_t *)KEY, in test_hmac_alloc()
112 g_assert(hmac != NULL); in test_hmac_alloc()
114 ret = qcrypto_hmac_bytes(hmac, (const char *)INPUT_TEXT, in test_hmac_alloc()
124 qcrypto_hmac_free(hmac); in test_hmac_alloc()
136 QCryptoHmac *hmac = NULL; in test_hmac_prealloc() local
152 hmac = qcrypto_hmac_new(data->alg, (const uint8_t *)KEY, in test_hmac_prealloc()
154 g_assert(hmac != NULL); in test_hmac_prealloc()
[all …]
/openbmc/linux/net/sctp/
H A DKconfig53 prompt "Default SCTP cookie HMAC encoding"
56 This option sets the default sctp cookie hmac algorithm
60 bool "Enable optional MD5 hmac cookie generation"
62 Enable optional MD5 hmac based SCTP cookie generation
66 bool "Enable optional SHA1 hmac cookie generation"
68 Enable optional SHA1 hmac based SCTP cookie generation
72 bool "Use no hmac alg in SCTP cookie generation"
74 Use no hmac algorithm in SCTP cookie generation
79 bool "Enable optional MD5 hmac cookie generation"
81 Enable optional MD5 hmac based SCTP cookie generation
[all …]
/openbmc/openbmc-test-automation/security/
H A Dtest_bmc_ssh_security.robot40 …# debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.co…
41 # hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,
42 # umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
43 …# debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.co…
44 # hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,
45 # umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
/openbmc/qemu/tests/bench/
H A Dbenchmark-crypto-hmac.c2 * QEMU Crypto hmac speed benchmark
16 #include "crypto/hmac.h"
23 QCryptoHmac *hmac = NULL; in test_hmac_speed() local
43 hmac = qcrypto_hmac_new(QCRYPTO_HASH_ALGO_SHA256, in test_hmac_speed()
46 g_assert(hmac != NULL); in test_hmac_speed()
48 ret = qcrypto_hmac_bytesv(hmac, &iov, 1, &out, &out_len, &err); in test_hmac_speed()
52 qcrypto_hmac_free(hmac); in test_hmac_speed()
58 g_test_message("hmac(%s): chunk %zu bytes %.2f MB/sec", in test_hmac_speed()
76 snprintf(name, sizeof(name), "/crypto/hmac/speed-%zu", i); in main()
/openbmc/phosphor-net-ipmid/
H A Dintegrity_algo.hpp112 * generated by running HMAC(constN) using SIK as the key. It does not
137 * HMAC-SHA1-96 the authcode field is 12 bytes. For HMAC-SHA256-128 and
138 * HMAC-MD5-128 the authcode field is 16 bytes.
150 * @brief Implementation of the HMAC-SHA1-96 Integrity algorithm
152 * HMAC-SHA1-96 take the Session Integrity Key and use it to generate K1. K1 is
153 * then used as the key for use in HMAC to produce the AuthCode field.
155 * the Session Integrity Key. When the HMAC-SHA1-96 Integrity Algorithm is used
212 * @return on success returns the Kn based on HMAC-SHA1
220 * @brief Generate HMAC based on HMAC-SHA1-96 algorithm
235 * @brief Implementation of the HMAC-SHA256-128 Integrity algorithm
[all …]
H A Dauth_algo.cpp5 #include <openssl/hmac.h>
23 if (HMAC(EVP_sha1(), userKey.data(), userKey.size(), input.data(), in generateHMAC()
26 lg2::error("Generate HMAC failed: {ERROR}", "ERROR", strerror(errno)); in generateHMAC()
39 if (HMAC(EVP_sha1(), sessionIntegrityKey.data(), SHA_DIGEST_LENGTH, in generateICV()
57 if (HMAC(EVP_sha256(), userKey.data(), userKey.size(), input.data(), in generateHMAC()
74 if (HMAC(EVP_sha256(), sessionIntegrityKey.data(), in generateICV()
H A Dintegrity_algo.cpp6 #include <openssl/hmac.h>
27 if (HMAC(EVP_sha1(), k1.data(), k1.size(), input, len, output.data(), in generateHMAC()
33 // HMAC generates Message Digest to the size of SHA_DIGEST_LENGTH, the in generateHMAC()
72 if (HMAC(EVP_sha1(), sik.data(), sik.size(), const_n.data(), const_n.size(), in generateKn()
93 if (HMAC(EVP_sha256(), k1.data(), k1.size(), input, len, output.data(), in generateHMAC()
99 // HMAC generates Message Digest to the size of SHA256_DIGEST_LENGTH, the in generateHMAC()
138 if (HMAC(EVP_sha256(), sik.data(), sik.size(), const_n.data(), in generateKn()
/openbmc/linux/Documentation/ABI/testing/
H A Devm8 HMAC-sha1 value across the extended attributes, storing the
12 an HMAC-sha1 generated locally with a
24 0 Enable HMAC validation and creation
27 runtime. Not supported if HMAC validation and
36 will enable HMAC validation and creation
42 will enable HMAC and digital signature validation and
43 HMAC creation and disable all further modification of policy.
72 Note that once an HMAC key has been loaded, it will no longer
74 HMAC key has been loaded will clear the corresponding flag.
81 Loading an HMAC key is the only way to disable metadata
/openbmc/linux/drivers/crypto/caam/
H A Dcaamalg.c2140 .cra_name = "authenc(hmac(md5),"
2142 .cra_driver_name = "authenc-hmac-md5-"
2164 .cra_name = "authenc(hmac(sha1),"
2166 .cra_driver_name = "authenc-hmac-sha1-"
2188 .cra_name = "authenc(hmac(sha224),"
2190 .cra_driver_name = "authenc-hmac-sha224-"
2212 .cra_name = "authenc(hmac(sha256),"
2214 .cra_driver_name = "authenc-hmac-sha256-"
2236 .cra_name = "authenc(hmac(sha384),"
2238 .cra_driver_name = "authenc-hmac-sha384-"
[all …]
H A Dcaamalg_qi.c1653 .cra_name = "authenc(hmac(md5),cbc(aes))",
1654 .cra_driver_name = "authenc-hmac-md5-"
1674 .cra_name = "echainiv(authenc(hmac(md5),"
1676 .cra_driver_name = "echainiv-authenc-hmac-md5-"
1697 .cra_name = "authenc(hmac(sha1),cbc(aes))",
1698 .cra_driver_name = "authenc-hmac-sha1-"
1718 .cra_name = "echainiv(authenc(hmac(sha1),"
1721 "hmac-sha1-cbc-aes-caam-qi",
1741 .cra_name = "authenc(hmac(sha224),cbc(aes))",
1742 .cra_driver_name = "authenc-hmac-sha224-"
[all …]
/openbmc/linux/security/integrity/evm/
H A DKconfig21 Include filesystem UUID for HMAC calculation.
26 WARNING: changing the HMAC calculation method or adding
35 Include additional SMACK xattrs for HMAC calculation.
39 in the HMAC calculation, enabling this option includes newly defined
43 WARNING: changing the HMAC calculation method or adding
52 Allow userland to provide additional xattrs for HMAC calculation.
/openbmc/linux/Documentation/networking/
H A Dseg6-sysctl.rst20 Define HMAC policy for ingress SR-enabled packets on this interface.
22 * -1 - Ignore HMAC field
23 * 0 - Accept SR packets without HMAC, validate SR packets with HMAC
24 * 1 - Drop SR packets without HMAC, validate SR packets with HMAC
/openbmc/ipmitool/src/plugins/lanplus/
H A DREADME.lanplus11 specification states that K1 and K2 are generated with an HMAC algorithm,
12 and all of the authentication algorithms (except for "none") are HMAC
13 algorithms, whereas the integrity algorithms are not all HMAC. See section
27 * The specification is unclear as to which key is used for HMAC based
29 that HMAC integrity algorithms use the session integrity key as the HMAC
33 will be generated by processing a pre-defined set of constants using HMAC
37 keying material." We decided to use K1 as our HMAC key for the generation
/openbmc/linux/drivers/crypto/intel/keembay/
H A Dkeembay-ocs-hcu-core.c9 #include <crypto/hmac.h>
30 /* Flag marking a HMAC request. */
32 /* Flag set when HW HMAC is being used. */
34 /* Flag set when SW HMAC is being used. */
40 * @key: The key (used only for HMAC transformations).
43 * @is_hmac_tfm: Whether or not this is a HMAC transformation.
62 * @buffer: Buffer to store: partial block of data and SW HMAC
81 * Buffer is double the block size because we need space for SW HMAC
398 * Prepare IPAD for HMAC. Only done for first block. in prepare_ipad()
399 * HMAC(k,m) = H(k ^ opad || H(k ^ ipad || m)) in prepare_ipad()
[all …]
/openbmc/linux/drivers/crypto/inside-secure/
H A Dsafexcel_hash.c9 #include <crypto/hmac.h>
42 bool hmac; member
161 /* Hash continuation or HMAC, setup (inner) digest from state */ in safexcel_context_control()
165 /* Compute digest count for hash/HMAC finish operations */ in safexcel_context_control()
183 /* Special case: zero length HMAC */ in safexcel_context_control()
185 /* PE HW < 4.4 cannot do HMAC continue, fake using hash */ in safexcel_context_control()
192 /* For zero-len HMAC, don't finalize, already padded! */ in safexcel_context_control()
202 /* Clear zero-length HMAC flag for next operation! */ in safexcel_context_control()
204 } else { /* HMAC */ in safexcel_context_control()
205 /* Need outer digest for HMAC finalization */ in safexcel_context_control()
[all …]
/openbmc/linux/drivers/crypto/allwinner/sun8i-ss/
H A Dsun8i-ss-hash.c13 #include <crypto/hmac.h>
508 /* HMAC step: in sun8i_ss_hash_run()
513 int hmac = 0; in sun8i_ss_hash_run() local
587 if (tfmctx->keylen && hmac == 0) { in sun8i_ss_hash_run()
588 hmac = 1; in sun8i_ss_hash_run()
609 if (tfmctx->keylen && hmac == 2) { in sun8i_ss_hash_run()
671 * flow start for hmac = 0 (and HMAC = 1) in sun8i_ss_hash_run()
672 * HMAC = 0 in sun8i_ss_hash_run()
677 * if hmac then hmac = 1 in sun8i_ss_hash_run()
679 * if hmac == 2 in sun8i_ss_hash_run()
[all …]

12345678910>>...12