Skip to content

Commit

Permalink
More breaking out common code.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzcf committed Dec 6, 2024
1 parent 7a65a1b commit 1b47a0c
Show file tree
Hide file tree
Showing 46 changed files with 44 additions and 2,304 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ IMPLEMENTATION_SOURCES = $(IMPLEMENTATION)/ml_dsa.jazz \
$(wildcard $(IMPLEMENTATION)/sample/*.jinc) \
$(wildcard $(IMPLEMENTATION)/arithmetic/*.jinc) \
$(wildcard $(COMMON)/*.jinc) \
$(wildcard $(COMMON)/keccak/*.jinc)
$(wildcard $(COMMON)/arithmetic/*.jinc) \
$(wildcard $(COMMON)/keccak/*.jinc) \
$(wildcard $(COMMON)/sample/*.jinc)

OUTPUT_FILE_NAME = ml_dsa_$(PARAMETER_SET)_$(IMPLEMENTATION_TYPE)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require "../constants.jinc"

param int INVERSE_OF_MODULUS_MOD_MONTGOMERY_R = 58_728_449;

inline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require "modular.jinc"
require "../constants.jinc"

u32[256] ZETAS_TIMES_MONTGOMERY_R = {
25847, -2608894, -518909, 237124, -777960, -876248, 466468, 1826347, 2353451, -359251, -2091905, 3119733, -2884855, 3111497, 2680103, 2725464,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from Common require "arithmetic/ntt.jinc"

require "polynomial.jinc"
require "arithmetic/rounding.jinc"
require "arithmetic/ntt.jinc"

// A column vector has dimensions ROWS_IN_MATRIX_A * 1
namespace column_vector {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "arithmetic/rounding.jinc"
require "arithmetic/modular.jinc"

namespace polynomial {
Expand Down
3 changes: 1 addition & 2 deletions ref/ml_dsa_65/row_vector.jinc → ref/common/row_vector.jinc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require "polynomial.jinc"
require "arithmetic/rounding.jinc"
require "arithmetic/ntt.jinc"
require "polynomial.jinc"

// A row vector has dimensions 1 * COLUMNS_IN_MATRIX_A
namespace row_vector {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "../hashing.jinc"

inline
fn absorb_for_shake128(
reg ptr u64[25] state,
Expand Down
172 changes: 0 additions & 172 deletions ref/ml_dsa_44/arithmetic/ntt.jinc

This file was deleted.

Loading

0 comments on commit 1b47a0c

Please sign in to comment.