// How do I retrieve Alice's and Bob's private information?
quintuple< Word , Word , Word , Word , Word > privateKeyA = TD.getPrivateKeyA( );
quintuple< Word , Word , Word , Word , Word > privateKeyB = TD.getPrivateKeyB( );
// Check the shared key correctness:
ThRightNormalForm c1( N , privateKeyA.first * publicKeyB.first * privateKeyA.second * publicKeyB.second * privateKeyA.third * publicKeyB.third );
ThRightNormalForm c2( N , publicKeyA.first * privateKeyB.first * publicKeyA.second * privateKeyB.second * publicKeyA.third * privateKeyB.third );
if( c1==c2 && c1==TD.getSharedKey( ) ) {
cout << "Shared key: ok" << endl;
} else {
cout << "Shared key: error" << endl;
}
return 0;
}