-/* $OpenBSD: bn_mod_sqrt.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */
+/* $OpenBSD: bn_mod_sqrt.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdio.h>
+
#include <openssl/bn.h>
/* Test that sqrt * sqrt = A (mod p) where p is a prime */
-/* $OpenBSD: bn_mont.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */
+/* $OpenBSD: bn_mont.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
/*
* Copyright (c) 2014 Miodrag Vallat.
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <err.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <err.h>
#include <openssl/bn.h>
#include <openssl/crypto.h>
-/* $OpenBSD: bn_primes.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */
+/* $OpenBSD: bn_primes.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
#include <openssl/bn.h>
#include "bn_prime.h"
-/* $OpenBSD: bn_test.c,v 1.1 2022/12/01 20:50:10 tb Exp $ */
+/* $OpenBSD: bn_test.c,v 1.2 2022/12/06 18:23:29 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/bio.h>
#include <openssl/bn.h>
-#include <openssl/x509.h>
#include <openssl/err.h>
-int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx);
-int BN_mod_exp_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx);
-int BN_mod_exp_mont_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
-int BN_mod_exp_mont_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
- const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
-
-int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);
+#include "bn_local.h"
const int num0 = 100; /* number of tests */
const int num1 = 50; /* additional tests for some functions */