예제 #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));
        }
예제 #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));
        }
예제 #3
0
 private bool DoesAckCorrespondsToLastSentKeyIndex(BlockIdAndKeyAllocation chunkId)
 {
     return(chunkId.BlockId == _lastSendKeyIndex);
 }