diff options
author | jsing <> | 2023-01-31 05:12:16 +0000 |
---|---|---|
committer | jsing <> | 2023-01-31 05:12:16 +0000 |
commit | 405b59803d1d0002d3b6452ed4f3a54ab668b455 (patch) | |
tree | 6df62776c36b8ef0b4c02307de30b7ee66ce0f8a /src | |
parent | f7829cff7573b8215cb2be2502e62624d5fa1210 (diff) | |
download | openbsd-405b59803d1d0002d3b6452ed4f3a54ab668b455.tar.gz openbsd-405b59803d1d0002d3b6452ed4f3a54ab668b455.tar.bz2 openbsd-405b59803d1d0002d3b6452ed4f3a54ab668b455.zip |
Add more regress tests for BN_usub().
This adds more tests for BN_usub(), particularly where b > a, which should
be an error condition. One of these currently succeeds and produces
incorrect results.
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_add_sub.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_add_sub.c b/src/regress/lib/libcrypto/bn/bn_add_sub.c index 13af33fe9a..2901dcbc85 100644 --- a/src/regress/lib/libcrypto/bn/bn_add_sub.c +++ b/src/regress/lib/libcrypto/bn/bn_add_sub.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_add_sub.c,v 1.2 2022/12/02 00:01:06 tb Exp $ */ | 1 | /* $OpenBSD: bn_add_sub.c,v 1.3 2023/01/31 05:12:16 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
@@ -130,6 +130,13 @@ struct hexinput_st test_bn_usub[] = { | |||
130 | 1, | 130 | 1, |
131 | }, | 131 | }, |
132 | { | 132 | { |
133 | "11100000001", | ||
134 | "100000000001000000000", | ||
135 | "0", | ||
136 | 0, | ||
137 | 0, | ||
138 | }, | ||
139 | { | ||
133 | "100000000000000000000", | 140 | "100000000000000000000", |
134 | "1", | 141 | "1", |
135 | "FFFFFFFFFFFFFFFFFFFF", | 142 | "FFFFFFFFFFFFFFFFFFFF", |
@@ -137,6 +144,20 @@ struct hexinput_st test_bn_usub[] = { | |||
137 | 1, | 144 | 1, |
138 | }, | 145 | }, |
139 | { | 146 | { |
147 | "1", | ||
148 | "0", | ||
149 | "1", | ||
150 | 1, | ||
151 | 1, | ||
152 | }, | ||
153 | { | ||
154 | "1", | ||
155 | "2", | ||
156 | "FFFFFFFFFFFFFFFF", | ||
157 | 0, | ||
158 | 0, | ||
159 | }, | ||
160 | { | ||
140 | "0", | 161 | "0", |
141 | "1", | 162 | "1", |
142 | "0", | 163 | "0", |