member

Member functionality. More...

Data Structures

struct  MemberPrecomp
 Pre-computed member settings. More...
 
struct  PreComputedSignature
 Pre-computed signature. More...
 

Typedefs

typedef struct MemberCtx MemberCtx
 Internal context of member.
 

Functions

EpidStatus EpidMemberCreate (GroupPubKey const *pub_key, PrivKey const *priv_key, MemberPrecomp const *precomp, BitSupplier rnd_func, void *rnd_param, MemberCtx **ctx)
 Creates a new member context. More...
 
void EpidMemberDelete (MemberCtx **ctx)
 Deletes an existing member context. More...
 
EpidStatus EpidMemberWritePrecomp (MemberCtx const *ctx, MemberPrecomp *precomp)
 Serializes the pre-computed member settings. More...
 
EpidStatus EpidMemberSetHashAlg (MemberCtx *ctx, HashAlg hash_alg)
 Sets the hash algorithm to be used by a member. More...
 
size_t EpidGetSigSize (SigRl const *sig_rl)
 Computes the size in bytes required for an Intel(R) EPID signature. More...
 
EpidStatus EpidSign (MemberCtx const *ctx, void const *msg, size_t msg_len, void const *basename, size_t basename_len, SigRl const *sig_rl, size_t sig_rl_size, EpidSignature *sig, size_t sig_len)
 Writes an Intel(R) EPID signature. More...
 
EpidStatus EpidRegisterBaseName (MemberCtx *ctx, void const *basename, size_t basename_len)
 Registers a basename with a member. More...
 
EpidStatus EpidAddPreSigs (MemberCtx *ctx, size_t number_presigs, PreComputedSignature *presigs)
 Extends the member's pool of pre-computed signatures. More...
 
size_t EpidGetNumPreSigs (MemberCtx const *ctx)
 Gets the number of pre-computed signatures in the member's pool. More...
 
EpidStatus EpidWritePreSigs (MemberCtx *ctx, PreComputedSignature *presigs, size_t number_presigs)
 Serializes pre-computed signatures from the member's pool. More...
 
EpidStatus EpidRequestJoin (GroupPubKey const *pub_key, IssuerNonce const *ni, FpElemStr const *f, BitSupplier rnd_func, void *rnd_param, HashAlg hash_alg, JoinRequest *join_request)
 Creates a request to join a group. More...
 
EpidStatus EpidSignBasic (MemberCtx const *ctx, void const *msg, size_t msg_len, void const *basename, size_t basename_len, BasicSignature *sig)
 Creates a basic signature for use in constrained environment. More...
 
EpidStatus EpidNrProve (MemberCtx const *ctx, void const *msg, size_t msg_len, BasicSignature const *sig, SigRlEntry const *sigrl_entry, NrProof *proof)
 Calculates a non-revoked proof for a single signature based revocation list entry. More...
 
bool EpidIsPrivKeyInGroup (GroupPubKey const *pub_key, PrivKey const *priv_key)
 Tests if a member private key is valid without checking revocation. More...
 
EpidStatus EpidDecompressPrivKey (GroupPubKey const *pub_key, CompressedPrivKey const *compressed_privkey, PrivKey *priv_key)
 Decompresses compressed member private key. More...
 

Detailed Description

Member functionality.

Defines the APIs needed by Intel(R) EPID members. Each member context (MemberCtx) represents membership in a single group.

Function Documentation

EpidStatus EpidAddPreSigs ( MemberCtx ctx,
size_t  number_presigs,
PreComputedSignature presigs 
)

Extends the member's pool of pre-computed signatures.

Can either generate new pre-computed signatures or import existing ones. EpidWritePreSigs can be used to export pre-computed signatures.

Parameters
[in]ctxThe member context.
[in]number_presigsThe number of pre-computed signatures to add to the internal pool.
[in,out]presigsOptional array of valid pre-computed signatures to import. If presigs is not NULL it most contain at least number_presigs pre-computed signatures.
Returns
EpidStatus
Note
presigs buffer is zeroed out before return to prevent pre-computed signatures from being reused.
If the result is not kEpidNoErr the state of the pre-computed signature pool, and of presigs, is undefined.
See also
EpidMemberCreate
EpidWritePreSigs
EpidStatus EpidDecompressPrivKey ( GroupPubKey const *  pub_key,
CompressedPrivKey const *  compressed_privkey,
PrivKey priv_key 
)

Decompresses compressed member private key.

Converts a compressed member private key into a member private key for use by other member APIs.

