• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/libgcrypt-1.5.0/cipher/

Lines Matching refs:algo

154 static const char * digest_algo_to_string( int algo );
155 static gcry_err_code_t check_digest_algo (int algo);
156 static gcry_err_code_t md_open (gcry_md_hd_t *h, int algo,
158 static gcry_err_code_t md_enable (gcry_md_hd_t hd, int algo);
163 static byte *md_read( gcry_md_hd_t a, int algo );
165 static int md_digest_length( int algo );
166 static const byte *md_asn_oid( int algo, size_t *asnlen, size_t *mdlen );
331 * Map a string to the digest algo
368 * Map a digest algo to a string
392 * string when there is no algo. It will never return NULL.
431 md_open (gcry_md_hd_t *h, int algo, int secure, int hmac)
481 switch (algo)
505 if (algo)
507 err = md_enable (hd, algo);
525 gcry_md_open (gcry_md_hd_t *h, int algo, unsigned int flags)
534 err = md_open (&hd, algo, (flags & GCRY_MD_FLAG_SECURE),
833 int algo = md_get_algo (a);
834 byte *p = md_read (a, algo);
835 size_t dlen = md_digest_length (algo);
837 gcry_err_code_t err = md_open (&om, algo, a->ctx->secure, 0);
847 memcpy (p, md_read (om, algo), dlen);
856 int algo = md_get_algo (hd);
860 if (!algo)
861 return GPG_ERR_DIGEST_ALGO; /* Might happen if no algo is enabled. */
865 helpkey = gcry_malloc_secure (md_digest_length (algo));
868 gcry_md_hash_buffer (algo, helpkey, key, keylen);
870 keylen = md_digest_length (algo);
946 * if ALGO is null get the digest for the used algo (which should be only one)
949 md_read( gcry_md_hd_t a, int algo )
953 if (! algo)
966 if (r->module->mod_id == algo)
978 gcry_md_read (gcry_md_hd_t hd, int algo)
984 return md_read (hd, algo);
992 gcry_md_get (gcry_md_hd_t hd, int algo, byte *buffer, int buflen)
995 (void)algo;
1006 * Shortcut function to hash a buffer with a given algo. The only
1010 * algo. DISABLED_ALGOS are ignored here. */
1012 gcry_md_hash_buffer (int algo, void *digest,
1015 if (algo == GCRY_MD_SHA1)
1017 else if (algo == GCRY_MD_RMD160 && !fips_mode () )
1026 if (algo == GCRY_MD_MD5 && fips_mode ())
1037 err = md_open (&h, algo, 0, 0);
1039 log_bug ("gcry_md_open failed for algo %d: %s",
1040 algo, gpg_strerror (gcry_error(err)));
1043 memcpy (digest, md_read (h, algo), md_digest_length (algo));
1124 log_bug ("no ASN.1 OID for md algo %d\n", algorithm);
1149 gcry_md_algo_info (int algo, int what, void *buffer, size_t *nbytes)
1159 err = check_digest_algo (algo);
1163 /* We need to check that the algo is available because
1165 err = check_digest_algo (algo);
1171 asn = md_asn_oid (algo, &asnlen, NULL);
1248 * Returns 1 if the algo is enabled for that handle.
1249 * The algo must be passed as the address of an int.
1265 int algo;
1271 algo = *(int*)buffer;
1275 if (r->module->mod_id == algo)
1318 gcry_md_is_enabled (gcry_md_hd_t a, int algo)
1322 value = sizeof algo;
1323 if (gcry_md_info (a, GCRYCTL_IS_ALGO_ENABLED, &algo, &value))
1351 _gcry_md_selftest (int algo, int extended, selftest_report_func_t report)
1360 module = _gcry_module_lookup_id (digests_registered, algo);
1365 ec = extraspec->selftest (algo, extended, report);
1370 report ("digest", algo, "module",