tdesalgid.c

来自「IBE是一种非对称密码技术」· C语言 代码 · 共 44 行

C
44
字号
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */
#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "algobj.h"
#include "cipher.h"
#include "block.h"
#include "oidlist.h"
#include "algid.h"
#include "errorctx.h"

int VtDerCoder3DESEDEwCBCPad (
   VtDerCoderInfo *coderInfo,
   Pointer object,
   unsigned int flag
   )
{
  int status;
  VoltBlockCipherAlgIdData algIdData;
  unsigned char tdesEDECBCOid[Volt3DesEDECBCPadOidBytesLen] =
    { Volt3DesEDECBCPadOidBytes };
  VOLT_DECLARE_FNCT_LINE (fnctLine)

  /* Set the algIdData to what we're expecting the object to represent.
   */
  algIdData.oid = tdesEDECBCOid;
  algIdData.oidLen = Volt3DesEDECBCPadOidBytesLen;
  algIdData.algorithm = VT_ALG_ID_3DES_EDE_CBC_PAD;
  algIdData.subAlg1 = VOLT_SUB_ALG_3DES_EDE;
  algIdData.subAlg2 = VOLT_SUB_ALG_P5_PAD | VOLT_SUB_ALG_CBC;
  algIdData.algImpl = VtAlgorithmImpl3DESEDE;
  algIdData.KeyParam = VtKeyParamTripleDES;
  VOLT_SET_FNCT_LINE (fnctLine)
  status = VoltDerCoderBlockCipher (flag, object, coderInfo, &algIdData);

  VOLT_LOG_ERROR_INFO_COMPARE (
    status, 0, object, status, 0, 0,
    (char *)0, "VtDerCoder3DESEDEwCBCPad", fnctLine, (char *)0)

  return (status);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?