Esempio n. 1
0
        private Message PrepareMessageForNewKeyChunk(int lastSendKeyIndex)
        {
            var keyChunk = new BlockIdAndKeyAllocation(lastSendKeyIndex, CommonKeyStore.GetKeyAllocation());
            var mac      = MessageAuthenticator.GetMAC(keyChunk.GetBytes());

            return(new AddKey(mac, keyChunk));
        }
Esempio n. 2
0
        private Message PrepareAckForCommonKeyProposition(int propositionKeyChunkId)
        {
            var keyChunk = new BlockIdAndKeyAllocation(propositionKeyChunkId, CommonKeyStore.GetKeyAllocation());
            var mac      = MessageAuthenticator.GetMAC(keyChunk.GetBytes());

            return(new AddingKeyAck(mac, keyChunk));
        }
Esempio n. 3
0
 private bool DoesAckCorrespondsToLastSentKeyIndex(BlockIdAndKeyAllocation chunkId)
 {
     return(chunkId.BlockId == _lastSendKeyIndex);
 }