Searched defs:hmac (Results 1 - 22 of 22) sorted by relevance

/external/dropbear/libtomcrypt/src/mac/hmac/
H A Dhmac_process.c22 @param hmac The hmac state
27 int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen) argument
30 LTC_ARGCHK(hmac != NULL);
32 if ((err = hash_is_valid(hmac->hash)) != CRYPT_OK) {
35 return hash_descriptor[hmac->hash].process(&hmac->md, in, inlen);
41 /* $Source: /cvs/libtom/libtomcrypt/src/mac/hmac/hmac_process.c,v $ */
H A Dhmac_memory.c36 hmac_state *hmac; local
54 /* nope, so call the hmac functions */
55 /* allocate ram for hmac state */
56 hmac = XMALLOC(sizeof(hmac_state));
57 if (hmac == NULL) {
61 if ((err = hmac_init(hmac, hash, key, keylen)) != CRYPT_OK) {
65 if ((err = hmac_process(hmac, in, inlen)) != CRYPT_OK) {
69 if ((err = hmac_done(hmac, out, outlen)) != CRYPT_OK) {
76 zeromem(hmac, sizeof(hmac_state));
79 XFREE(hmac);
[all...]
H A Dhmac_done.c24 @param hmac The HMAC state
29 int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen) argument
35 LTC_ARGCHK(hmac != NULL);
39 hash = hmac->hash;
61 if ((err = hash_descriptor[hash].done(&hmac->md, isha)) != CRYPT_OK) {
67 buf[i] = hmac->key[i] ^ 0x5C;
71 if ((err = hash_descriptor[hash].init(&hmac->md)) != CRYPT_OK) {
74 if ((err = hash_descriptor[hash].process(&hmac->md, buf, HMAC_BLOCKSIZE)) != CRYPT_OK) {
77 if ((err = hash_descriptor[hash].process(&hmac->md, isha, hashsize)) != CRYPT_OK) {
80 if ((err = hash_descriptor[hash].done(&hmac
[all...]
H A Dhmac_init.c24 @param hmac The HMAC state
30 int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned long keylen) argument
37 LTC_ARGCHK(hmac != NULL);
44 hmac->hash = hash;
59 hmac->key = XMALLOC(HMAC_BLOCKSIZE);
60 if (hmac->key == NULL) {
68 if ((err = hash_memory(hash, key, keylen, hmac->key, &z)) != CRYPT_OK) {
72 zeromem((hmac->key) + hashsize, (size_t)(HMAC_BLOCKSIZE - hashsize));
76 XMEMCPY(hmac->key, key, (size_t)keylen);
78 zeromem((hmac
[all...]
H A Dhmac_memory_multi.c39 hmac_state *hmac; local
50 /* allocate ram for hmac state */
51 hmac = XMALLOC(sizeof(hmac_state));
52 if (hmac == NULL) {
56 if ((err = hmac_init(hmac, hash, key, keylen)) != CRYPT_OK) {
65 if ((err = hmac_process(hmac, curptr, curlen)) != CRYPT_OK) {
75 if ((err = hmac_done(hmac, out, outlen)) != CRYPT_OK) {
80 zeromem(hmac, sizeof(hmac_state));
82 XFREE(hmac);
90 /* $Source: /cvs/libtom/libtomcrypt/src/mac/hmac/hmac_memory_mult
[all...]
/external/openssl/crypto/pkcs12/
H A Dp12_mutl.c62 #include <openssl/hmac.h>
71 HMAC_CTX hmac; local
99 HMAC_CTX_init(&hmac);
100 if (!HMAC_Init_ex(&hmac, key, md_size, md_type, NULL)
101 || !HMAC_Update(&hmac, p12->authsafes->d.data->data,
103 || !HMAC_Final(&hmac, mac, maclen))
105 HMAC_CTX_cleanup(&hmac);
108 HMAC_CTX_cleanup(&hmac);
/external/dropbear/libtomcrypt/src/misc/pkcs5/
H A Dpkcs_5_2.c40 hmac_state *hmac; local
53 hmac = XMALLOC(sizeof(hmac_state));
54 if (hmac == NULL || buf[0] == NULL) {
55 if (hmac != NULL) {
56 XFREE(hmac);
78 if ((err = hmac_init(hmac, hash_idx, password, password_len)) != CRYPT_OK) {
81 if ((err = hmac_process(hmac, salt, salt_len)) != CRYPT_OK) {
84 if ((err = hmac_process(hmac, buf[1], 4)) != CRYPT_OK) {
88 if ((err = hmac_done(hmac, buf[0], &x)) != CRYPT_OK) {
115 zeromem(hmac, sizeo
[all...]
/external/srtp/crypto/hash/
H A Dhmac.c2 * hmac.c
4 * implementation of hmac auth_type_t
45 #include "hmac.h"
52 "hmac sha-1" /* printable name for module */
58 extern auth_type_t hmac;
82 (*a)->type = &hmac;
88 /* increment global count of all hmac uses */
89 hmac.ref_count++;
96 extern auth_type_t hmac;
105 /* decrement global count of all hmac use
255 hmac = { variable
[all...]
/external/dropbear/
H A Dpacket.c267 /* check the hmac */
318 hmac_state hmac; local
329 if (hmac_init(&hmac,
339 if (hmac_process(&hmac, tempbuf, 4) != CRYPT_OK) {
345 if (hmac_process(&hmac, buf_getptr(sourcebuf, len), len) != CRYPT_OK) {
350 if (hmac_done(&hmac, tempbuf, &bufsize) != CRYPT_OK) {
500 /* now add a hmac and we're done */
526 hmac_state hmac; local
533 if (hmac_init(&hmac,
542 if (hmac_process(&hmac, seqbu
[all...]
/external/wpa_supplicant_8/hostapd/src/tls/
H A Dtlsv1_record.c155 struct crypto_hash *hmac; local
207 hmac = crypto_hash_init(rl->hash_alg, rl->write_mac_secret,
209 if (hmac == NULL) {
214 crypto_hash_update(hmac, rl->write_seq_num, TLS_SEQ_NUM_LEN);
216 crypto_hash_update(hmac, ct_start, TLS_RECORD_HEADER_LEN);
217 crypto_hash_update(hmac, payload, payload_len);
222 crypto_hash_finish(hmac, NULL, NULL);
226 if (crypto_hash_finish(hmac, pos, &clen) < 0) {
284 struct crypto_hash *hmac; local
436 hmac
[all...]
/external/wpa_supplicant_8/src/tls/
H A Dtlsv1_record.c155 struct crypto_hash *hmac; local
207 hmac = crypto_hash_init(rl->hash_alg, rl->write_mac_secret,
209 if (hmac == NULL) {
214 crypto_hash_update(hmac, rl->write_seq_num, TLS_SEQ_NUM_LEN);
216 crypto_hash_update(hmac, ct_start, TLS_RECORD_HEADER_LEN);
217 crypto_hash_update(hmac, payload, payload_len);
222 crypto_hash_finish(hmac, NULL, NULL);
226 if (crypto_hash_finish(hmac, pos, &clen) < 0) {
284 struct crypto_hash *hmac; local
436 hmac
[all...]
/external/wpa_supplicant_8/wpa_supplicant/src/tls/
H A Dtlsv1_record.c155 struct crypto_hash *hmac; local
207 hmac = crypto_hash_init(rl->hash_alg, rl->write_mac_secret,
209 if (hmac == NULL) {
214 crypto_hash_update(hmac, rl->write_seq_num, TLS_SEQ_NUM_LEN);
216 crypto_hash_update(hmac, ct_start, TLS_RECORD_HEADER_LEN);
217 crypto_hash_update(hmac, payload, payload_len);
222 crypto_hash_finish(hmac, NULL, NULL);
226 if (crypto_hash_finish(hmac, pos, &clen) < 0) {
284 struct crypto_hash *hmac; local
436 hmac
[all...]
/external/chromium/chrome/common/extensions/docs/examples/apps/hello-python/oauth2/
H A D__init__.py29 import hmac namespace
738 hashed = hmac.new(key, raw, sha)
/external/wpa_supplicant_8/hostapd/src/crypto/
H A Dcrypto_libtomcrypt.c148 hmac_state hmac; member in union:crypto_hash::__anon16486
174 if (hmac_init(&ctx->u.hmac, find_hash("md5"), key, key_len) !=
179 if (hmac_init(&ctx->u.hmac, find_hash("sha1"), key, key_len) !=
208 ctx->error = hmac_process(&ctx->u.hmac, data, len) != CRYPT_OK;
267 if (hmac_done(&ctx->u.hmac, mac, &clen) != CRYPT_OK) {
/external/wpa_supplicant_8/hostapd/src/eap_common/
H A Deap_sim_common.c168 unsigned char hmac[SHA1_MAC_LEN]; local
196 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac);
198 hmac, EAP_SIM_MAC_LEN);
201 return (os_memcmp(hmac, mac, EAP_SIM_MAC_LEN) == 0) ? 0 : 1;
208 unsigned char hmac[SHA1_MAC_LEN]; local
224 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac);
225 os_memcpy(mac, hmac, EAP_SIM_MAC_LEN);
363 unsigned char hmac[SHA256_MAC_LEN]; local
391 hmac_sha256_vector(k_aut, EAP_AKA_PRIME_K_AUT_LEN, 2, addr, len, hmac);
393 hmac, EAP_SIM_MAC_LE
403 unsigned char hmac[SHA256_MAC_LEN]; local
[all...]
/external/wpa_supplicant_8/src/crypto/
H A Dcrypto_libtomcrypt.c148 hmac_state hmac; member in union:crypto_hash::__anon16713
174 if (hmac_init(&ctx->u.hmac, find_hash("md5"), key, key_len) !=
179 if (hmac_init(&ctx->u.hmac, find_hash("sha1"), key, key_len) !=
208 ctx->error = hmac_process(&ctx->u.hmac, data, len) != CRYPT_OK;
267 if (hmac_done(&ctx->u.hmac, mac, &clen) != CRYPT_OK) {
/external/wpa_supplicant_8/src/eap_common/
H A Deap_sim_common.c168 unsigned char hmac[SHA1_MAC_LEN]; local
196 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac);
198 hmac, EAP_SIM_MAC_LEN);
201 return (os_memcmp(hmac, mac, EAP_SIM_MAC_LEN) == 0) ? 0 : 1;
208 unsigned char hmac[SHA1_MAC_LEN]; local
224 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac);
225 os_memcpy(mac, hmac, EAP_SIM_MAC_LEN);
363 unsigned char hmac[SHA256_MAC_LEN]; local
391 hmac_sha256_vector(k_aut, EAP_AKA_PRIME_K_AUT_LEN, 2, addr, len, hmac);
393 hmac, EAP_SIM_MAC_LE
403 unsigned char hmac[SHA256_MAC_LEN]; local
[all...]
/external/wpa_supplicant_8/wpa_supplicant/src/crypto/
H A Dcrypto_libtomcrypt.c148 hmac_state hmac; member in union:crypto_hash::__anon16942
174 if (hmac_init(&ctx->u.hmac, find_hash("md5"), key, key_len) !=
179 if (hmac_init(&ctx->u.hmac, find_hash("sha1"), key, key_len) !=
208 ctx->error = hmac_process(&ctx->u.hmac, data, len) != CRYPT_OK;
267 if (hmac_done(&ctx->u.hmac, mac, &clen) != CRYPT_OK) {
/external/wpa_supplicant_8/wpa_supplicant/src/eap_common/
H A Deap_sim_common.c168 unsigned char hmac[SHA1_MAC_LEN]; local
196 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac);
198 hmac, EAP_SIM_MAC_LEN);
201 return (os_memcmp(hmac, mac, EAP_SIM_MAC_LEN) == 0) ? 0 : 1;
208 unsigned char hmac[SHA1_MAC_LEN]; local
224 hmac_sha1_vector(k_aut, EAP_SIM_K_AUT_LEN, 2, addr, len, hmac);
225 os_memcpy(mac, hmac, EAP_SIM_MAC_LEN);
363 unsigned char hmac[SHA256_MAC_LEN]; local
391 hmac_sha256_vector(k_aut, EAP_AKA_PRIME_K_AUT_LEN, 2, addr, len, hmac);
393 hmac, EAP_SIM_MAC_LE
403 unsigned char hmac[SHA256_MAC_LEN]; local
[all...]
/external/chromium/chrome/common/extensions/docs/examples/apps/hello-python/httplib2/
H A D__init__.py52 import hmac namespace
558 request_digest = hmac.new(self.key, request_digest, self.hashmod).hexdigest().lower()
/external/openssl/ssl/
H A Dt1_enc.c144 #include <openssl/hmac.h>
954 EVP_MD_CTX hmac, *mac_ctx; local
983 EVP_MD_CTX_copy(&hmac,hash);
984 mac_ctx = &hmac;
1042 EVP_MD_CTX_cleanup(&hmac);
/external/openssl/apps/
H A Dspeed.c144 #include <openssl/hmac.h>
251 "md2","mdc2","md4","md5","hmac(md5)","sha1","rmd160","rc4",
387 unsigned char hmac[MD5_DIGEST_LENGTH]; local
798 if (strcmp(*argv,"hmac") == 0) doit[D_HMAC]=1;
1024 BIO_printf(bio_err,"hmac ");
1578 HMAC_Final(&hctx,&(hmac[0]),NULL);

Completed in 460 milliseconds