Ixian SDK
IXICore.Crypto Class Reference

Shortcuts for some common Ixian cryptographic operations. More...

Static Public Member Functions

static string hashToString (byte[] data)
 Converts a byte-field into a hexadecimal string representation. More...
 
static byte [] stringToHash (string data)
 Converts a hexadecimal string value of any length into a byte-field representation. More...
 
static byte [] sha256 (byte[] data, int offset=0, int count=0)
 Computes a SHA256 value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters. More...
 
static byte [] sha512 (byte[] data, int offset=0, int count=0)
 Computes a SHA512 value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters. More...
 
static byte [] sha512sq (byte[] data, int offset=0, int count=0)
 Computes a (SHA512)^2 value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters. More...
 
static byte [] sha512sqTrunc (byte[] data, int offset=0, int count=0, int hash_length=44)
 Computes a trunc(N, (SHA512)^2) value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters. More...
 
static byte [] sha512qu (byte[] data, int offset=0, int count=0)
 Computes a (SHA512)^4 value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters. More...
 
static byte [] sha512quTrunc (byte[] data, int offset=0, int count=0, int hash_length=32)
 Computes a trunc(N, (SHA512)^4) value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters. More...
 

Detailed Description

Shortcuts for some common Ixian cryptographic operations.

Definition at line 10 of file Crypto.cs.

Member Function Documentation

◆ hashToString()

static string IXICore.Crypto.hashToString ( byte []  data)
static

Converts a byte-field into a hexadecimal string representation.

Parameters
dataByte-field.
Returns
Hexadecimal string representation of the byte field.

Definition at line 17 of file Crypto.cs.

◆ sha256()

static byte [] IXICore.Crypto.sha256 ( byte []  data,
int  offset = 0,
int  count = 0 
)
static

Computes a SHA256 value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters.

Parameters
dataSource data for hashing.
offsetByte offset into the data. Default = 0
countNumber of bytes to use in the calculation. Default, 0, means use all available bytes.
Returns
SHA256 hash of the input data.

Definition at line 55 of file Crypto.cs.

◆ sha512()

static byte [] IXICore.Crypto.sha512 ( byte []  data,
int  offset = 0,
int  count = 0 
)
static

Computes a SHA512 value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters.

Parameters
dataSource data for hashing.
offsetByte offset into the data. Default = 0
countNumber of bytes to use in the calculation. Default, 0, means use all available bytes.
Returns
SHA512 hash of the input data.

Definition at line 75 of file Crypto.cs.

◆ sha512qu()

static byte [] IXICore.Crypto.sha512qu ( byte []  data,
int  offset = 0,
int  count = 0 
)
static

Computes a (SHA512)^4 value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters.

The term (SHA512)^4 in this case means hashing the value four times - e.g. using SHA512 repeatedly on the computed hash value.

Parameters
dataSource data for hashing.
offsetByte offset into the data. Default = 0
countNumber of bytes to use in the calculation. Default, 0, means use all available bytes.
Returns
SHA256 quad hash of the input data.

Definition at line 160 of file Crypto.cs.

◆ sha512quTrunc()

static byte [] IXICore.Crypto.sha512quTrunc ( byte []  data,
int  offset = 0,
int  count = 0,
int  hash_length = 32 
)
static

Computes a trunc(N, (SHA512)^4) value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters.

The term (SHA512)^4 in this case means hashing the value four times - e.g. using SHA512 repeatedly on the computed hash value. The trunc(N, X) function represents taking only the first N bytes of the byte-field X.

Parameters
dataSource data for hashing.
offsetByte offset into the data. Default = 0
countNumber of bytes to use in the calculation. Default, 0, means use all available bytes.
hash_lengthNumber of bytes to keep from the truncated hash.
Returns
SHA256 quad and truncated hash of the input data.

Definition at line 179 of file Crypto.cs.

◆ sha512sq()

static byte [] IXICore.Crypto.sha512sq ( byte []  data,
int  offset = 0,
int  count = 0 
)
static

Computes a (SHA512)^2 value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters.

The term (SHA512)^2 in this case means hashing the value twice - e.g. using SHA512 again on the computed hash value.

Parameters
dataSource data for hashing.
offsetByte offset into the data. Default = 0
countNumber of bytes to use in the calculation. Default, 0, means use all available bytes.
Returns
SHA256 squared hash of the input data.

Definition at line 106 of file Crypto.cs.

◆ sha512sqTrunc()

static byte [] IXICore.Crypto.sha512sqTrunc ( byte []  data,
int  offset = 0,
int  count = 0,
int  hash_length = 44 
)
static

Computes a trunc(N, (SHA512)^2) value of the given data. It is possible to calculate the hash for a subset of the input data by using the offset and count parameters.

The term (SHA512)^2 in this case means hashing the value twice - e.g. using SHA512 again on the computed hash value. The trunc(N, X) function represents taking only the first N bytes of the byte-field X.

Parameters
dataSource data for hashing.
offsetByte offset into the data. Default = 0
countNumber of bytes to use in the calculation. Default, 0, means use all available bytes.
hash_lengthNumber of bytes to keep from the truncated hash.
Returns
SHA256 squared and truncated hash of the input data.

Definition at line 142 of file Crypto.cs.

◆ stringToHash()

static byte [] IXICore.Crypto.stringToHash ( string  data)
static

Converts a hexadecimal string value of any length into a byte-field representation.

Parameters
dataHexadecimal string
Returns
Byte array with the value of the input hexadecimal string.

Definition at line 36 of file Crypto.cs.


The documentation for this class was generated from the following file: