コード例 #1
0
ファイル: rmd160.c プロジェクト: randombit/hacrypto
/*
 * Compines function to put the hash value of the supplied BUFFER into
 * OUTBUF which must have a size of 20 bytes.
 */
void
rmd160_hash_buffer (void *outbuf, const void *buffer, size_t length)
{
    rmd160_context_t hd;

    rmd160_init (&hd);
    rmd160_write (&hd, buffer, length);
    rmd160_final (&hd);
    memcpy (outbuf, hd.buf, 20);
}
コード例 #2
0
ファイル: rmd160.c プロジェクト: creationst/Creation2
/****************
 * Shortcut functions which puts the hash value of the supplied buffer
 * into outbuf which must have a size of 20 bytes.
 */
void
_gcry_rmd160_hash_buffer (void *outbuf, const void *buffer, size_t length )
{
  RMD160_CONTEXT hd;

  _gcry_rmd160_init ( &hd );
  _gcry_md_block_write ( &hd, buffer, length );
  rmd160_final ( &hd );
  memcpy ( outbuf, hd.bctx.buf, 20 );
}
コード例 #3
0
ファイル: rmd160.c プロジェクト: CasperWarden/CasperViewer
/****************
 * Shortcut functions which puts the hash value of the supplied buffer
 * into outbuf which must have a size of 20 bytes.
 */
void
_gcry_rmd160_hash_buffer( char *outbuf, const char *buffer, size_t length )
{
  RMD160_CONTEXT hd;

  _gcry_rmd160_init( &hd );
  rmd160_write( &hd, (byte*)buffer, length );
  rmd160_final( &hd );
  memcpy( outbuf, hd.buf, 20 );
}