本文整理汇总了Java中com.subgraph.orchid.crypto.TorTapKeyAgreement.DH_LEN属性的典型用法代码示例。如果您正苦于以下问题:Java TorTapKeyAgreement.DH_LEN属性的具体用法?Java TorTapKeyAgreement.DH_LEN怎么用?Java TorTapKeyAgreement.DH_LEN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.subgraph.orchid.crypto.TorTapKeyAgreement
的用法示例。
在下文中一共展示了TorTapKeyAgreement.DH_LEN属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processExtendResponse
private CircuitNode processExtendResponse(RelayCell response) {
final byte[] handshakeResponse = new byte[TorTapKeyAgreement.DH_LEN + TorMessageDigest.TOR_DIGEST_SIZE];
response.getByteArray(handshakeResponse);
final byte[] keyMaterial = new byte[CircuitNodeCryptoState.KEY_MATERIAL_SIZE];
final byte[] verifyDigest = new byte[TorMessageDigest.TOR_DIGEST_SIZE];
if(!kex.deriveKeysFromHandshakeResponse(handshakeResponse, keyMaterial, verifyDigest)) {
return null;
}
return extender.createNewNode(router, keyMaterial, verifyDigest);
}
示例2: readPeerPublic
private BigInteger readPeerPublic(Cell cell) {
final byte[] dhPublic = new byte[TorTapKeyAgreement.DH_LEN];
cell.getByteArray(dhPublic);
final BigInteger peerPublic = new BigInteger(1, dhPublic);
if(!TorTapKeyAgreement.isValidPublicValue(peerPublic)) {
logger.warning("Illegal DH public value received: "+ peerPublic);
return null;
}
return peerPublic;
}