ccn_signing.c File Reference

Support for signing. More...

Go to the source code of this file.

Defines

#define is_left(x)   (0 == (x & 1))
#define node_lr(x)   (x & 1)
#define sibling_of(x)   (x ^ 1)
#define parent_of(x)   (x >> 1)

Functions

struct ccn_sigc * ccn_sigc_create (void)
void ccn_sigc_destroy (struct ccn_sigc **ctx)
int ccn_sigc_init (struct ccn_sigc *ctx, const char *digest)
int ccn_sigc_update (struct ccn_sigc *ctx, const void *data, size_t size)
int ccn_sigc_final (struct ccn_sigc *ctx, struct ccn_signature *signature, size_t *size, const struct ccn_pkey *priv_key)
size_t ccn_sigc_signature_max_size (struct ccn_sigc *ctx, const struct ccn_pkey *priv_key)
int ccn_merkle_root_hash (const unsigned char *msg, size_t size, const struct ccn_parsed_ContentObject *co, const EVP_MD *digest_type, MP_info *merkle_path_info, unsigned char *result, int result_size)
int ccn_verify_signature (const unsigned char *msg, size_t size, const struct ccn_parsed_ContentObject *co, const struct ccn_pkey *verification_pubkey)
struct ccn_pkey * ccn_d2i_pubkey (const unsigned char *p, size_t size)
void ccn_pubkey_free (struct ccn_pkey *i_pubkey)
size_t ccn_pubkey_size (const struct ccn_pkey *i_pubkey)
int ccn_append_pubkey_blob (struct ccn_charbuf *c, const struct ccn_pkey *i_pubkey)
void ccn_random_bytes (unsigned char *buf, size_t size)
 Generate pseudo-random bytes.
void ccn_add_entropy (const void *buf, size_t size, int bits_of_entropy)
 Feed some entropy to the random number generator.

Detailed Description

Support for signing.

Part of the CCNx C Library.

Copyright (C) 2009-2010 Palo Alto Research Center, Inc.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file ccn_signing.c.


Define Documentation

#define is_left (  )     (0 == (x & 1))

Definition at line 96 of file ccn_signing.c.

#define node_lr (  )     (x & 1)

Definition at line 97 of file ccn_signing.c.

#define parent_of (  )     (x >> 1)

Definition at line 99 of file ccn_signing.c.

Referenced by ccn_merkle_root_hash().

#define sibling_of (  )     (x ^ 1)

Definition at line 98 of file ccn_signing.c.


Function Documentation

void ccn_add_entropy ( const void *  buf,
size_t  size,
int  bits_of_entropy 
)

Feed some entropy to the random number generator.

Parameters:
buf is the source buffer
size is in bytes
bits_of_entropy is an estimate; use 0 to make me guess

Definition at line 364 of file ccn_signing.c.

Referenced by main().

int ccn_append_pubkey_blob ( struct ccn_charbuf c,
const struct ccn_pkey *  i_pubkey 
)

Definition at line 316 of file ccn_signing.c.

Referenced by ccn_get_public_key(), ccn_sign_content(), and main().

struct ccn_pkey* ccn_d2i_pubkey ( const unsigned char *  p,
size_t  size 
) [read]

Definition at line 291 of file ccn_signing.c.

Referenced by ccn_cache_key(), and ccn_locate_key().

int ccn_merkle_root_hash ( const unsigned char *  msg,
size_t  size,
const struct ccn_parsed_ContentObject co,
const EVP_MD *  digest_type,
MP_info merkle_path_info,
unsigned char *  result,
int  result_size 
)

Definition at line 101 of file ccn_signing.c.

Referenced by ccn_verify_signature().

void ccn_pubkey_free ( struct ccn_pkey *  i_pubkey  ) 

Definition at line 300 of file ccn_signing.c.

Referenced by finalize_pkey().

size_t ccn_pubkey_size ( const struct ccn_pkey *  i_pubkey  ) 

Definition at line 307 of file ccn_signing.c.

void ccn_random_bytes ( unsigned char *  buf,
size_t  size 
)

Generate pseudo-random bytes.

Parameters:
buf is the destination buffer
size is in bytes

Definition at line 347 of file ccn_signing.c.

Referenced by ccn_name_append_nonce(), and main().

struct ccn_sigc* ccn_sigc_create ( void   )  [read]

Definition at line 37 of file ccn_signing.c.

Referenced by ccn_encode_ContentObject().

void ccn_sigc_destroy ( struct ccn_sigc **  ctx  ) 

Definition at line 43 of file ccn_signing.c.

Referenced by ccn_encode_ContentObject().

int ccn_sigc_final ( struct ccn_sigc *  ctx,
struct ccn_signature *  signature,
size_t *  size,
const struct ccn_pkey *  priv_key 
)

Definition at line 80 of file ccn_signing.c.

Referenced by ccn_encode_ContentObject().

int ccn_sigc_init ( struct ccn_sigc *  ctx,
const char *  digest 
)

Definition at line 54 of file ccn_signing.c.

Referenced by ccn_encode_ContentObject().

size_t ccn_sigc_signature_max_size ( struct ccn_sigc *  ctx,
const struct ccn_pkey *  priv_key 
)

Definition at line 91 of file ccn_signing.c.

Referenced by ccn_encode_ContentObject().

int ccn_sigc_update ( struct ccn_sigc *  ctx,
const void *  data,
size_t  size 
)

Definition at line 72 of file ccn_signing.c.

Referenced by ccn_encode_ContentObject().

int ccn_verify_signature ( const unsigned char *  msg,
size_t  size,
const struct ccn_parsed_ContentObject co,
const struct ccn_pkey *  verification_pubkey 
)

Definition at line 173 of file ccn_signing.c.

Referenced by ccn_dispatch_message(), ccn_verify_content(), decode_message(), and main().

Generated on Fri May 13 16:27:22 2011 for Content-Centric Networking in C by  doxygen 1.6.3