4 static ssh2_mac
*aesgcm_mac_selector_new(const ssh2_macalg
*alg
,
7 static const ssh2_macalg
*const real_algs
[] = {
9 &ssh2_aesgcm_mac_clmul
,
12 &ssh2_aesgcm_mac_neon
,
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
,
35 .etm_name
= "", /* Not selectable independently */