【问题标题】:Custom source which can pump data from a ByteQueue可以从 ByteQueue 抽取数据的自定义源
【发布时间】:2016-03-06 18:03:15
【问题描述】:

Crypto++有StringSource、ArraySource、FileSource等

但我需要使用可以从 ByteQueue 获取数据的源类,以便将来通过过滤器和接收器。

即:

 _QUEUE_Source( MyPreparedQueue, true,
     new HashFilter(hash,
         new FileSink(zOutputFile),
         true));

如果没有将 MyPreparedQueue 发送到额外的中间内存缓冲区和选择 ArraySource,我该怎么做?

【问题讨论】:

    标签: c++ encryption cryptography crypto++


    【解决方案1】:

    我需要使用可以从 ByteQueue 获取数据的源类,以便将来传递给过滤器和接收器...

    Source classes 可以提取数据并将其泵送到过滤器。你的_QUEUE_Source 应该派生自SourceSource 只是一个BufferedTransformation 带有附件接口。

    MyPreparedQueue 可以继承自 ByteQueue。如果你看继承图,ByteQueue 继承自BufferedTransformation。或者,MyPreparedQueue 可以继承自 FilterBufferedTransformation

    一旦你解决了这两个声明的缺失函数:

    QueueSource : public Source { ... }
    PreparedQueue : public Filter { ... }
    

    对于过滤器,只需要实现Put2即可。


    Crypto++ wiki 对过滤器有一些简单的阅读。请参阅FiltersFilter (Intermediate)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-15
      • 2018-01-15
      • 2015-03-04
      • 1970-01-01
      • 2018-12-14
      相关资源
      最近更新 更多