crypto.h 581 字节
Newer Older
1 2 3 4
/**
 *  @file
 *  @copyright defined in eos/LICENSE.txt
 */
5
#pragma once
6
#include <eosiolib/types.h>
M
Matias Romeo 已提交
7
extern "C" {
8 9 10
/**
 *  This method is implemented as:
 *
A
Andrianto Lie 已提交
11
 *  checksum calc_hash;
12
 *  sha256( data, length, &calc_hash );
A
Anton Perkov 已提交
13
 *  eos_assert( calc_hash == hash, "invalid hash" );
14 15 16
 *
 *  This method is optimized to a NO-OP when in fast evaluation mode
 */
A
Anton Perkov 已提交
17
void eos_assert_sha256( char* data, uint32_t length, const checksum* hash );
18 19 20 21

/**
 *  Calculates sha256( data,length) and stores result in memory pointed to by hash 
 */
A
Andrianto Lie 已提交
22
void sha256( char* data, uint32_t length, checksum* hash );
A
Anton Perkov 已提交
23
}