-# $OpenBSD: Makefile.inc,v 1.11 2023/01/29 14:00:41 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.12 2023/02/16 11:13:05 jsing Exp $
# amd64-specific libcrypto build rules
SRCS += bignum_sqr_4_8_alt.S
SRCS += bignum_sqr_8_16_alt.S
SRCS += bignum_sub.S
+SRCS += word_clz.S
# camellia
SRCS+= cmll_misc.c
-/* $OpenBSD: bn_arch.c,v 1.4 2023/02/04 14:00:18 jsing Exp $ */
+/* $OpenBSD: bn_arch.c,v 1.5 2023/02/16 11:13:05 jsing Exp $ */
/*
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
*
bignum_sqr_8_16_alt((uint64_t *)rd, (uint64_t *)ad);
}
#endif
+
+#ifdef HAVE_BN_WORD_CLZ
+int
+bn_word_clz(BN_ULONG w)
+{
+ return word_clz(w);
+}
+#endif
-/* $OpenBSD: bn_arch.h,v 1.12 2023/02/16 10:41:03 jsing Exp $ */
+/* $OpenBSD: bn_arch.h,v 1.13 2023/02/16 11:13:05 jsing Exp $ */
/*
* Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
*
#define HAVE_BN_SUB
#define HAVE_BN_SUB_WORDS
+#define HAVE_BN_WORD_CLZ
+
#if defined(__GNUC__)
#define HAVE_BN_DIV_REM_WORDS_INLINE
-/* $OpenBSD: bn_local.h,v 1.9 2023/02/14 18:45:39 jsing Exp $ */
+/* $OpenBSD: bn_local.h,v 1.10 2023/02/16 11:13:05 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
const BN_ULONG *np, const BN_ULONG *n0, int num);
+int bn_word_clz(BN_ULONG w);
+
void bn_correct_top(BIGNUM *a);
int bn_expand(BIGNUM *a, int bits);
int bn_wexpand(BIGNUM *a, int words);