X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/8276a9c565bc29afbc6cc120dfde0801c06c2bbd..2b3f6527d522b647a6c8b5039228ebe569686c38:/symm/chacha.c diff --git a/symm/chacha.c b/symm/chacha.c index 655ecd02..f70ee9fb 100644 --- a/symm/chacha.c +++ b/symm/chacha.c @@ -78,6 +78,10 @@ extern core__functype chacha_core_x86ish_sse2; extern core__functype chacha_core_arm_neon; #endif +#if CPUFAM_ARM64 +extern core__functype chacha_core_arm64; +#endif + static core__functype *pick_core(void) { #if CPUFAM_X86 || CPUFAM_AMD64 @@ -88,6 +92,10 @@ static core__functype *pick_core(void) DISPATCH_PICK_COND(chacha_core, chacha_core_arm_neon, cpu_feature_p(CPUFEAT_ARM_NEON)); #endif +#if CPUFAM_ARM64 + DISPATCH_PICK_COND(chacha_core, chacha_core_arm64, + cpu_feature_p(CPUFEAT_ARM_NEON)); +#endif DISPATCH_PICK_FALLBACK(chacha_core, simple_core); } @@ -583,7 +591,7 @@ CHACHA_VARS(DEFGCIPHER) \ const gccipher xchacha##r = { \ "xchacha" #r, chacha_keysz, \ - CHACHA_NONCESZ, gxinit_##r \ + XCHACHA_NONCESZ, gxinit_##r \ }; CHACHA_VARS(DEFGXCIPHER) @@ -747,7 +755,7 @@ static grand *grinit(const void *k, size_t ksz, const void *n, g->r.r.ops = ops; g->r.ops = myops; chacha_init(&g->ctx, k, ksz, 0); - myops->setnonce(g, n); + if (n) myops->setnonce(g, n); return (&g->r.r); }