diff options
| author | tb <> | 2025-09-04 17:06:34 +0000 |
|---|---|---|
| committer | tb <> | 2025-09-04 17:06:34 +0000 |
| commit | f104885e31deb73cf35b5eb22042896db334a317 (patch) | |
| tree | da15e8f8532e4b6ea99434779933d93cf337a092 /src | |
| parent | 65997edaf165db49df38c6436fa8336e7df7558b (diff) | |
| download | openbsd-f104885e31deb73cf35b5eb22042896db334a317.tar.gz openbsd-f104885e31deb73cf35b5eb22042896db334a317.tar.bz2 openbsd-f104885e31deb73cf35b5eb22042896db334a317.zip | |
wycheproof: go fmt
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libcrypto/wycheproof/wycheproof.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index ecb3a3ba1a..4326f0f6f5 100644 --- a/src/regress/lib/libcrypto/wycheproof/wycheproof.go +++ b/src/regress/lib/libcrypto/wycheproof/wycheproof.go | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: wycheproof.go,v 1.171 2025/09/04 17:03:38 tb Exp $ */ | 1 | /* $OpenBSD: wycheproof.go,v 1.172 2025/09/04 17:06:34 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2018,2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018,2023 Joel Sing <jsing@openbsd.org> |
| 4 | * Copyright (c) 2018,2019,2022-2024 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018,2019,2022-2024 Theo Buehler <tb@openbsd.org> |
| @@ -1282,7 +1282,7 @@ func runEvpChaCha20Poly1305Test(ctx *C.EVP_CIPHER_CTX, algorithm string, wt *wyc | |||
| 1282 | log.Fatal("Failed EVP_EncryptUpdate aad") | 1282 | log.Fatal("Failed EVP_EncryptUpdate aad") |
| 1283 | } | 1283 | } |
| 1284 | 1284 | ||
| 1285 | sealed := make([]byte, ctLen + tagLen) | 1285 | sealed := make([]byte, ctLen+tagLen) |
| 1286 | copy(sealed, msg) | 1286 | copy(sealed, msg) |
| 1287 | if C.EVP_EncryptUpdate(ctx, (*C.uchar)(unsafe.Pointer(&sealed[0])), (*C.int)(unsafe.Pointer(&len)), (*C.uchar)(unsafe.Pointer(&sealed[0])), (C.int)(msgLen)) != 1 { | 1287 | if C.EVP_EncryptUpdate(ctx, (*C.uchar)(unsafe.Pointer(&sealed[0])), (*C.int)(unsafe.Pointer(&len)), (*C.uchar)(unsafe.Pointer(&sealed[0])), (C.int)(msgLen)) != 1 { |
| 1288 | log.Fatal("Failed EVP_EncryptUpdate msg") | 1288 | log.Fatal("Failed EVP_EncryptUpdate msg") |
| @@ -1297,7 +1297,7 @@ func runEvpChaCha20Poly1305Test(ctx *C.EVP_CIPHER_CTX, algorithm string, wt *wyc | |||
| 1297 | } | 1297 | } |
| 1298 | outLen += (C.int)(tagLen) | 1298 | outLen += (C.int)(tagLen) |
| 1299 | 1299 | ||
| 1300 | if (C.int)(ctLen + tagLen) != outLen { | 1300 | if (C.int)(ctLen+tagLen) != outLen { |
| 1301 | fmt.Printf("%s\n", wt) | 1301 | fmt.Printf("%s\n", wt) |
| 1302 | } | 1302 | } |
| 1303 | 1303 | ||
| @@ -1306,7 +1306,7 @@ func runEvpChaCha20Poly1305Test(ctx *C.EVP_CIPHER_CTX, algorithm string, wt *wyc | |||
| 1306 | tagMatch := bytes.Equal(tag, sealed[ctLen:]) | 1306 | tagMatch := bytes.Equal(tag, sealed[ctLen:]) |
| 1307 | if (ctMatch && tagMatch) == (wt.Result != "invalid") { | 1307 | if (ctMatch && tagMatch) == (wt.Result != "invalid") { |
| 1308 | sealSuccess = true | 1308 | sealSuccess = true |
| 1309 | } else { | 1309 | } else { |
| 1310 | fmt.Printf("%s - ct match: %t tag match: %t\n", wt, ctMatch, tagMatch) | 1310 | fmt.Printf("%s - ct match: %t tag match: %t\n", wt, ctMatch, tagMatch) |
| 1311 | } | 1311 | } |
| 1312 | 1312 | ||
| @@ -1332,9 +1332,9 @@ func runEvpChaCha20Poly1305Test(ctx *C.EVP_CIPHER_CTX, algorithm string, wt *wyc | |||
| 1332 | ct = append(ct, 0) | 1332 | ct = append(ct, 0) |
| 1333 | } | 1333 | } |
| 1334 | 1334 | ||
| 1335 | opened := make([]byte, msgLen + tagLen) | 1335 | opened := make([]byte, msgLen+tagLen) |
| 1336 | copy(opened, ct) | 1336 | copy(opened, ct) |
| 1337 | if msgLen + aadLen == 0 { | 1337 | if msgLen+aadLen == 0 { |
| 1338 | opened = append(opened, 0) | 1338 | opened = append(opened, 0) |
| 1339 | } | 1339 | } |
| 1340 | 1340 | ||
