Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTstCustomCipherComponent.EncryptStreamToDst

function EncryptStreamToDst(aBuf: tStream; Count: Integer): Integer;
Convenience wrapper that reads Count octets from aBuf (a stream) in BufferSize-sized chunks and feeds each chunk through EncryptToDst; same Count = 0/negative semantics as DecryptStreamToDst. An application uses this to encrypt a whole file/stream (still needs a final DoneToDst call). An empty source is passed on as one EncryptToDst call of 0 octets, so that DoneToDst knows it is encrypting and writes what finishes the empty message: the tag in GCM, CCM and EAX, a block of padding in padded ECB and CBC, nothing in CTR, CFB, OFB and bpmNone.