#include <XrdOucSHA3.hh>
Classes | |
| struct | sha3_ctx_t |
| SHA3 state context used by all methods (OpenSSL - like interface) More... | |
| union | sha3_ctx_t.st |
Public Types | |
| enum | MDLen { SHA3_128 = 16 , SHA3_224 = 28 , SHA3_256 = 32 , SHA3_384 = 48 , SHA3_512 = 64 } |
| SHA3 digest lengths (bits to bytes). More... | |
Public Member Functions | |
| XrdOucSHA3 () | |
| ~XrdOucSHA3 () | |
Static Public Member Functions | |
| static void * | Calc (const void *in, size_t inlen, void *md, MDLen mdlen) |
| static void | Final (sha3_ctx_t *c, void *md) |
| static void | Init (sha3_ctx_t *c, MDLen mdlen) |
| static void | SHAKE128_Init (sha3_ctx_t *c) |
| static void | SHAKE256_Init (sha3_ctx_t *c) |
| static void | SHAKE_Out (sha3_ctx_t *c, void *out, size_t len) |
| static void | SHAKE_Update (sha3_ctx_t *c, const void *data, size_t len) |
| static void | Update (sha3_ctx_t *c, const void *data, size_t len) |
Definition at line 36 of file XrdOucSHA3.hh.
| struct XrdOucSHA3::sha3_ctx_t |
SHA3 state context used by all methods (OpenSSL - like interface)
Definition at line 44 of file XrdOucSHA3.hh.
| Class Members | ||
|---|---|---|
| int | mdlen | |
| int | pt | |
| int | rsiz | |
| union sha3_ctx_t.st | st | |
| int | xof | these don't overflow |
| union XrdOucSHA3::sha3_ctx_t.st |
Definition at line 45 of file XrdOucSHA3.hh.
| Class Members | ||
|---|---|---|
| uint8_t | b[200] |
< state: 8-bit bytes |
| uint64_t | q[25] | 64-bit words |
| enum XrdOucSHA3::MDLen |
|
inline |
Definition at line 143 of file XrdOucSHA3.hh.
|
inline |
Definition at line 144 of file XrdOucSHA3.hh.
|
static |
Compute a sha3 hash (md) of given byte length from "in" (one time call).
| in | Pointer to input data. |
| inlen | Length of data in bytes. |
| md | Pointer to mbuffer of size SHA3_xxx to receive result. |
| mdlen | Message digest byte length (one of the listed enums). |
Definition at line 150 of file XrdOucSHA3.cc.
References Final(), Init(), and Update().
|
static |
Return final message digest.
| c | Pointer to context. |
| md | Pointer to buffer of size SHA3_xxx to receive result. |
Definition at line 208 of file XrdOucSHA3.cc.
References XrdOucSHA3::sha3_ctx_t::mdlen, XrdOucSHA3::sha3_ctx_t::pt, XrdOucSHA3::sha3_ctx_t::rsiz, and XrdOucSHA3::sha3_ctx_t::st.
Referenced by Calc().
|
static |
Initialize context in prepration for computing SHA3 checksum.
| c | Pointer to context. |
| mdlen | Message digest byte length (one of the listed enums). |
Definition at line 168 of file XrdOucSHA3.cc.
References XrdOucSHA3::sha3_ctx_t::mdlen, XrdOucSHA3::sha3_ctx_t::pt, XrdOucSHA3::sha3_ctx_t::rsiz, XrdOucSHA3::sha3_ctx_t::st, and XrdOucSHA3::sha3_ctx_t::xof.
Referenced by Calc(), SHAKE128_Init(), and SHAKE256_Init().
|
inlinestatic |
|
inlinestatic |
|
static |
Return final message digest of desired length. This function may be called iteratively to get as many bits as needed. Bits beyound MDLen form a pseudo-random sequence (i.e. are repeatable with the same input).
| c | Pointer to context. |
| out | Pointer to buffer of size len to receive result. |
| len | The number of digest bytes to return. |
Definition at line 239 of file XrdOucSHA3.cc.
References XrdOucSHA3::sha3_ctx_t::pt, XrdOucSHA3::sha3_ctx_t::rsiz, XrdOucSHA3::sha3_ctx_t::st, and XrdOucSHA3::sha3_ctx_t::xof.
|
inlinestatic |
Update shake digest with data.
| c | Pointer to context. |
| data | Pointer to data. |
| len | Length of data in bytes. |
Definition at line 128 of file XrdOucSHA3.hh.
References Update().
|
static |
Update digest with data.
| c | Pointer to context. |
| data | Pointer to data. |
| len | Length of data in bytes. |
Definition at line 186 of file XrdOucSHA3.cc.
References XrdOucSHA3::sha3_ctx_t::pt, XrdOucSHA3::sha3_ctx_t::rsiz, and XrdOucSHA3::sha3_ctx_t::st.
Referenced by Calc(), and SHAKE_Update().