libbtc
bitcoinclibrary
Typedefs | Functions
hash.h File Reference
#include "btc.h"
#include <stdint.h>
#include <stddef.h>
#include "cstr.h"
#include "vector.h"

Go to the source code of this file.

Typedefs

typedef uint8_t uint256[32]
 

Functions

LIBBTC_API void btc_hash (const unsigned char *datain, size_t length, uint256 hashout)
 
LIBBTC_API void btc_hash_sngl_sha256 (const unsigned char *datain, size_t length, uint256 hashout)
 

Typedef Documentation

typedef uint8_t uint256[32]

Definition at line 44 of file hash.h.

Function Documentation

LIBBTC_API void btc_hash ( const unsigned char *  datain,
size_t  length,
uint256  hashout 
)

Definition at line 1026 of file sha2.c.

References sha256_Raw().

Referenced by btc_privkey_verify_pubkey().

1027 {
1028  //bitcoin double sha256 hash
1029  sha256_Raw((const uint8_t*)datain, length, hashout);
1030  sha256_Raw(hashout, 32, hashout);
1031 }
void sha256_Raw(const sha2_byte *data, size_t len, uint8_t digest[SHA256_DIGEST_LENGTH])
Definition: sha2.c:652
LIBBTC_API void btc_hash_sngl_sha256 ( const unsigned char *  datain,
size_t  length,
uint256  hashout 
)

Definition at line 1033 of file sha2.c.

References sha256_Raw().

1034 {
1035  sha256_Raw((const uint8_t*)datain, length, hashout);
1036 }
void sha256_Raw(const sha2_byte *data, size_t len, uint8_t digest[SHA256_DIGEST_LENGTH])
Definition: sha2.c:652