Update TortoiseGitPlink to PuTTY Plink 0.78
[TortoiseGit.git] / src / TortoisePlink / crypto / aesgcm-select.c
blobeed352a4e0654d9a9c38b911136bc74a3a40fffc
1 #include "ssh.h"
2 #include "aesgcm.h"
4 static ssh2_mac *aesgcm_mac_selector_new(const ssh2_macalg *alg,
5 ssh_cipher *cipher)
7 static const ssh2_macalg *const real_algs[] = {
8 #if HAVE_CLMUL
9 &ssh2_aesgcm_mac_clmul,
10 #endif
11 #if HAVE_NEON_PMULL
12 &ssh2_aesgcm_mac_neon,
13 #endif
14 &ssh2_aesgcm_mac_sw,
15 NULL,
18 for (size_t i = 0; real_algs[i]; i++) {
19 const ssh2_macalg *alg = real_algs[i];
20 const struct aesgcm_extra *alg_extra =
21 (const struct aesgcm_extra *)alg->extra;
22 if (check_aesgcm_availability(alg_extra))
23 return ssh2_mac_new(alg, cipher);
26 /* We should never reach the NULL at the end of the list, because
27 * the last non-NULL entry should be software-only GCM, which is
28 * always available. */
29 unreachable("aesgcm_select ran off the end of its list");
32 const ssh2_macalg ssh2_aesgcm_mac = {
33 .new = aesgcm_mac_selector_new,
34 .name = "",
35 .etm_name = "", /* Not selectable independently */
36 .len = 16,
37 .keylen = 0,