Electroneum
crypto.cpp File Reference
#include "crypto/crypto.cpp"
#include "crypto-tests.h"
Include dependency graph for crypto.cpp:

Go to the source code of this file.

Functions

bool check_scalar (const crypto::ec_scalar &scalar)
 
void random_scalar (crypto::ec_scalar &res)
 
void hash_to_scalar (const void *data, std::size_t length, crypto::ec_scalar &res)
 
void hash_to_point (const crypto::hash &h, crypto::ec_point &res)
 
void hash_to_ec (const crypto::public_key &key, crypto::ec_point &res)
 

Function Documentation

◆ check_scalar()

bool check_scalar ( const crypto::ec_scalar scalar)

Definition at line 36 of file crypto.cpp.

36  {
37  return sc_check(crypto::operator &(scalar)) == 0;
38 }
int sc_check(const unsigned char *)
Here is the call graph for this function:

◆ hash_to_ec()

void hash_to_ec ( const crypto::public_key key,
crypto::ec_point res 
)

Definition at line 54 of file crypto.cpp.

54  {
55  ge_p3 tmp;
56  crypto::hash_to_ec(key, tmp);
57  ge_p3_tobytes(crypto::operator &(res), &tmp);
58 }
const char * res
Definition: hmac_keccak.cpp:41
const char * key
Definition: hmac_keccak.cpp:39
void hash_to_ec(const public_key &key, ge_p3 &res)
Definition: crypto.cpp:479
#define ge_p3_tobytes
Definition: ge.h:55
Here is the call graph for this function:

◆ hash_to_point()

void hash_to_point ( const crypto::hash h,
crypto::ec_point res 
)

Definition at line 48 of file crypto.cpp.

48  {
49  ge_p2 point;
50  ge_fromfe_frombytes_vartime(&point, reinterpret_cast<const unsigned char *>(&h));
51  ge_tobytes(crypto::operator &(res), &point);
52 }
void ge_fromfe_frombytes_vartime(ge_p2 *, const unsigned char *)
#define ge_tobytes
Definition: ge.h:54
Here is the call graph for this function:

◆ hash_to_scalar()

void hash_to_scalar ( const void *  data,
std::size_t  length,
crypto::ec_scalar res 
)

Definition at line 44 of file crypto.cpp.

44  {
45  crypto::hash_to_scalar(data, length, res);
46 }
void hash_to_scalar(const void *data, size_t length, ec_scalar &res)
Definition: crypto.cpp:126
Here is the call graph for this function:
Here is the caller graph for this function:

◆ random_scalar()

void random_scalar ( crypto::ec_scalar res)

Definition at line 40 of file crypto.cpp.

40  {
42 }
void random_scalar(ec_scalar &res)
Definition: crypto.cpp:122
Here is the call graph for this function: