Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-11-12 01:01:27 +0300
committerAdam Langley <agl@google.com>2015-11-12 01:19:36 +0300
commitef14b2d86e4ce24d7adc2d7948b5372bc3b62c33 (patch)
tree3dc8352c02389149258e3734d6a1a3655840b38e /crypto/hmac
parentcd24a39f1b3644da333bfcb43865ab7a6587c5cc (diff)
Remove stl_compat.h.
Chromium's toolchains may now assume C++11 library support, so we may freely use C++11 features. (Chromium's still in the process of deciding what to allow, but we use Google's style guide directly, toolchain limitations aside.) Change-Id: I1c7feb92b7f5f51d9091a4c686649fb574ac138d Reviewed-on: https://boringssl-review.googlesource.com/6465 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/hmac')
-rw-r--r--crypto/hmac/hmac_test.cc25
1 files changed, 9 insertions, 16 deletions
diff --git a/crypto/hmac/hmac_test.cc b/crypto/hmac/hmac_test.cc
index d438b702..da390ef8 100644
--- a/crypto/hmac/hmac_test.cc
+++ b/crypto/hmac/hmac_test.cc
@@ -66,7 +66,6 @@
#include "../test/file_test.h"
#include "../test/scoped_types.h"
-#include "../test/stl_compat.h"
static const EVP_MD *GetDigest(const std::string &name) {
@@ -107,33 +106,28 @@ static bool TestHMAC(FileTest *t, void *arg) {
// Test using the one-shot API.
uint8_t mac[EVP_MAX_MD_SIZE];
unsigned mac_len;
- if (nullptr == HMAC(digest, bssl::vector_data(&key), key.size(),
- bssl::vector_data(&input), input.size(), mac,
- &mac_len) ||
- !t->ExpectBytesEqual(bssl::vector_data(&output), output.size(), mac,
- mac_len)) {
+ if (nullptr == HMAC(digest, key.data(), key.size(), input.data(),
+ input.size(), mac, &mac_len) ||
+ !t->ExpectBytesEqual(output.data(), output.size(), mac, mac_len)) {
t->PrintLine("One-shot API failed.");
return false;
}
// Test using HMAC_CTX.
ScopedHMAC_CTX ctx;
- if (!HMAC_Init_ex(ctx.get(), bssl::vector_data(&key), key.size(), digest,
- nullptr) ||
- !HMAC_Update(ctx.get(), bssl::vector_data(&input), input.size()) ||
+ if (!HMAC_Init_ex(ctx.get(), key.data(), key.size(), digest, nullptr) ||
+ !HMAC_Update(ctx.get(), input.data(), input.size()) ||
!HMAC_Final(ctx.get(), mac, &mac_len) ||
- !t->ExpectBytesEqual(bssl::vector_data(&output), output.size(), mac,
- mac_len)) {
+ !t->ExpectBytesEqual(output.data(), output.size(), mac, mac_len)) {
t->PrintLine("HMAC_CTX failed.");
return false;
}
// Test that an HMAC_CTX may be reset with the same key.
if (!HMAC_Init_ex(ctx.get(), nullptr, 0, digest, nullptr) ||
- !HMAC_Update(ctx.get(), bssl::vector_data(&input), input.size()) ||
+ !HMAC_Update(ctx.get(), input.data(), input.size()) ||
!HMAC_Final(ctx.get(), mac, &mac_len) ||
- !t->ExpectBytesEqual(bssl::vector_data(&output), output.size(), mac,
- mac_len)) {
+ !t->ExpectBytesEqual(output.data(), output.size(), mac, mac_len)) {
t->PrintLine("HMAC_CTX with reset failed.");
return false;
}
@@ -150,8 +144,7 @@ static bool TestHMAC(FileTest *t, void *arg) {
}
}
if (!HMAC_Final(ctx.get(), mac, &mac_len) ||
- !t->ExpectBytesEqual(bssl::vector_data(&output), output.size(), mac,
- mac_len)) {
+ !t->ExpectBytesEqual(output.data(), output.size(), mac, mac_len)) {
t->PrintLine("HMAC_CTX streaming failed.");
return false;
}