-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #433 from mamonet/sha3-mb
Integrate Vectorized SHA3
- Loading branch information
Showing
15 changed files
with
26,098 additions
and
34 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* MIT License | ||
* | ||
* Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation | ||
* Copyright (c) 2022-2023 HACL* Contributors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
|
||
#ifndef __Hacl_SHA3_Scalar_H | ||
#define __Hacl_SHA3_Scalar_H | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include <string.h> | ||
#include "krml/internal/types.h" | ||
#include "krml/lowstar_endianness.h" | ||
#include "krml/internal/target.h" | ||
|
||
void | ||
Hacl_SHA3_Scalar_shake128_hacl( | ||
uint32_t inputByteLen, | ||
uint8_t *input, | ||
uint32_t outputByteLen, | ||
uint8_t *output | ||
); | ||
|
||
void | ||
Hacl_SHA3_Scalar_shake256_hacl( | ||
uint32_t inputByteLen, | ||
uint8_t *input, | ||
uint32_t outputByteLen, | ||
uint8_t *output | ||
); | ||
|
||
void Hacl_SHA3_Scalar_sha3_224(uint32_t inputByteLen, uint8_t *input, uint8_t *output); | ||
|
||
void Hacl_SHA3_Scalar_sha3_256(uint32_t inputByteLen, uint8_t *input, uint8_t *output); | ||
|
||
void Hacl_SHA3_Scalar_sha3_384(uint32_t inputByteLen, uint8_t *input, uint8_t *output); | ||
|
||
void Hacl_SHA3_Scalar_sha3_512(uint32_t inputByteLen, uint8_t *input, uint8_t *output); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#define __Hacl_SHA3_Scalar_H_DEFINED | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
/* MIT License | ||
* | ||
* Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation | ||
* Copyright (c) 2022-2023 HACL* Contributors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
|
||
#ifndef __Hacl_SHA3_Vec256_H | ||
#define __Hacl_SHA3_Vec256_H | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include <string.h> | ||
#include "krml/internal/types.h" | ||
#include "krml/lowstar_endianness.h" | ||
#include "krml/internal/target.h" | ||
|
||
typedef void *Hacl_SHA3_Vec256_disjoint4_4; | ||
|
||
typedef struct K____uint8_t___uint8_t__s | ||
{ | ||
uint8_t *fst; | ||
uint8_t *snd; | ||
} | ||
K____uint8_t___uint8_t_; | ||
|
||
typedef struct K____uint8_t__K____uint8_t___uint8_t__s | ||
{ | ||
uint8_t *fst; | ||
K____uint8_t___uint8_t_ snd; | ||
} | ||
K____uint8_t__K____uint8_t___uint8_t_; | ||
|
||
typedef struct K____uint8_t___uint8_t____K____uint8_t___uint8_t__s | ||
{ | ||
uint8_t *fst; | ||
K____uint8_t__K____uint8_t___uint8_t_ snd; | ||
} | ||
K____uint8_t___uint8_t____K____uint8_t___uint8_t_; | ||
|
||
void | ||
Hacl_SHA3_Vec256_shake128_vec256( | ||
uint32_t inputByteLen, | ||
uint8_t *input0, | ||
uint8_t *input1, | ||
uint8_t *input2, | ||
uint8_t *input3, | ||
uint32_t outputByteLen, | ||
uint8_t *output0, | ||
uint8_t *output1, | ||
uint8_t *output2, | ||
uint8_t *output3 | ||
); | ||
|
||
void | ||
Hacl_SHA3_Vec256_shake256_vec256( | ||
uint32_t inputByteLen, | ||
uint8_t *input0, | ||
uint8_t *input1, | ||
uint8_t *input2, | ||
uint8_t *input3, | ||
uint32_t outputByteLen, | ||
uint8_t *output0, | ||
uint8_t *output1, | ||
uint8_t *output2, | ||
uint8_t *output3 | ||
); | ||
|
||
void | ||
Hacl_SHA3_Vec256_sha3_224_vec256( | ||
uint32_t inputByteLen, | ||
uint8_t *input0, | ||
uint8_t *input1, | ||
uint8_t *input2, | ||
uint8_t *input3, | ||
uint8_t *output0, | ||
uint8_t *output1, | ||
uint8_t *output2, | ||
uint8_t *output3 | ||
); | ||
|
||
void | ||
Hacl_SHA3_Vec256_sha3_256_vec256( | ||
uint32_t inputByteLen, | ||
uint8_t *input0, | ||
uint8_t *input1, | ||
uint8_t *input2, | ||
uint8_t *input3, | ||
uint8_t *output0, | ||
uint8_t *output1, | ||
uint8_t *output2, | ||
uint8_t *output3 | ||
); | ||
|
||
void | ||
Hacl_SHA3_Vec256_sha3_384_vec256( | ||
uint32_t inputByteLen, | ||
uint8_t *input0, | ||
uint8_t *input1, | ||
uint8_t *input2, | ||
uint8_t *input3, | ||
uint8_t *output0, | ||
uint8_t *output1, | ||
uint8_t *output2, | ||
uint8_t *output3 | ||
); | ||
|
||
void | ||
Hacl_SHA3_Vec256_sha3_512_vec256( | ||
uint32_t inputByteLen, | ||
uint8_t *input0, | ||
uint8_t *input1, | ||
uint8_t *input2, | ||
uint8_t *input3, | ||
uint8_t *output0, | ||
uint8_t *output1, | ||
uint8_t *output2, | ||
uint8_t *output3 | ||
); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#define __Hacl_SHA3_Vec256_H_DEFINED | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* MIT License | ||
* | ||
* Copyright (c) 2016-2022 INRIA, CMU and Microsoft Corporation | ||
* Copyright (c) 2022-2023 HACL* Contributors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
|
||
#ifndef __internal_Hacl_SHA3_Scalar_H | ||
#define __internal_Hacl_SHA3_Scalar_H | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
#include <string.h> | ||
#include "krml/internal/types.h" | ||
#include "krml/lowstar_endianness.h" | ||
#include "krml/internal/target.h" | ||
|
||
#include "../Hacl_SHA3_Scalar.h" | ||
|
||
extern const uint32_t Hacl_Impl_SHA3_Vec_keccak_rotc[24U]; | ||
|
||
extern const uint32_t Hacl_Impl_SHA3_Vec_keccak_piln[24U]; | ||
|
||
extern const uint64_t Hacl_Impl_SHA3_Vec_keccak_rndc[24U]; | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#define __internal_Hacl_SHA3_Scalar_H_DEFINED | ||
#endif |
Oops, something went wrong.