Skip to content

Commit

Permalink
Reducing some debug information that spams the test logs.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 207710109
GitOrigin-RevId: 1ce22610106b3616da815c80141888e886d2b4f1
  • Loading branch information
bleichen authored and chuckx committed Aug 9, 2018
1 parent cc755a3 commit 776cdd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 0 additions & 5 deletions cc/subtle/ecdsa_verify_boringssl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,8 @@ bool TestSignatures(const std::string& filename, bool allow_skipping,
std::cout << "expected version 0.2.5";
int passed_tests = 0;
int failed_tests = 0;
std::cout << "here0\n";
for (const rapidjson::Value& test_group : (*root)["testGroups"].GetArray()) {
std::cout << "here1\n";
auto verifier_result = GetVerifier(test_group, encoding);
std::cout << "here2\n";
if (!verifier_result.ok()) {
std::string curve = test_group["key"]["curve"].GetString();
if (allow_skipping) {
Expand All @@ -184,9 +181,7 @@ bool TestSignatures(const std::string& filename, bool allow_skipping,
}
continue;
}
std::cout << "here3\n";
auto verifier = std::move(verifier_result.ValueOrDie());
std::cout << "here4\n";
for (const rapidjson::Value& test : test_group["tests"].GetArray()) {
std::string expected = test["result"].GetString();
std::string msg = WycheproofUtil::GetBytes(test["msg"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,14 @@ public void testComputeSharedSecretWithWycheproofTestVectors() throws Exception
try {
X509EncodedKeySpec x509keySpec = new X509EncodedKeySpec(Hex.decode(hexPubKey));
pubKey = (ECPublicKey) kf.generatePublic(x509keySpec);
System.out.println("Wycheproof encoded public key spec: " + hexPubKey);
System.out.println(
"Android encoded public key spec: " + Hex.encode(pubKey.getEncoded()));
// Sometimes providers do not encode keys the same way.
// E.g. BouncyCastle may use long form encoding, where jdk uses a short encoding
// with named curves. This checks the encodings and logs them if they differ.
String hexReencodedKey = Hex.encode(pubKey.getEncoded());
if (!hexPubKey.equals(hexReencodedKey)) {
System.out.println("Wycheproof encoded public key spec: " + hexPubKey);
System.out.println("Reencoded public key spec: " + hexReencodedKey);
}
} catch (java.lang.RuntimeException ex) {
// Some of the test vectors contain incorrectly encoded public keys.
// Some java providers do not properly check the encoding, which often results in
Expand Down

0 comments on commit 776cdd4

Please sign in to comment.