Skip to content

Commit fb26e3d

Browse files
author
tb
committed
Move bn_blind.c to rsa_blinding.c
discussed with jsing
1 parent 41d4e0f commit fb26e3d

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

src/lib/libcrypto/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $OpenBSD: Makefile,v 1.153 2023/07/29 06:46:20 tb Exp $
1+
# $OpenBSD: Makefile,v 1.154 2023/08/09 09:23:03 tb Exp $
22

33
LIB= crypto
44
LIBREBUILD=y
@@ -168,7 +168,6 @@ SRCS+= bss_sock.c
168168

169169
# bn/
170170
SRCS+= bn_add.c
171-
SRCS+= bn_blind.c
172171
SRCS+= bn_bpsw.c
173172
SRCS+= bn_const.c
174173
SRCS+= bn_convert.c
@@ -534,6 +533,7 @@ SRCS+= ripemd.c
534533
# rsa/
535534
SRCS+= rsa_ameth.c
536535
SRCS+= rsa_asn1.c
536+
SRCS+= rsa_blinding.c
537537
SRCS+= rsa_chk.c
538538
SRCS+= rsa_crpt.c
539539
SRCS+= rsa_eay.c

src/lib/libcrypto/bn/bn_local.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: bn_local.h,v 1.37 2023/08/09 09:20:00 tb Exp $ */
1+
/* $OpenBSD: bn_local.h,v 1.38 2023/08/09 09:23:03 tb Exp $ */
22
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
33
* All rights reserved.
44
*
@@ -292,14 +292,6 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
292292
int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
293293
BN_RECP_CTX *recp, BN_CTX *ctx);
294294

295-
BN_BLINDING *BN_BLINDING_new(const BIGNUM *e, const BIGNUM *mod, BN_CTX *ctx,
296-
int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
297-
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx);
298-
void BN_BLINDING_free(BN_BLINDING *b);
299-
int BN_BLINDING_convert(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
300-
int BN_BLINDING_invert(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *);
301-
CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *);
302-
303295
/* Explicitly const time / non-const time versions for internal use */
304296
int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
305297
const BIGNUM *m, BN_CTX *ctx);

src/lib/libcrypto/bn/bn_blind.c renamed to src/lib/libcrypto/rsa/rsa_blinding.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: bn_blind.c,v 1.43 2023/08/09 09:20:00 tb Exp $ */
1+
/* $OpenBSD: rsa_blinding.c,v 1.1 2023/08/09 09:23:03 tb Exp $ */
22
/* ====================================================================
33
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
44
*
@@ -114,8 +114,10 @@
114114
#include <openssl/opensslconf.h>
115115

116116
#include <openssl/err.h>
117+
#include <openssl/rsa.h>
117118

118119
#include "bn_local.h"
120+
#include "rsa_local.h"
119121

120122
#define BN_BLINDING_COUNTER 32
121123

src/lib/libcrypto/rsa/rsa_local.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: rsa_local.h,v 1.4 2023/07/28 10:05:16 tb Exp $ */
1+
/* $OpenBSD: rsa_local.h,v 1.5 2023/08/09 09:23:03 tb Exp $ */
22
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
33
* All rights reserved.
44
*
@@ -153,6 +153,13 @@ int RSA_padding_check_X931(unsigned char *to, int tlen,
153153
const unsigned char *f, int fl, int rsa_len);
154154
int RSA_X931_hash_id(int nid);
155155

156+
BN_BLINDING *BN_BLINDING_new(const BIGNUM *e, const BIGNUM *mod, BN_CTX *ctx,
157+
int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
158+
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx);
159+
void BN_BLINDING_free(BN_BLINDING *b);
160+
int BN_BLINDING_convert(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
161+
int BN_BLINDING_invert(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *);
162+
CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *);
156163
BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
157164

158165
__END_HIDDEN_DECLS

0 commit comments

Comments
 (0)