Parameters
[in]pub_keyThe public key of the group.
[in]compressed_privkeyThe compressed member private key to be decompressed.
[out]priv_keyThe member private key.
Returns
EpidStatus
size_t EpidGetNumPreSigs ( MemberCtx const *  ctx)

Gets the number of pre-computed signatures in the member's pool.

Parameters
[in]ctxThe member context.
Returns
Number of remaining pre-computed signatures. Returns 0 if ctx is NULL.
See also
EpidMemberCreate
EpidWritePreSigs
size_t EpidGetSigSize ( SigRl const *  sig_rl)

Computes the size in bytes required for an Intel(R) EPID signature.

Parameters
[in]sig_rlThe signature based revocation list that is used. NULL is treated as a zero length list.
Returns
Size in bytes of an Intel(R) EPID signature including proofs for each entry in the signature based revocation list.
See also
SigRl
bool EpidIsPrivKeyInGroup ( GroupPubKey const *  pub_key,
PrivKey const *  priv_key 
)

Tests if a member private key is valid without checking revocation.

Used to check that a member private key is a valid key for a group. This is useful as a cross check when creating a new member private key as part of the join process

Parameters
[in]pub_keyThe public key of the group.
[in]priv_keyThe private key to check.
Returns
bool
Return values
trueif the private key is valid for the group of the public key
falseif the private key is not valid for the group of the public key
See also
EpidRequestJoin
EpidStatus EpidMemberCreate ( GroupPubKey const *  pub_key,
PrivKey const *  priv_key,
MemberPrecomp const *  precomp,
BitSupplier  rnd_func,
void *  rnd_param,
MemberCtx **  ctx 
)

Creates a new member context.

Must be called to create the member context that is used by other "Member" APIs.

Allocates memory for the context, then initializes it.

EpidMemberDelete() must be called to safely release the member context.

Parameters
[in]pub_keyThe group certificate.
[in]priv_keyThe member private key.
[in]precompOptional pre-computed data. If NULL the value is computed internally and is readable using EpidMemberWritePrecomp().
[in]rnd_funcRandom number generator.
[in]rnd_paramPass through context data for rnd_func.
[out]ctxNewly constructed member context.
Returns
EpidStatus
Warning
For security rnd_func should be a cryptographically secure random number generator.
Note
If the result is not kEpidNoErr the content of ctx is undefined.
See also
EpidMemberDelete
EpidMemberWritePrecomp
void EpidMemberDelete ( MemberCtx **  ctx)

Deletes an existing member context.

Must be called to safely release a member context created using EpidMemberCreate().

De-initializes the context, frees memory used by the context, and sets the context pointer to NULL.

Parameters
[in,out]ctxThe member context. Can be NULL.
See also
EpidMemberCreate
EpidStatus EpidMemberSetHashAlg ( MemberCtx ctx,
HashAlg  hash_alg 
)

Sets the hash algorithm to be used by a member.

Parameters
[in]ctxThe member context.
[in]hash_algThe hash algorithm to use.
Returns
EpidStatus
Note
If the result is not kEpidNoErr, the hash algorithm used by the member is undefined.
See also
EpidMemberCreate
HashAlg
EpidStatus EpidMemberWritePrecomp ( MemberCtx const *  ctx,
MemberPrecomp precomp 
)

Serializes the pre-computed member settings.

Parameters
[in]ctxThe member context.
[out]precompThe Serialized pre-computed member settings.
Returns
EpidStatus
Note
If the result is not kEpidNoErr, the content of precomp is undefined.
EpidStatus EpidNrProve ( MemberCtx const *  ctx,
void const *  msg,
size_t  msg_len,
BasicSignature const *  sig,
SigRlEntry const *  sigrl_entry,
NrProof proof 
)

Calculates a non-revoked proof for a single signature based revocation list entry.

Used in constrained environments where, due to limited memory, it may not be possible to process through a large and potentially unbounded revocation list.

Parameters
[in]ctxThe member context.
[in]msgThe message.
[in]msg_lenThe length of message in bytes.
[in]sigThe basic signature.
[in]sigrl_entryThe signature based revocation list entry.
[out]proofThe generated non-revoked proof.
Returns
EpidStatus
Note
This function should be used in conjunction with EpidSignBasic().
If the result is not kEpidNoErr, the content of proof is undefined.
See also
EpidMemberCreate
EpidSignBasic
EpidStatus EpidRegisterBaseName ( MemberCtx ctx,
void const *  basename,
size_t  basename_len 
)

Registers a basename with a member.

To prevent loss of privacy, the member keeps a list of basenames (corresponding to authorized verifiers). The member signs a message with a basename only if the basename is in the member's basename list.

