% Quantum Key Distribution (QKD) protocol with Eve
% Version: January 16, 2016
classdef channel < handle
    % Quantum channel 
    properties
        % channel content
        buffer=[];
    end
    methods
        function [ ] = push(obj, S)
            % append bit sequence to buffer 
            obj.buffer=[obj.buffer S];
        end
        function [ R ] = pop(obj)
            % return and clear buffer content
            R=obj.buffer;
            obj.buffer=[];
        end
    end  
end

