]>
iEval git - authen-passphrase-scrypt.git/blob - scrypt-1.2.1/libcperciva/alg/sha256.h
9ed27c9c273859a5e3690357b49951030bb0d992
8 * Use #defines in order to avoid namespace collisions with anyone else's
9 * SHA256 code (e.g., the code in OpenSSL).
11 #define SHA256_Init libcperciva_SHA256_Init
12 #define SHA256_Update libcperciva_SHA256_Update
13 #define SHA256_Final libcperciva_SHA256_Final
14 #define SHA256_Buf libcperciva_SHA256_Buf
15 #define SHA256_CTX libcperciva_SHA256_CTX
16 #define HMAC_SHA256_Init libcperciva_HMAC_SHA256_Init
17 #define HMAC_SHA256_Update libcperciva_HMAC_SHA256_Update
18 #define HMAC_SHA256_Final libcperciva_HMAC_SHA256_Final
19 #define HMAC_SHA256_Buf libcperciva_HMAC_SHA256_Buf
20 #define HMAC_SHA256_CTX libcperciva_HMAC_SHA256_CTX
22 /* Context structure for SHA256 operations. */
31 * Initialize the SHA256 context ${ctx}.
33 void SHA256_Init(SHA256_CTX
*);
36 * SHA256_Update(ctx, in, len):
37 * Input ${len} bytes from ${in} into the SHA256 context ${ctx}.
39 void SHA256_Update(SHA256_CTX
*, const void *, size_t);
42 * SHA256_Final(digest, ctx):
43 * Output the SHA256 hash of the data input to the context ${ctx} into the
46 void SHA256_Final(uint8_t[32], SHA256_CTX
*);
49 * SHA256_Buf(in, len, digest):
50 * Compute the SHA256 hash of ${len} bytes from ${in} and write it to ${digest}.
52 void SHA256_Buf(const void *, size_t, uint8_t[32]);
54 /* Context structure for HMAC-SHA256 operations. */
61 * HMAC_SHA256_Init(ctx, K, Klen):
62 * Initialize the HMAC-SHA256 context ${ctx} with ${Klen} bytes of key from
65 void HMAC_SHA256_Init(HMAC_SHA256_CTX
*, const void *, size_t);
68 * HMAC_SHA256_Update(ctx, in, len):
69 * Input ${len} bytes from ${in} into the HMAC-SHA256 context ${ctx}.
71 void HMAC_SHA256_Update(HMAC_SHA256_CTX
*, const void *, size_t);
74 * HMAC_SHA256_Final(digest, ctx):
75 * Output the HMAC-SHA256 of the data input to the context ${ctx} into the
78 void HMAC_SHA256_Final(uint8_t[32], HMAC_SHA256_CTX
*);
81 * HMAC_SHA256_Buf(K, Klen, in, len, digest):
82 * Compute the HMAC-SHA256 of ${len} bytes from ${in} using the key ${K} of
83 * length ${Klen}, and write the result to ${digest}.
85 void HMAC_SHA256_Buf(const void *, size_t, const void *, size_t, uint8_t[32]);
88 * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen):
89 * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and
90 * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1).
92 void PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t,
93 uint64_t, uint8_t *, size_t);
95 #endif /* !_SHA256_H_ */
This page took 0.0507 seconds and 5 git commands to generate.