Warning
The use of a name-based signature creates a platform unique pseudonymous identifier. Because it reduces the member's privacy, the user should be notified when it is used and should have control over its use.
Parameters
[in]ctxThe member context.
[in]basenameThe basename.
[in]basename_lenLength of the basename.
Returns
EpidStatus
Return values
kEpidDuplicateErrThe basename was already registered.
Note
If the result is not kEpidNoErr or kEpidDuplicateErr it is undefined if the basename is registered.
EpidStatus EpidRequestJoin ( GroupPubKey const *  pub_key,
IssuerNonce const *  ni,
FpElemStr const *  f,
BitSupplier  rnd_func,
void *  rnd_param,
HashAlg  hash_alg,
JoinRequest join_request 
)

Creates a request to join a group.

The created request is part of the interaction with an issuer needed to join a group. This interaction with the issuer is outside the scope of this API.

Parameters
[in]pub_keyThe group certificate of group to join.
[in]niThe nonce chosen by issuer as part of join protocol.
[in]fA randomly selected integer in [1, p-1].
[in]rnd_funcRandom number generator.
[in]rnd_paramPass through context data for rnd_func.
[in]hash_algThe hash algorithm to be used.
[out]join_requestThe join request.
Returns
EpidStatus
Warning
For security rnd_func should be a cryptographically secure random number generator.
Note
The default hash algorithm in Member is SHA-512. This is the recommended option if you do not override the hash algorithm elsewhere.
If the result is not kEpidNoErr, the content of join_request is undefined.
See also
HashAlg
EpidStatus EpidSign ( MemberCtx const *  ctx,
void const *  msg,
size_t  msg_len,
void const *  basename,
size_t  basename_len,
SigRl const *  sig_rl,
size_t  sig_rl_size,
EpidSignature sig,
size_t  sig_len 
)

Writes an Intel(R) EPID signature.

Parameters
[in]ctxThe member context.
[in]msgThe message to sign.
[in]msg_lenThe length in bytes of message.
[in]basenameOptional basename. If basename is NULL a random basename is used. Signatures generated using random basenames are anonymous. Signatures generated using the same basename are linkable by the verifier. If a basename is provided, it must already be registered, or kEpidBadArgErr is returned.
[in]basename_lenThe size of basename in bytes. Must be 0 basename is NULL.
[in]sig_rlThe signature based revocation list.
[in]sig_rl_sizeThe size in bytes of the signature based revocation list.
[out]sigThe generated signature
[in]sig_lenThe size of signature in bytes. Must be equal to value returned by EpidGetSigSize().
Returns
EpidStatus
Note
If the result is not kEpidNoErr the content of sig is undefined.
See also
EpidMemberCreate
EpidMemberSetHashAlg
EpidGetSigSize
EpidStatus EpidSignBasic ( MemberCtx const *  ctx,
void const *  msg,
size_t  msg_len,
void const *  basename,
size_t  basename_len,
BasicSignature sig 
)

Creates a basic signature for use in constrained environment.

Used in constrained environments where, due to limited memory, it may not be possible to process through a large and potentially unbounded revocation list.

Parameters
[in]ctxThe member context.
[in]msgThe message.
[in]msg_lenThe length of message in bytes.
[in]basenameOptional basename. If basename is NULL a random basename is used. Signatures generated using random basenames are anonymous. Signatures generated using the same basename are linkable by the verifier. If a basename is provided it must already be registered or kEpidBadArgErr is returned.
[in]basename_lenThe size of basename in bytes. Must be 0 basename is NULL.
[out]sigThe generated basic signature
Returns
EpidStatus
Note
This function should be used in conjunction with EpidNrProve()
If the result is not kEpidNoErr the content of sig, is undefined.
See also
EpidMemberCreate
EpidNrProve
EpidStatus EpidWritePreSigs ( MemberCtx ctx,
PreComputedSignature presigs,
size_t  number_presigs 
)

Serializes pre-computed signatures from the member's pool.

Removes requested number of pre-computed signatures from member's pool and stores them in presigs array. Use EpidAddPreSigs to add pre-computed signatures to the pool.

Parameters
[in]ctxThe member context.
[out]presigsAn existing buffer of pre-computed signatures.
[in]number_presigsNumber of pre-computed signatures to read. Number_presigs must not be greater than the value returned by EpidGetNumPreSigs.
Returns
EpidStatus
Note
If the result is not kEpidNoErr the state of the pre-computed signature pool, and of presigs, is undefined.
See also
EpidMemberCreate
EpidGetNumPreSigs
EpidAddPreSigs