⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ecparamsder.h

📁 IBE是一种非对称密码技术
💻 H
字号:
/* Copyright 2003-2006, Voltage Security, all rights reserved.
 */

#include "vibe.h"
#include "environment.h"
#include "base.h"
#include "libctx.h"
#include "derhelp.h"
#include "oidlist.h"
#include "algid.h"

#ifndef _EC_PARAMS_DER_H
#define _EC_PARAMS_DER_H

#ifdef __cplusplus
extern "C" {
#endif

/* An EC Curve is defined as follows.
 * -- Curve is defined in X9.62
 *   Curve  ::= SEQUENCE {
 *     coeffA             FieldElement,
 *     coeffB             FieldElement,
 *     seed               BIT STRING  OPTIONAL }
 *
 * -- FieldElement is defined in X9.62
 *   FieldElement ::= OCTET STRING
 */
typedef struct
{
  ASN1_OCTET_STRING *coeffA;
  ASN1_OCTET_STRING *coeffB;
  ASN1_BIT_STRING *seed;
} Asn1EcCurve;

DECLARE_ASN1_FUNCTIONS (Asn1EcCurve)

/* The only allowed fieldID for IBE is the following.
 *   FieldID ::= SEQUENCE {
 *     fieldType          OBJECT IDENTIFIER,
 *     prime              INTEGER }
 */
typedef struct
{
  Asn1ObjectId *oid;
  ASN1_INTEGER *prime;
} Asn1IBEFieldId;

DECLARE_ASN1_FUNCTIONS (Asn1IBEFieldId)

/* ECParameters is defined as follows.
 *   ECParameters  ::= SEQUENCE {
 *     version            INTEGER {ecpVer1(1)},
 *     fieldID            FieldID,
 *     curve              Curve,
 *     basePoint          ECPoint,
 *     order              INTEGER,
 *     cofactor           INTEGER  OPTIONAL }
 *
 * -- Curve is defined in X9.62
 *   Curve  ::= SEQUENCE {
 *     coeffA             FieldElement,
 *     coeffB             FieldElement,
 *     seed               BIT STRING  OPTIONAL }
 *
 * -- FieldElement is defined in X9.62
 *   FieldElement ::= OCTET STRING
 *
 * -- The seed BIT STRING in a Curve is a parameter that is used to
 * -- derive a random curve. It is not currently used in IBE.
 *
 * -- ECPoint is defined in X9.62
 *   ECPoint ::= OCTET STRING
 *
 * -- Field ID is defined in X9.62 and specifies a wide range
 * -- of possibilities.
 * --   FieldID ::= SEQUENCE {
 * --     fieldType   OBJECT IDENTIFIER,
 * --     parameters  ANY DEFINED BY fieldType }
 * -- However, for IBCS #2 version 1, there is
 * -- only one possible FieldID, a prime field. The OID for that
 * -- field type is { id-fieldType 1 }
 *   FieldID ::= SEQUENCE {
 *     fieldType          OBJECT IDENTIFIER,
 *     prime              INTEGER }
 *
 *   prime-field OBJECT IDENTIFIER ::= { id-fieldType 1 }
 */

/* The OpenSSL template definitions.
 */
typedef struct
{
  ASN1_INTEGER *version;
  Asn1IBEFieldId *fieldId;
  Asn1EcCurve *curve;
  Asn1EcPoint *basePoint;
  ASN1_INTEGER *subprime;
  ASN1_INTEGER *cofactor;
} Asn1EcParameters;

DECLARE_ASN1_FUNCTIONS (Asn1EcParameters)

#ifdef __cplusplus
}
#endif

#endif /* _EC_PARAMS_DER_H */

⌨️ 快捷键说明

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