Example #1
0
        public void SaveAndRestoreForTests()
        {
            // the save/restore functionality is used during unit tests.
            EcdhBC ecdh1 = new EcdhBC();
            EcdhBC ecdh2 = new EcdhBC(ecdh1.GetBlob());

            Assert.Equal(ecdh1.PublicKey, ecdh2.PublicKey);
        }
Example #2
0
        public void SharedSecretBC()
        {
            EcdhBC ecdh = new EcdhBC(Convert.FromBase64String(KEY_PAIR));

            Assert.Equal(ecdh.PublicKey, PUB_KEY);

            for (int n = 0; n < REMOTE_PUB_KEYS.Length; ++n)
            {
                ecdh.ComputeSharedSecret(REMOTE_PUB_KEYS[n]);
                Assert.Equal(ecdh.SharedSecret, SHARED_SECRETS[n]);
            }
        }