当前位置: 首页>>代码示例>>C++>>正文


C++ SecureVector::clear方法代码示例

本文整理汇总了C++中botan::SecureVector::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ SecureVector::clear方法的具体用法?C++ SecureVector::clear怎么用?C++ SecureVector::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在botan::SecureVector的用法示例。


在下文中一共展示了SecureVector::clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: htonl

void ne7ssh_crypt::computeMac (Botan::SecureVector<Botan::byte> &hmac, Botan::SecureVector<Botan::byte> &packet, uint32 seq)
{
  SecureVector<Botan::byte> macStr;
  uint32 nSeq = htonl (seq);
  
  if (hmacIn)
  {
    macStr = Botan::SecureVector<Botan::byte>((Botan::byte*)&nSeq, 4);
    macStr += packet;
    hmac = hmacIn->process (macStr);
  }
  else hmac.clear();
}
开发者ID:skotopes,项目名称:ssh-bot,代码行数:13,代码来源:crypt.cpp

示例2:

void ne7ssh_string::bn2vector(Botan::SecureVector<Botan::byte>& result, const Botan::BigInt& bi)
{
    int high;
    Botan::byte zero = '\0';

    SecureVector<Botan::byte> strVector = BigInt::encode(bi);

    high = (*(strVector.begin()) & 0x80) ? 1 : 0;

    if (high)
    {
        result = SecureVector<Botan::byte>(&zero, 1);
    }
    else
    {
        result.clear();
    }
    result += strVector;
}
开发者ID:FuckingCoder,项目名称:ne7ssh,代码行数:19,代码来源:ne7ssh_string.cpp

示例3: localAlgos

bool ne7ssh_crypt::agree (Botan::SecureVector<Botan::byte> &result, const char* local, Botan::SecureVector<Botan::byte> &remote)
{
  ne7ssh_string localAlgos (local, 0);
  ne7ssh_string remoteAlgos (remote, 0);
  char* localAlgo, *remoteAlgo;
  bool match;
  size_t len;
  
  localAlgos.split (',');
  localAlgos.resetParts();
  remoteAlgos.split (',');
  remoteAlgos.resetParts();
  
  match = false;
  while ((localAlgo = localAlgos.nextPart()))
  {
    len = strlen(localAlgo);
    while ((remoteAlgo = remoteAlgos.nextPart()))
    {
      if (!memcmp (localAlgo, remoteAlgo, len))
      {
        match = true;
        break;
      }
    }
    if (match) break;
    remoteAlgos.resetParts();
  }
  if (match) 
  {
    result = Botan::SecureVector<Botan::byte>((Botan::byte*)localAlgo, (uint32_t) len);
    return true;
  }
  else 
  {
    result.clear();
    return false;
  }
}
开发者ID:skotopes,项目名称:ssh-bot,代码行数:39,代码来源:crypt.cpp


注:本文中的botan::SecureVector::clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。