summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn')
-rw-r--r--src/lib/libcrypto/bn/bn_add.c6
-rw-r--r--src/lib/libcrypto/bn/bn_asm.c3
-rw-r--r--src/lib/libcrypto/bn/bn_blind.c5
-rw-r--r--src/lib/libcrypto/bn/bn_ctx.c5
-rw-r--r--src/lib/libcrypto/bn/bn_depr.c6
-rw-r--r--src/lib/libcrypto/bn/bn_div.c7
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c5
-rw-r--r--src/lib/libcrypto/bn/bn_exp2.c6
-rw-r--r--src/lib/libcrypto/bn/bn_gcd.c5
-rw-r--r--src/lib/libcrypto/bn/bn_gf2m.c5
-rw-r--r--src/lib/libcrypto/bn/bn_kron.c3
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c5
-rw-r--r--src/lib/libcrypto/bn/bn_mod.c5
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c3
-rw-r--r--src/lib/libcrypto/bn/bn_mpi.c6
-rw-r--r--src/lib/libcrypto/bn/bn_mul.c3
-rw-r--r--src/lib/libcrypto/bn/bn_nist.c7
-rw-r--r--src/lib/libcrypto/bn/bn_prime.c7
-rw-r--r--src/lib/libcrypto/bn/bn_print.c5
-rw-r--r--src/lib/libcrypto/bn/bn_rand.c8
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c6
-rw-r--r--src/lib/libcrypto/bn/bn_shift.c3
-rw-r--r--src/lib/libcrypto/bn/bn_sqr.c3
-rw-r--r--src/lib/libcrypto/bn/bn_sqrt.c6
-rw-r--r--src/lib/libcrypto/bn/bn_word.c4
25 files changed, 70 insertions, 57 deletions
diff --git a/src/lib/libcrypto/bn/bn_add.c b/src/lib/libcrypto/bn/bn_add.c
index d551741ed8..5b2e2495b8 100644
--- a/src/lib/libcrypto/bn/bn_add.c
+++ b/src/lib/libcrypto/bn/bn_add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_add.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_add.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63/* r can == a or b */ 65/* r can == a or b */
diff --git a/src/lib/libcrypto/bn/bn_asm.c b/src/lib/libcrypto/bn/bn_asm.c
index 01e03cc81f..c6efd2513a 100644
--- a/src/lib/libcrypto/bn/bn_asm.c
+++ b/src/lib/libcrypto/bn/bn_asm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_asm.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_asm.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -66,7 +66,6 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h"
70#include "bn_lcl.h" 69#include "bn_lcl.h"
71 70
72#if defined(BN_LLONG) || defined(BN_UMULT_HIGH) 71#if defined(BN_LLONG) || defined(BN_UMULT_HIGH)
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c
index 2170181aae..5f559da067 100644
--- a/src/lib/libcrypto/bn/bn_blind.c
+++ b/src/lib/libcrypto/bn/bn_blind.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_blind.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_blind.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -113,7 +113,8 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h" 116#include <openssl/err.h>
117
117#include "bn_lcl.h" 118#include "bn_lcl.h"
118 119
119#define BN_BLINDING_COUNTER 32 120#define BN_BLINDING_COUNTER 32
diff --git a/src/lib/libcrypto/bn/bn_ctx.c b/src/lib/libcrypto/bn/bn_ctx.c
index d3384a0385..0bd523c2d4 100644
--- a/src/lib/libcrypto/bn/bn_ctx.c
+++ b/src/lib/libcrypto/bn/bn_ctx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_ctx.c,v 1.12 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_ctx.c,v 1.13 2014/07/11 08:44:47 jsing Exp $ */
2/* Written by Ulf Moeller for the OpenSSL project. */ 2/* Written by Ulf Moeller for the OpenSSL project. */
3/* ==================================================================== 3/* ====================================================================
4 * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. 4 * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved.
@@ -66,7 +66,8 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#include "cryptlib.h" 69#include <openssl/err.h>
70
70#include "bn_lcl.h" 71#include "bn_lcl.h"
71 72
72/* TODO list 73/* TODO list
diff --git a/src/lib/libcrypto/bn/bn_depr.c b/src/lib/libcrypto/bn/bn_depr.c
index 93af852aa5..68f8f822e3 100644
--- a/src/lib/libcrypto/bn/bn_depr.c
+++ b/src/lib/libcrypto/bn/bn_depr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_depr.c,v 1.5 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_depr.c,v 1.6 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -61,10 +61,10 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include "bn_lcl.h"
66#include <openssl/rand.h> 64#include <openssl/rand.h>
67 65
66#include "bn_lcl.h"
67
68#ifndef OPENSSL_NO_DEPRECATED 68#ifndef OPENSSL_NO_DEPRECATED
69BIGNUM * 69BIGNUM *
70BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add, 70BN_generate_prime(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c
index 40a3c1551d..f4deccf77f 100644
--- a/src/lib/libcrypto/bn/bn_div.c
+++ b/src/lib/libcrypto/bn/bn_div.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_div.c,v 1.21 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_div.c,v 1.22 2014/07/11 08:44:47 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,11 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/bn.h>
61 60
62#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
63 62
64#include "cryptlib.h" 63#include <openssl/bn.h>
64#include <openssl/err.h>
65
65#include "bn_lcl.h" 66#include "bn_lcl.h"
66 67
67#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \ 68#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index d88f8b2a82..09e32396fb 100644
--- a/src/lib/libcrypto/bn/bn_exp.c
+++ b/src/lib/libcrypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.18 2014/07/11 08:44:47 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -112,7 +112,8 @@
112#include <stdlib.h> 112#include <stdlib.h>
113#include <string.h> 113#include <string.h>
114 114
115#include "cryptlib.h" 115#include <openssl/err.h>
116
116#include "bn_lcl.h" 117#include "bn_lcl.h"
117 118
118/* maximum precomputation table size for *variable* sliding windows */ 119/* maximum precomputation table size for *variable* sliding windows */
diff --git a/src/lib/libcrypto/bn/bn_exp2.c b/src/lib/libcrypto/bn/bn_exp2.c
index c9cced8128..c8f0294f7a 100644
--- a/src/lib/libcrypto/bn/bn_exp2.c
+++ b/src/lib/libcrypto/bn/bn_exp2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp2.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_exp2.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -110,7 +110,9 @@
110 */ 110 */
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include "cryptlib.h" 113
114#include <openssl/err.h>
115
114#include "bn_lcl.h" 116#include "bn_lcl.h"
115 117
116#define TABLE_SIZE 32 118#define TABLE_SIZE 32
diff --git a/src/lib/libcrypto/bn/bn_gcd.c b/src/lib/libcrypto/bn/bn_gcd.c
index 8728f4f921..379bea99ad 100644
--- a/src/lib/libcrypto/bn/bn_gcd.c
+++ b/src/lib/libcrypto/bn/bn_gcd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_gcd.c,v 1.8 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_gcd.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -109,7 +109,8 @@
109 * 109 *
110 */ 110 */
111 111
112#include "cryptlib.h" 112#include <openssl/err.h>
113
113#include "bn_lcl.h" 114#include "bn_lcl.h"
114 115
115static BIGNUM *euclid(BIGNUM *a, BIGNUM *b); 116static BIGNUM *euclid(BIGNUM *a, BIGNUM *b);
diff --git a/src/lib/libcrypto/bn/bn_gf2m.c b/src/lib/libcrypto/bn/bn_gf2m.c
index 09d4bcc544..d87f80d577 100644
--- a/src/lib/libcrypto/bn/bn_gf2m.c
+++ b/src/lib/libcrypto/bn/bn_gf2m.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_gf2m.c,v 1.14 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_gf2m.c,v 1.15 2014/07/11 08:44:47 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -94,7 +94,8 @@
94 94
95#include <openssl/opensslconf.h> 95#include <openssl/opensslconf.h>
96 96
97#include "cryptlib.h" 97#include <openssl/err.h>
98
98#include "bn_lcl.h" 99#include "bn_lcl.h"
99 100
100#ifndef OPENSSL_NO_EC2M 101#ifndef OPENSSL_NO_EC2M
diff --git a/src/lib/libcrypto/bn/bn_kron.c b/src/lib/libcrypto/bn/bn_kron.c
index 632a018a70..699cda55f0 100644
--- a/src/lib/libcrypto/bn/bn_kron.c
+++ b/src/lib/libcrypto/bn/bn_kron.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_kron.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_kron.c,v 1.5 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -53,7 +53,6 @@
53 * 53 *
54 */ 54 */
55 55
56#include "cryptlib.h"
57#include "bn_lcl.h" 56#include "bn_lcl.h"
58 57
59/* least significant word */ 58/* least significant word */
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 747cbb68a5..4ee9b2bbde 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.31 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.32 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -68,7 +68,8 @@
68 68
69#include <openssl/opensslconf.h> 69#include <openssl/opensslconf.h>
70 70
71#include "cryptlib.h" 71#include <openssl/err.h>
72
72#include "bn_lcl.h" 73#include "bn_lcl.h"
73 74
74/* This stuff appears to be completely unused, so is deprecated */ 75/* This stuff appears to be completely unused, so is deprecated */
diff --git a/src/lib/libcrypto/bn/bn_mod.c b/src/lib/libcrypto/bn/bn_mod.c
index 9bd1f1ca1d..a503ff3b1b 100644
--- a/src/lib/libcrypto/bn/bn_mod.c
+++ b/src/lib/libcrypto/bn/bn_mod.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mod.c,v 1.7 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_mod.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. */ 3 * for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -111,7 +111,8 @@
111 * [including the GNU Public Licence.] 111 * [including the GNU Public Licence.]
112 */ 112 */
113 113
114#include "cryptlib.h" 114#include <openssl/err.h>
115
115#include "bn_lcl.h" 116#include "bn_lcl.h"
116 117
117int 118int
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 32d9e3836a..5803ca493d 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mont.c,v 1.22 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_mont.c,v 1.23 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -119,7 +119,6 @@
119#include <stdio.h> 119#include <stdio.h>
120#include <stdint.h> 120#include <stdint.h>
121 121
122#include "cryptlib.h"
123#include "bn_lcl.h" 122#include "bn_lcl.h"
124 123
125#define MONT_WORD /* use the faster word-based algorithm */ 124#define MONT_WORD /* use the faster word-based algorithm */
diff --git a/src/lib/libcrypto/bn/bn_mpi.c b/src/lib/libcrypto/bn/bn_mpi.c
index a0824112a1..cf4c7d8d24 100644
--- a/src/lib/libcrypto/bn/bn_mpi.c
+++ b/src/lib/libcrypto/bn/bn_mpi.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mpi.c,v 1.6 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_mpi.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63int 65int
diff --git a/src/lib/libcrypto/bn/bn_mul.c b/src/lib/libcrypto/bn/bn_mul.c
index 71bfe2d9ec..daba02d6ca 100644
--- a/src/lib/libcrypto/bn/bn_mul.c
+++ b/src/lib/libcrypto/bn/bn_mul.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_mul.c,v 1.18 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_mul.c,v 1.19 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -67,7 +67,6 @@
67 67
68#include <openssl/opensslconf.h> 68#include <openssl/opensslconf.h>
69 69
70#include "cryptlib.h"
71#include "bn_lcl.h" 70#include "bn_lcl.h"
72 71
73#if defined(OPENSSL_NO_ASM) || !defined(OPENSSL_BN_ASM_PART_WORDS) 72#if defined(OPENSSL_NO_ASM) || !defined(OPENSSL_BN_ASM_PART_WORDS)
diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c
index dd47ffb8be..53ed559c06 100644
--- a/src/lib/libcrypto/bn/bn_nist.c
+++ b/src/lib/libcrypto/bn/bn_nist.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_nist.c,v 1.13 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_nist.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -56,12 +56,11 @@
56 * 56 *
57 */ 57 */
58 58
59#include <machine/endian.h>
60
59#include <stdint.h> 61#include <stdint.h>
60 62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62#include "cryptlib.h"
63
64#include <machine/endian.h>
65 64
66#define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2 65#define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2
67#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2 66#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
diff --git a/src/lib/libcrypto/bn/bn_prime.c b/src/lib/libcrypto/bn/bn_prime.c
index 78c3fcd74f..db786a63ef 100644
--- a/src/lib/libcrypto/bn/bn_prime.c
+++ b/src/lib/libcrypto/bn/bn_prime.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_prime.c,v 1.9 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_prime.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -111,10 +111,11 @@
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include <time.h> 113#include <time.h>
114#include "cryptlib.h" 114
115#include "bn_lcl.h"
116#include <openssl/rand.h> 115#include <openssl/rand.h>
117 116
117#include "bn_lcl.h"
118
118/* NB: these functions have been "upgraded", the deprecated versions (which are 119/* NB: these functions have been "upgraded", the deprecated versions (which are
119 * compatibility wrappers using these functions) are in bn_depr.c. 120 * compatibility wrappers using these functions) are in bn_depr.c.
120 * - Geoff 121 * - Geoff
diff --git a/src/lib/libcrypto/bn/bn_print.c b/src/lib/libcrypto/bn/bn_print.c
index db51887fbe..ccdae5ae09 100644
--- a/src/lib/libcrypto/bn/bn_print.c
+++ b/src/lib/libcrypto/bn/bn_print.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_print.c,v 1.21 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: bn_print.c,v 1.22 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -61,9 +61,10 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include <openssl/bio.h>
64#include <openssl/buffer.h> 65#include <openssl/buffer.h>
66#include <openssl/err.h>
65 67
66#include "cryptlib.h"
67#include "bn_lcl.h" 68#include "bn_lcl.h"
68 69
69static const char Hex[]="0123456789ABCDEF"; 70static const char Hex[]="0123456789ABCDEF";
diff --git a/src/lib/libcrypto/bn/bn_rand.c b/src/lib/libcrypto/bn/bn_rand.c
index cbb1984a2e..acb17882ef 100644
--- a/src/lib/libcrypto/bn/bn_rand.c
+++ b/src/lib/libcrypto/bn/bn_rand.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_rand.c,v 1.14 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_rand.c,v 1.15 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -111,10 +111,12 @@
111 111
112#include <stdio.h> 112#include <stdio.h>
113#include <time.h> 113#include <time.h>
114#include "cryptlib.h" 114
115#include "bn_lcl.h" 115#include <openssl/err.h>
116#include <openssl/rand.h> 116#include <openssl/rand.h>
117 117
118#include "bn_lcl.h"
119
118static int 120static int
119bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) 121bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
120{ 122{
diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c
index 50dd65dd38..b90c5421f1 100644
--- a/src/lib/libcrypto/bn/bn_recp.c
+++ b/src/lib/libcrypto/bn/bn_recp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_recp.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_recp.c,v 1.11 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,9 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
62
61#include "bn_lcl.h" 63#include "bn_lcl.h"
62 64
63void 65void
diff --git a/src/lib/libcrypto/bn/bn_shift.c b/src/lib/libcrypto/bn/bn_shift.c
index 70bb92cd81..771ddff7b0 100644
--- a/src/lib/libcrypto/bn/bn_shift.c
+++ b/src/lib/libcrypto/bn/bn_shift.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_shift.c,v 1.11 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_shift.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -59,7 +59,6 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include "bn_lcl.h" 62#include "bn_lcl.h"
64 63
65int 64int
diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c
index 7c54082085..d4a9f46040 100644
--- a/src/lib/libcrypto/bn/bn_sqr.c
+++ b/src/lib/libcrypto/bn/bn_sqr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqr.c,v 1.9 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bn_sqr.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -59,7 +59,6 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include "bn_lcl.h" 62#include "bn_lcl.h"
64 63
65/* r must not be a */ 64/* r must not be a */
diff --git a/src/lib/libcrypto/bn/bn_sqrt.c b/src/lib/libcrypto/bn/bn_sqrt.c
index 4bb84edce1..9a59d56b3f 100644
--- a/src/lib/libcrypto/bn/bn_sqrt.c
+++ b/src/lib/libcrypto/bn/bn_sqrt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_sqrt.c,v 1.4 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_sqrt.c,v 1.5 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * and Bodo Moeller for the OpenSSL project. */ 3 * and Bodo Moeller for the OpenSSL project. */
4/* ==================================================================== 4/* ====================================================================
@@ -55,9 +55,9 @@
55 * 55 *
56 */ 56 */
57 57
58#include "cryptlib.h" 58#include <openssl/err.h>
59#include "bn_lcl.h"
60 59
60#include "bn_lcl.h"
61 61
62BIGNUM * 62BIGNUM *
63BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 63BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
diff --git a/src/lib/libcrypto/bn/bn_word.c b/src/lib/libcrypto/bn/bn_word.c
index 8f50d6d573..c4c6754c37 100644
--- a/src/lib/libcrypto/bn/bn_word.c
+++ b/src/lib/libcrypto/bn/bn_word.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_word.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: bn_word.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include "bn_lcl.h" 61#include "bn_lcl.h"
62 62
63BN_ULONG 63BN_ULONG