| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#include "owndefs.h" |
| 18 |
#include "owncp.h" |
| 19 |
#include "hash/pcphash.h" |
| 20 |
#include "hash/pcphash_rmf.h" |
| 21 |
#include "pcptool.h" |
| 22 |
#include "hash/sha3/shake128/pcpshake128_stuff.h" |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
IPPFUN(IppStatus, ippsHashMethodSet_SHAKE128, (IppsHashMethod * pMethod, int digestBitsize)) |
| 36 |
{ |
| 37 |
|
| 38 |
IPP_BAD_PTR1_RET(pMethod); |
| 39 |
|
| 40 |
if (digestBitsize > 0 && (digestBitsize % 8) == 0) { |
| 41 |
pMethod->hashAlgId = ippHashAlg_SHAKE128; |
| 42 |
pMethod->hashLen = digestBitsize / 8, pMethod->msgBlkSize = MBS_SHAKE128; |
| 43 |
pMethod->msgLenRepSize = 0; |
| 44 |
pMethod->stateLen = IPP_SHA3_STATE_BYTESIZE; |
| 45 |
pMethod->hashInit = cp_sha3_hashInit; |
| 46 |
pMethod->hashUpdate = cp_shake128_hashUpdate; |
| 47 |
pMethod->hashOctStr = cp_sha3_hashOctString; |
| 48 |
pMethod->msgLenRep = NULL; |
| 49 |
|
| 50 |
return ippStsNoErr; |
| 51 |
} else { |
| 52 |
pMethod->hashAlgId = ippHashAlg_Unknown; |
| 53 |
pMethod->hashLen = 0, pMethod->msgBlkSize = 0; |
| 54 |
pMethod->msgLenRepSize = 0; |
| 55 |
pMethod->stateLen = 0; |
| 56 |
pMethod->hashInit = NULL; |
| 57 |
pMethod->hashUpdate = NULL; |
| 58 |
pMethod->hashOctStr = NULL; |
| 59 |
pMethod->msgLenRep = NULL; |
| 60 |
|
| 61 |
return ippStsOutOfRangeErr; |
| 62 |
} |
| 63 |
} |