-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
832cb34
commit 079f309
Showing
8 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
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,3 @@ | ||
override JFLAGS += -arch arm-m4 | ||
SRCS := xof.jazz | ||
include ../../../../Makefile.common |
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,17 @@ | ||
#ifndef JADE_XOF_shake128_armv7m_ref_API_H | ||
#define JADE_XOF_shake128_armv7m_ref_API_H | ||
|
||
#define JADE_XOF_shake128_armv7m_ref_ALGNAME "SHAKE128" | ||
#define JADE_XOF_shake128_armv7m_ref_ARCH "armv7m" | ||
#define JADE_XOF_shake128_armv7m_ref_IMPL "ref" | ||
|
||
#include <stdint.h> | ||
|
||
int jade_xof_shake128_armv7m_ref( | ||
uint8_t *output, | ||
uint32_t output_length, | ||
const uint8_t *input, | ||
uint32_t input_length | ||
); | ||
|
||
#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,13 @@ | ||
from Jade require "common/keccak/keccak1600/armv7m/ref/keccak1600.jinc" | ||
|
||
inline fn __shake128_ref(reg u32 out outlen in inlen) | ||
{ | ||
reg u32 rate trail_byte; | ||
|
||
trail_byte = 0x1F; | ||
rate = (1344/8); | ||
|
||
__keccak1600_ref(out, outlen, in, inlen, trail_byte, rate); | ||
} | ||
|
||
|
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,11 @@ | ||
require "shake128.jinc" | ||
|
||
export fn jade_xof_shake128_armv7m_ref(reg u32 output output_length input input_length) -> reg u32 | ||
{ | ||
reg u32 r; | ||
__shake128_ref(output, output_length, input, input_length); | ||
r = 0; | ||
return r; | ||
} | ||
|
||
|
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,3 @@ | ||
override JFLAGS += -arch arm-m4 | ||
SRCS := xof.jazz | ||
include ../../../../Makefile.common |
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,17 @@ | ||
#ifndef JADE_XOF_shake256_armv7m_ref_API_H | ||
#define JADE_XOF_shake256_armv7m_ref_API_H | ||
|
||
#define JADE_XOF_shake256_armv7m_ref_ALGNAME "SHAKE256" | ||
#define JADE_XOF_shake256_armv7m_ref_ARCH "armv7m" | ||
#define JADE_XOF_shake256_armv7m_ref_IMPL "ref" | ||
|
||
#include <stdint.h> | ||
|
||
int jade_xof_shake256_armv7m_ref( | ||
uint8_t *output, | ||
uint32_t output_length, | ||
const uint8_t *input, | ||
uint32_t input_length | ||
); | ||
|
||
#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,13 @@ | ||
from Jade require "common/keccak/keccak1600/armv7m/ref/keccak1600.jinc" | ||
|
||
inline fn __shake256_ref(reg u32 out outlen in inlen) | ||
{ | ||
reg u32 rate trail_byte; | ||
|
||
trail_byte = 0x1F; | ||
rate = (1088/8); | ||
|
||
__keccak1600_ref(out, outlen, in, inlen, trail_byte, rate); | ||
} | ||
|
||
|
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,10 @@ | ||
require "shake256.jinc" | ||
|
||
export fn jade_xof_shake256_armv7m_ref(reg u32 output output_length input input_length) -> reg u32 | ||
{ | ||
reg u32 r; | ||
__shake256_ref(output, output_length, input, input_length); | ||
r = 0; | ||
return r; | ||
} | ||
|