diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libcrypto/wycheproof/wycheproof.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index db74f0e789..546cc9ab24 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.27 2018/08/27 21:24:13 tb Exp $ */ | 1 | /* $OpenBSD: wycheproof.go,v 1.28 2018/08/27 21:27:39 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> |
| 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
| @@ -415,7 +415,7 @@ func checkAesCcm(ctx *C.EVP_CIPHER_CTX, doEncrypt int, key []byte, keyLen int, i | |||
| 415 | if (wt.Comment == "Nonce is too long" || wt.Comment == "Invalid nonce size") { | 415 | if (wt.Comment == "Nonce is too long" || wt.Comment == "Invalid nonce size") { |
| 416 | return true | 416 | return true |
| 417 | } | 417 | } |
| 418 | fmt.Printf("FAIL: Test case %d (%q) [%v]: setting IV len to %d failed. got %d, want %v\n", wt.TCID, wt.Comment, action, ivLen, ret, wt.Result) | 418 | fmt.Printf("FAIL: Test case %d (%q) [%v] - setting IV len to %d failed. got %d, want %v\n", wt.TCID, wt.Comment, action, ivLen, ret, wt.Result) |
| 419 | return false | 419 | return false |
| 420 | } | 420 | } |
| 421 | 421 | ||
| @@ -424,26 +424,26 @@ func checkAesCcm(ctx *C.EVP_CIPHER_CTX, doEncrypt int, key []byte, keyLen int, i | |||
| 424 | if (wt.Comment == "Invalid tag size") { | 424 | if (wt.Comment == "Invalid tag size") { |
| 425 | return true | 425 | return true |
| 426 | } | 426 | } |
| 427 | fmt.Printf("FAIL: Test case %d (%q) [%v]: setting tag length to %d failed. got %d, want %v\n", wt.TCID, wt.Comment, action, tagLen, ret, wt.Result) | 427 | fmt.Printf("FAIL: Test case %d (%q) [%v] - setting tag length to %d failed. got %d, want %v\n", wt.TCID, wt.Comment, action, tagLen, ret, wt.Result) |
| 428 | return false | 428 | return false |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | ret = C.EVP_CipherInit_ex(ctx, nil, nil, (*C.uchar)(unsafe.Pointer(&key[0])), (*C.uchar)(unsafe.Pointer(&iv[0])), C.int(doEncrypt)) | 431 | ret = C.EVP_CipherInit_ex(ctx, nil, nil, (*C.uchar)(unsafe.Pointer(&key[0])), (*C.uchar)(unsafe.Pointer(&iv[0])), C.int(doEncrypt)) |
| 432 | if ret != 1 { | 432 | if ret != 1 { |
| 433 | fmt.Printf("FAIL: Test case %d (%q) [%v]: setting key and IV failed. got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) | 433 | fmt.Printf("FAIL: Test case %d (%q) [%v] - setting key and IV failed. got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) |
| 434 | return false | 434 | return false |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | var cipherOutLen C.int | 437 | var cipherOutLen C.int |
| 438 | ret = C.EVP_CipherUpdate(ctx, nil, &cipherOutLen, nil, C.int(inLen)) | 438 | ret = C.EVP_CipherUpdate(ctx, nil, &cipherOutLen, nil, C.int(inLen)) |
| 439 | if ret != 1 { | 439 | if ret != 1 { |
| 440 | fmt.Printf("FAIL: Test case %d (%q) [%v]: setting input length to %d failed. got %d, want %v\n", wt.TCID, wt.Comment, action, inLen, ret, wt.Result) | 440 | fmt.Printf("FAIL: Test case %d (%q) [%v] - setting input length to %d failed. got %d, want %v\n", wt.TCID, wt.Comment, action, inLen, ret, wt.Result) |
| 441 | return false | 441 | return false |
| 442 | } | 442 | } |
| 443 | 443 | ||
| 444 | ret = C.EVP_CipherUpdate(ctx, nil, &cipherOutLen, (*C.uchar)(unsafe.Pointer(&aad[0])), C.int(aadLen)) | 444 | ret = C.EVP_CipherUpdate(ctx, nil, &cipherOutLen, (*C.uchar)(unsafe.Pointer(&aad[0])), C.int(aadLen)) |
| 445 | if ret != 1 { | 445 | if ret != 1 { |
| 446 | fmt.Printf("FAIL: Test case %d (%q) [%v]: processing AAD failed. got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) | 446 | fmt.Printf("FAIL: Test case %d (%q) [%v] - processing AAD failed. got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) |
| 447 | return false | 447 | return false |
| 448 | } | 448 | } |
| 449 | 449 | ||
| @@ -458,18 +458,18 @@ func checkAesCcm(ctx *C.EVP_CIPHER_CTX, doEncrypt int, key []byte, keyLen int, i | |||
| 458 | if wt.Result == "invalid" { | 458 | if wt.Result == "invalid" { |
| 459 | return true | 459 | return true |
| 460 | } | 460 | } |
| 461 | fmt.Printf("FAIL: Test case %d (%q) [%v]: EVP_CipherUpdate failed: got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) | 461 | fmt.Printf("FAIL: Test case %d (%q) [%v] - EVP_CipherUpdate failed: got %d, want %v\n", wt.TCID, wt.Comment, action, ret, wt.Result) |
| 462 | return false | 462 | return false |
| 463 | } | 463 | } |
| 464 | 464 | ||
| 465 | if cipherOutLen != C.int(outLen) { | 465 | if cipherOutLen != C.int(outLen) { |
| 466 | fmt.Printf("FAIL: Test case %d (%q) [%v]: cipherOutLen %d != outLen %d. Result %v\n", wt.TCID, wt.Comment, cipherOutLen, action, outLen, wt.Result) | 466 | fmt.Printf("FAIL: Test case %d (%q) [%v] - cipherOutLen %d != outLen %d. Result %v\n", wt.TCID, wt.Comment, cipherOutLen, action, outLen, wt.Result) |
| 467 | return false | 467 | return false |
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | success := true | 470 | success := true |
| 471 | if !bytes.Equal(cipherOut, out) { | 471 | if !bytes.Equal(cipherOut, out) { |
| 472 | fmt.Printf("FAIL: Test case %d (%q) [%v]: expected and computed output do not match. Result.%v\n", wt.TCID, wt.Comment, action, wt.Result) | 472 | fmt.Printf("FAIL: Test case %d (%q) [%v] - expected and computed output do not match. Result.%v\n", wt.TCID, wt.Comment, action, wt.Result) |
| 473 | success = false | 473 | success = false |
| 474 | } | 474 | } |
| 475 | return success | 475 | return success |
