group
group__libshare__memalg
Cryptographic algorythms supported include a 128-bit, 224-bit, 256-bit, 384-bit, or 512-bit hash digest.

Cryptological and Hash Digest Algorithms

The following algorythms are available for use:
  • SHALG_SHR160 A RIPEMD32 compatible algorithm.
  • SHALG_SHR224 A proprietary 224-bit algorithm with a 28 byte digest.
  • SHALG_SHA1 A 128-bit SHA hash with a 20 byte digest.
  • SHALG_SHA224 A 224-bit SHA hash with a 28 byte digest.
  • SHALG_SHA256 A 256-bit SHA hash with a 32 byte digest.
  • SHALG_SHA384 A 384-bit SHA hash with a 48 byte digest.
  • SHALG_SHA512 A 512-bit SHA hash with a 64 byte digest.
  • SHALG_CRYPT256 A libcrypt compatible SHA 256-bit algorithm.
  • SHALG_CRYPT512 A libcrypt compatible SHA 512-bit algorithm.
The SHALG_CRYPT256 and SHALG_CRYPT512 use the standard SHA-256 and SHA-512 method of "shadow password account validation" used on linux. The SHALG_SHA1, SHALG_SHA224, SHALG_SHA256, SHALG_SHA384, and SHALG_SHA512 algorythms provide the various implementations of the Secure Hash Algorythm. Supplemental HMAC and HKDF encoding is provided. The SHALG_ECDSA128R, SHALG_ECDSA160R, SHALG_ECDSA160K, SHALG_ECDSA224R, SHALG_ECDSA224K, SHALG_ECDSA256R, SHALG_ECDSA256K, SHALG_ECDSA384R, and SHALG_ECDSA512R algorythms provide the various implementions of the Elliptic Curve DSA encryption method. The SHALG_RIPEMD160 algorythm is synonymous with the SHALG_SHR160 algorythm. The SHALG_SHR160 algorythm provides a private key generation via the RIPEMD160 implementation and a ECDSA256K public-private key validation method. The SHALG_SHR224 algorythm is a proprietary libshare runtime library. The computation speed to calculate regular or HMAC SHR224 digests is much faster than the SHA or ECDSA algorythms. The method used combines aspects of both checksum computation and bit operations. Specifications for the Secure Hash Algorithm (SHA) algorithm can be found at "http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf" and "https://tools.ietf.org/html/rfc6234". Specifications on the Elliptic Curve (ECDSA) algorithm can be found at "http://csrc.nist.gov/publications/fips/fips186-3/fips_186-3.pdf" and "https://www.ietf.org/rfc/rfc6979.txt".
enum
@0
group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba394854ff4f1518f8a047ea885d7d4f60publicSHA1_Message_Block_Size 64group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55bafb2361a9dd54ccd78a2727ca4c47f792publicSHA224_Message_Block_Size 64group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55baf163926be4ff6a506a77f737295b6884publicSHA256_Message_Block_Size 64group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba4c82bc2f6b15a4717d5cd8125ca31e03publicSHA384_Message_Block_Size 128group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55babba971af4f20bede9e0e62472e03e755publicSHA512_Message_Block_Size 128group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba082a5cabbe9ad6382a0606cd0a9c9c47publicUSHA_Max_Message_Block_Size SHA512_Message_Block_Sizegroup__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55bae6b440886f3edd40e1854e8bb5406835publicSHA1HashSize 20group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba8f590c65273a356a4703c90cc1f1584fpublicSHA224HashSize 28group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba3a8b66cf5d0bd8cc0e375a86a754ab28publicSHA256HashSize 32group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba1f2e28eb98ef458a8c54e32e9cbe3322publicSHA384HashSize 48group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba9c2b656e2a8c7b981612de8ddaf2f7bepublicSHA512HashSize 64group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55bab3907d0aaeac7086349a0c920c301145publicUSHAMaxHashSize SHA512HashSizegroup__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba3cee11b61cecb950ddad59399caab2e3publicSHA1HashSizeBits 160group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba1d000b90626950f5ceae6353d4648e59publicSHA224HashSizeBits 224group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55baf8b7a9e3bd026320a4b418bc35ba21a7publicSHA256HashSizeBits 256group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba2bf86ed4893af8bff6df06951fcd65dfpublicSHA384HashSizeBits 384group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55ba44595cd183133d2dca15294777f6b6ebpublicSHA512HashSizeBits 512group__libshare__memalg_1gga06fc87d81c62e9abb8790b6e5713c55baeb9a635b6c798bf545965b19aef992fdpublicUSHAMaxHashSizeBits SHA512HashSizeBits
typedef
typedef uint32_t shalg_t[78]
A key or signature.
typedef
typedef unsigned char shcr224_t[96]
function
char* shhex_str
(unsigned char *data, size_t data_len)
function
void shhex_bin
(char *hex_str, unsigned char *data, size_t data_max)
function
const char* shalg_str
(int alg)
Print the algorythm parameters.
function
int shalg_fmt
(char *label)
function
char* shalg_fmt_str
(int fmt)
function
char* shalg_encode
(int fmt, unsigned char *data, size_t data_len)
Print a binary segment in the format specified.
function
int shalg_decode
(int fmt, char *in_data, unsigned char *data, size_t *data_len_p)
function
int shalg_priv_rand
(int alg, shalg_t ret_key)
Generate a random 512-bit private signature.
function
int shalg_priv
(int alg, shalg_t ret_key, unsigned char *data, size_t data_len)
Generate a private signature from a 'secret' binary segment.
function
char* shalg_print
(int fmt, shalg_t key)
Print a key or signature in the format specified.
function
int shalg_gen
(int fmt, char *in_data, shalg_t ret_key)
function
int shalg_pub
(int alg, shalg_t priv_key, shalg_t ret_key)
Generate a public key from a private key.
function
int shalg_sign
(int alg, shalg_t priv_key, shalg_t ret_sig, unsigned char *data, size_t data_len)
function
int shalg_ver
(int alg, shalg_t pub_key, shalg_t sig_key, unsigned char *data, size_t data_len)
function
int shalg_mode_str
(char *mode_str)
function
int shalg_cmp
(shalg_t alg_a, shalg_t alg_b)
function
int shsha_hex
(int alg, unsigned char *ret_digest, unsigned char *data, size_t data_len)
Digest a single message into hexadecimal format.
function
int shsha
(int alg, unsigned char *ret_bin, unsigned char *data, size_t data_len)
Digest a single message into binary format.
function
size_t shsha_size
(int alg)
The byte size of the resulting SHA digest hash.
function
int shsha_init
(sh_sha_t *ctx, int alg)
function
int shsha_write
(sh_sha_t *ctx, unsigned char *data, size_t data_len)
function
int shsha_result
(sh_sha_t *ctx, unsigned char *ret_bin)
function
int shhmac
(int alg, unsigned char *key, size_t key_len, const unsigned char *message_array, int length, unsigned char *digest)
This function will compute an HMAC message digest.
Param
alg
One of SHALG_SHA1, SHALG_SHA224, SHALG_SHA256, SHALG_SHA384, or SHALG_SHA512.
message_array
An array of octets representing the message.
length
The length of the message in message_array.
key
The secret shared key.
key_len
The length of the secret shared key.
digest
Where the digest is to be returned.
Return Value
A libshare error code.
Note
The length of the digest is determined by the value of whichSha.
function
int shhmac_init
(sh_hmac_t *context, int alg, unsigned char *key, int key_len)
This function will initialize the hmacContext in preparation for computing a new HMAC message digest.
Param
context
The context to reset.
alg
One of SHALG_SHA1, SHALG_SHA224, SHALG_SHA256, SHALG_SHA384, or SHALG_SHA512.
key
The secret shared key.
key_len
The length of the secret shared key.
Return Value
A libshare error code.
function
int shhmac_write
(sh_hmac_t *context, const unsigned char *text, int text_len)
Accepts an array of octets as the next portion of the message.
Param
context
The HMAC context to update.
text
An array of octets representing the next portion of the message.
text_len
The length of the message in text.
Return Value
A libshare error code.
Note
This function may be called multiple times.
function
int shhmac_result
(sh_hmac_t *context, uint8_t *digest)
This function will return the N-byte message digest into the Message_Digest array provided by the caller.
Param
context
The context to use to calculate the HMAC hash.
digest
Where the digest is returned.
Return Value
A libshare error code.
Note
The length of the hash is determined by the value of alg that was passed to hmacReset().
function
int shhkdf
(int alg, unsigned char *salt, int salt_len, unsigned char *ikm, int ikm_len, unsigned char *info, int info_len, uint8_t *okm, int okm_len)
The HKDF algorithm (HMAC-based Extract-and-Expand Key Derivation Function, RFC 5869), expressed in terms of the various SHA algorithms.
Param
alg
One of SHA1, SHA224, SHA256, SHA384, SHA512
salt
The optional salt value (a non-secret random value); if not provided (salt == NULL), it is set internally to a string of HashLen(whichSha) zeros.
salt_len
The length of the salt value. (Ignored if salt == NULL.)
ikm
Input keying material.
ikm_len
The length of the input keying material.
info
The optional context and application specific information. If info == NULL or a zero-length string, it is ignored.
info_len
The length of the optional context and application specific information. (Ignored if info == NULL.)
okm
Where the HKDF is to be stored.
okm_len
The length of the buffer to hold okm. okm_len must be <= 255 * shsha_size(alg) * 2
Return Value
A libshare error code.
function
int shhkdf_extract
(int alg, unsigned char *salt, int salt_len, unsigned char *ikm, int ikm_len, uint8_t *prk)
This function will perform HKDF extraction.
Param
alg
One of SHALG_SHA1, SHALG_SHA224, SHALG_SHA256, SHALG_SHA384, SHALG_SHA512
salt
The optional salt value (a non-secret random value); if not provided (salt == NULL), it is set internally to a string of HashLen(whichSha) zeros.
salt_len
The length of the salt value. (Ignored if salt == NULL.)
ikm[
] Input keying material.
ikm_len
The length of the input keying material.
prk
Array where the HKDF extraction is to be stored. Must be larger than shsha_size(alg)
Return Value
A libshare error code.
function
int shhkdf_expand
(int alg, uint8_t *prk, int prk_len, unsigned char *info, int info_len, uint8_t *okm, int okm_len)
This function will perform HKDF expansion.
Param
whichSha
One of SHA1, SHA224, SHA256, SHA384, SHA512
prk
The pseudo-random key to be expanded; either obtained directly from a cryptographically strong, uniformly distributed pseudo-random number generator, or as the output from hkdfExtract().
prk_len
The length of the pseudo-random key in prk; should at least be equal to shsha_size(alg).
info
The optional context and application specific information. If info == NULL or a zero-length string, it is ignored.
info_len
The length of the optional context and application specific information. (Ignored if info == NULL.)
okm
Where the HKDF is to be stored.
okm_len
The length of the buffer to hold okm. The okm_len must be <= 255 * shsha_size(alg) * 2.
Return Value
A libshare error code.
function
int shhkdf_init
(sh_hkdf_t *context, int alg, unsigned char *salt, int salt_len)
This function will initialize the hkdfContext in preparation for key derivation using the modular HKDF interface for arbitrary length inputs.
Param
context
The context to reset.
alg
One of SHALG_SHA1, SHALG_SHA224, SHALG_SHA256, SHALG_SHA384, or SHALG_SHA512.
salt
The optional salt value (a non-secret random value); if not provided (salt == NULL), it is set internally to a string of HashLen(whichSha) zeros.
salt_len
The length of the salt value. (Ignored if salt == NULL.)
Return Value
A libshare error code.
function
int shhkdf_write
(sh_hkdf_t *context, unsigned char *ikm, int ikm_len)
This function accepts an array of octets as the next portion of the input keying material.
Param
context
The HKDF context to update.
ikm
An array of octets representing the next portion of the input keying material.
ikm_len
The length of ikm.
Return Value
A libshare error code.
Note
This function may be called multiple times.
function
int shhkdf_result
(sh_hkdf_t *context, uint8_t *prk, unsigned char *info, int info_len, uint8_t *okm, int okm_len)
This function will finish the HKDF extraction and perform the final HKDF expansion.
Param
context
The HKDF context to use to calculate the HKDF hash.
prk
NULL or a location to store the HKDF extraction. The buffer must be larger than shsha_size(whichSha).
info
NULL or context and application specific information.
info_len
The length of the optional context and application specific
okm
Where the HKDF is to be stored.
okm_len
The length of the buffer to hold okm. The okm_len must be <= 255 * shsha_size(whichSha) * 2
Return Value
A libshare error code.
function
int sh_sha1_init
(sh_sha_t *sha)
This function will initialize the in preparation for computing a new SHA1 message digest. sh_sha1_t structsh__sha1__t compound
Param
context
The context to reset [in/out]
Return Value
A share error code.
function
int sh_sha1_write
(sh_sha_t *sha, const uint8_t *message_array, unsigned length)
This function accepts an array of octets as the next portion of the message.
Param
context
The SHA context to update. [in/out]
message_array
An array of octets representing the next portion of the message.
length
The length of the message in message_array. [in]
Return Value
A libshare error code.
function
int sh_sha1_result
(sh_sha_t *sha, uint8_t *Message_Digest)
This function will return the 160-bit message digest into the Message_Digest array provided by the caller.
Param
context
The context to use to calculate the SHA-1 hash.
Message_Digest
Where the digest is returned.
Return Value
A libshare error code.
Note
The first octet of hash is stored in the element with index 0, the last octet of hash in the element with index 19.
function
void sh_sha224
(const unsigned char *message, unsigned int len, unsigned char *digest)
function
int sh_sha256_init
(sh_sha_t *sha)
This function will initialize the in preparation for computing a new SHA256 message digest. sh_sha256_t structsh__sha256__t compound
Param
context
The context to reset.
Return Value
A libshare error code.
function
int sh_sha256_write
(sh_sha_t *sha, const uint8_t *message_array, unsigned int length)
This function accepts an array of octets as the next portion of the message.
Param
context
The SHA context to update.
message_array
An array of octets representing the next portion of the message.
length
The length of the message in message_array.
Return Value
A libshare error code.
function
int sh_sha256_result
(sh_sha_t *sha, uint8_t *Message_Digest)
This function will return the 256-bit message digest into the Message_Digest array provided by the caller.
Param
context
The context to use to calculate the SHA hash.
Message_Digest
Where the digest is returned.
Return Value
A libshare error code.
Note
The first octet of hash is stored in the element with index 0. The last octet of hash in the element with index 31.
function
void sh_sha256
(const unsigned char *message, unsigned int len, unsigned char *digest)
function
int sh_sha512_init
(sh_sha_t *sha)
This function will initialize the in preparation for computing a new SHA512 message digest. sh_sha512_t structsh__sha512__t compound
Param
context
The context to reset.
Return Value
A libshare error code.
function
int sh_sha512_write
(sh_sha_t *sha, const uint8_t *message_array, unsigned int length)
This function accepts an array of octets as the next portion of the message.
Param
context
The SHA context to update.
message_array
An array of octets representing the next portion of the message.
length
The length of the message in message_array.
Return Value
A libshare error code.
function
int sh_sha512_result
(sh_sha_t *sha, uint8_t *Message_Digest)
This function will return the 512-bit message digest into the Message_Digest array provided by the caller.
Param
context
The context to use to calculate the SHA hash.
Message_Digest
Where the digest is returned.
Return Value
A libshare error code.
Note
The first octet of hash is stored in the element with index 0, * the last octet of hash in the element with index 63.
function
void sh_sha512
(const unsigned char *message, unsigned int len, unsigned char *digest)
function
char* shdigest
(void *data, int32_t len)
function
void sh_ripemd160
(unsigned char *data, size_t data_len, sh160_t digest)
Generate a RIPEMD160 20-byte hash from a binary segment.
function
uint32_t shsha_2fa
(char *secret_str)
Param
secret_str
A 16 character "base 32" string.
Return Value
A pin that will invalidate after aproximately one minute.
function
int shsha_2fa_verify
(char *secret_str, uint32_t pin)
Param
secret_str
A 16 character "base 32" string.
Return Value
0 on success and SHERR_ACCESS when pin is invalid.
function
char* shsha_2fa_secret
(void)
Generate a random secret key usable for 2fa purposes.
Return Value
A 16-character string in base-32 format.
function
uint32_t shsha_2fa_bin
(int alg, unsigned char *secret, size_t secret_len, int freq)
function
int shsha_2fa_bin_verify
(int alg, unsigned char *secret, size_t secret_len, int freq, uint32_t pin)
function
void shsha_2fa_secret_bin
(unsigned char *secret, size_t secret_len)
function
char* shcrypt
(const char *passwd, const char *salt)
function
char* shcrypt_sha256
(const char *key, const char *salt)
function
char* shcrypt_sha512
(const char *key, const char *salt)
function
void shcrypt_b64_encode
(char *ret_str, unsigned char *data, size_t data_len)
function
void shcrypt_b64_decode
(char *str, unsigned char *data, size_t *data_len_p)
function
shkey_t* shecdsa_key
(char *hex_str)
function
shkey_t* shecdsa_key_priv
(char *hex_seed)
function
shkey_t* shecdsa_key_pub
(shkey_t *priv_key)
function
const char* shecdsa_pub
(const char *hex_str)
function
int shecdsa_sign
(shkey_t *priv_key, char *sig_r, char *sig_s, unsigned char *data, size_t data_len)
function
int shecdsa_verify
(shkey_t *pub_key, char *str_r, char *str_s, unsigned char *data, size_t data_len)
function
char* shecdsa_hd_seed
(char *seed_hex, char *chain)
Generate a private key from the given seed context.
Param
seed_hex
A seed for the private key in hexadecimal format.
Return Value
A private key (32 bytes) in hexadecimal string.
function
char* shecdsa_hd_pubkey
(char *pubkey, char *chain, uint32_t idx)
Param
pubkey
The parent pubkey (65 bytes) in hexadecimal format.
chain
The parent chain (32 bytes) in hexadecimal format. This value is over-written with the new chain sequence.
idx
The sequence number in the derived set.
Return Value
A hexadecimal public key (65 bytes) in hexadecimal format.
function
char* shecdsa_hd_privkey
(char *secret, char *chain, uint32_t idx)
Param
pubkey
The parent pubkey (65 bytes) in hexadecimal format.
chain
The parent chain (32 bytes) in hexadecimal format. This value is over-written with the new chain sequence.
seed
The parent's secret key (32 bytes) in hexadecimal format.
idx
The sequence number in the derived set.
Return Value
A hexadecimal private key (32 bytes) in hexadecimal format.
function
char* shecdsa_hd_par_pub
(char *p_secret, char *p_chain, uint32_t idx)
function
char* shecdsa_hd_recover_pub
(char *secret)
function
int shecdsa_hd_sign
(char *privkey_hex, char *sig_r, char *sig_s, char *hash_hex)
function
int shecdsa_hd_verify
(char *pubkey_hex, char *str_r, char *str_s, char *hash_hex)
function
shec_t* shec_init
(int alg)
function
void shec_free
(shec_t **ec_p)
function
char* shec_priv
(shec_t *ec)
function
char* shec_priv_gen
(shec_t *ec, unsigned char *data, size_t data_len)
function
void shec_priv_set
(shec_t *ec, char *hex_priv)
function
char* shec_priv_rand
(shec_t *ec)
function
char* shec_pub
(shec_t *ec)
function
char* shec_pub_gen
(shec_t *ec)
function
int shec_sign
(shec_t *ec, unsigned char *data, size_t data_len)
function
int shec_signstr
(shec_t *ec, char *data)
function
int shec_signnull
(shec_t *ec)
function
int shec_ver
(shec_t *ec, unsigned char *data, size_t data_len)
function
int shec_verstr
(shec_t *ec, char *data)
function
int shec_vernull
(shec_t *ec)
function
shkey_t* shec_priv_key
(shec_t *ec)
function
int shec_priv_key_set
(shec_t *ec, shkey_t *key)
function
shkey_t* shec_pub_key
(shec_t *ec)
function
int shec_pub_key_set
(shec_t *ec, shkey_t *key)
function
int shec_pub_set
(shec_t *ec, char *hex_pub)
function
int shec_sig_set
(shec_t *ec, char *hex_sig)
function
int shcr224_verify
(char *salt, char *sig, char *data)
function
int shcr224_bin_verify
(unsigned char salt_key[28], shcr224_t sig, unsigned int rounds, unsigned char *data, size_t data_len)
function
int shcr224
(char *salt, char *data, char *ret_str)
function
int shcr224_bin
(unsigned char salt_key[28], shcr224_t ret_key, unsigned int rounds, unsigned char *data, size_t data_len)
Generate a signature, from the salt provided, that can be used in order to authenticate a password.
function
char* shcr224_salt
(unsigned int rounds)
function
int shcr224_salt_bin
(unsigned char ret_key[28])
Generate a random salt.
function
char* shcr224_salt_gen
(unsigned int rounds, unsigned char *data, size_t data_len)
function
int shcr224_salt_bin_gen
(unsigned char ret_key[28], unsigned char *data, size_t data_len)
function
uint32_t shcsum_crc32
(uint32_t crc, unsigned char *buf, size_t len)
function
uint32_t shcsum_crc32_combine
(uint32_t crc1, uint32_t crc2, size_t len2)
function
uint32_t shcsum_adler32
(uint32_t adler, unsigned char *buf, size_t len)
function
uint32_t shcsum_adler32_combine
(uint32_t adler1, uint32_t adler2, size_t len2)
define
SHFMT_HEX
0
define
SHFMT_BASE32
1
define
SHFMT_BASE58
2
define
SHFMT_BASE64
3
define
SHFMT_SHR56
4
define
MAX_SHFMT
5
define
SHALG_128BIT
(1 << 0)
A 16-byte hash.
define
SHALG_160BIT
(1 << 1)
A 20-byte hash.
define
SHALG_224BIT
(1 << 2)
A 28-byte hash.
define
SHALG_256BIT
(1 << 3)
A 32-byte hash.
define
SHALG_384BIT
(1 << 4)
A 48-byte hash.
define
SHALG_512BIT
(1 << 5)
A 64-byte hash.
define
SHALG_SHR
(1 << 8)
Share Library Algorythm.
define
SHALG_SHA
(1 << 9)
Secure Hash Algorythm.
define
SHALG_RSA
(1 << 10)
Pubkey Encryption Algorythm (circa 1977).
define
SHALG_ECDSA
(1 << 11)
Elliptic Curve Algorythm.
define
SHALG_CRYPT
(1 << 12)
define
SHALG_VR
(1 << 15)
Indicates that the algorythm is 'verifiably random'.
define
SHALG_SHR160
(SHALG_SHR | SHALG_160BIT)
The libshare 160-bit hash algorithm.
define
SHALG_SHR224
(SHALG_SHR | SHALG_224BIT)
The libshare 224-bit hash algorithm.
define
SHALG_SHCR224
(SHALG_CRYPT | SHALG_SHR | SHALG_224BIT)
The libshare 224-bit "crypt" hash algorithm designed towards password authentication purposes.
define
SHALG_SHA1
(SHALG_SHA | SHALG_128BIT)
define
SHALG_SHA224
(SHALG_SHA | SHALG_224BIT)
define
SHALG_SHA256
(SHALG_SHA | SHALG_256BIT)
define
SHALG_SHA384
(SHALG_SHA | SHALG_384BIT)
define
SHALG_SHA512
(SHALG_SHA | SHALG_512BIT)
define
SHALG_ECDSA128R
(SHALG_ECDSA | SHALG_128BIT | SHALG_VR)
define
SHALG_ECDSA160R
(SHALG_ECDSA | SHALG_160BIT | SHALG_VR)
define
SHALG_ECDSA160K
(SHALG_ECDSA | SHALG_160BIT)
define
SHALG_ECDSA224R
(SHALG_ECDSA | SHALG_224BIT | SHALG_VR)
define
SHALG_ECDSA224K
(SHALG_ECDSA | SHALG_224BIT)
define
SHALG_ECDSA256R
(SHALG_ECDSA | SHALG_256BIT | SHALG_VR)
define
SHALG_ECDSA256K
(SHALG_ECDSA | SHALG_256BIT)
define
SHALG_ECDSA384R
(SHALG_ECDSA | SHALG_384BIT | SHALG_VR)
define
SHALG_ECDSA512R
(SHALG_ECDSA | SHALG_512BIT | SHALG_VR)
define
SHALG_RSA128
(SHALG_RSA | SHALG_128BIT)
define
SHALG_CRYPT256
(SHALG_CRYPT | SHALG_256BIT)
define
SHALG_CRYPT512
(SHALG_CRYPT | SHALG_512BIT)
define
SHALG_DEFAULT
0
An indicator to use the default available algorythm.
define
SHALG_SHKEY
0
A generic 224-bit key generated by the shkey() function set.
define
SHALG_RIPEMD160
SHALG_SHR160
A convience macro for referencing the RIPEMD160 algorythm.
define
SHALG
((_alg) == (_flag))
Return Value
TRUE if the alg matches the given flags
define
MAX_ALG_SIZE
((MAX_ALG_WORD_SIZE - 1) * sizeof(uint32_t))
define
shalg_size
((_a)[MAX_ALG_WORD_SIZE - 1])
define
MAX_ALG_WORD_SIZE
78
define
SHCR224_SIZE
96
define
SHCR224_SALT_SIZE
28
define
SHCR224_MIN_ROUNDS
1000
define
SHCR224_DEFAULT_ROUNDS
SHCR224_MIN_ROUNDS