4243444546474849505152
String resStr; // // test 1 // digest.doFinal(resBuf, 0); resStr = new String(Hex.encode(resBuf)); if (!resVec1.equals(resStr)) { return new SimpleTestResult(false,
6263646566676869707172
// byte[] bytes = Hex.decode(testVec2); digest.update(bytes, 0, bytes.length); digest.doFinal(resBuf, 0); resStr = new String(Hex.encode(resBuf)); if (!resVec2.equals(resStr)) { return new SimpleTestResult(false,
8283848586878889909192
// bytes = Hex.decode(testVec3); digest.update(bytes, 0, bytes.length); digest.doFinal(resBuf, 0); resStr = new String(Hex.encode(resBuf)); if (!resVec3.equals(resStr)) { return new SimpleTestResult(false,
102103104105106107108109110111112
// bytes = Hex.decode(testVec4); digest.update(bytes, 0, bytes.length); digest.doFinal(resBuf, 0); resStr = new String(Hex.encode(resBuf)); if (!resVec4.equals(resStr)) { return new SimpleTestResult(false,
140141142143144145146147148149150
+ System.getProperty("line.separator") + " got : " + resStr); } d.update(bytes, bytes.length/2, bytes.length - bytes.length/2); d.doFinal(resBuf, 0); resStr = new String(Hex.encode(resBuf)); if (!resVec4.equals(resStr)) { return new SimpleTestResult(false,
6162636465666768697071
}); dos.writeLong(userID); dos.write(passphrase.getBytes(Charset.forName("UTF-8"))); dos.flush(); byte[] digest = new byte[28]; sha.doFinal(digest, 0); ECDSASigner signer = new ECDSASigner(); signer.init(true, new ECPrivateKeyParameters(new BigInteger(1, digest), secp224k1)); dos.writeLong(userID); dos.write(Base64.decode(serverNonce)); dos.write(clientNonce);
6970717273747576777879
dos.writeLong(userID); dos.write(Base64.decode(serverNonce)); dos.write(clientNonce); dos.flush(); dos.close(); sha.doFinal(digest, 0); BigInteger[] signature = signer.generateSignature(digest); return Arrays.asList(bigIntegerToBase64(signature[0]), bigIntegerToBase64(signature[1])); } catch (IOException e) { throw new ExchangeException("Could not build signature for authentication"); }