Skip to content

Conversation

@andrea-caforio
Copy link
Contributor

First PR of the series adding package documentation, Bazel build files and increases the OTBN memories:


This is a series of PRs that in their composition result in FIPS-204-compliant OTBN implementation of ML-DSA-87 verify.

Resources

Preamble

  1. doc

Number-theoretic transform

  1. NTT
  2. INTT

Polynomial arithmetic

  1. poly_add, poly_sub, poly_mul
  2. poly_mul_add

XOF

  1. xof_init, xof_poll, xof_finish
  2. xof_absorb
  3. xof_squeeze

Rounding

  1. shift_left
  2. decompose

Reduction

  1. reduce

Infinity norm

  1. norm_check

Sampling

  1. rej_ntt_poly, expand_a
  2. sample_in-ball
  3. challenge_hash

Encoding

  1. decode_z
  2. decode_t1
  3. decode_hint
  4. encode_w1

Vector operations

  1. sig_decode
  2. norm_check_z
  3. A*z, c * t1, Az - ct1
  4. use_hint

Epilogue

  1. app

This file documents the high-level implementation choices and should
be the initial contact point when navigating to the `mldsa87`
directory.

Signed-off-by: Andrea Caforio <[email protected]>
Two Bazel build files are required for the ML-DSA-87 apps: One for the
sources files and another one for the unit tests.

Signed-off-by: Andrea Caforio <[email protected]>
Increase the size of the OTBN DMEM from 4 KiB to 32 KiB (32768 bytes)
and the size of the IMEM from 8 KiB to 16 KiB (16384 bytes).

Signed-off-by: Andrea Caforio <[email protected]>
Comment on lines +1 to +3
/* Copyright lowRISC contributors (OpenTitan project).
Licensed under the Apache License, Version 2.0, see LICENSE for details.
SPDX-License-Identifier: Apache-2.0 */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Copyright lowRISC contributors (OpenTitan project).
Licensed under the Apache License, Version 2.0, see LICENSE for details.
SPDX-License-Identifier: Apache-2.0 */
/* Copyright lowRISC contributors (OpenTitan project). */
/* Licensed under the Apache License, Version 2.0, see LICENSE for details. */
/* SPDX-License-Identifier: Apache-2.0 */

Copy link
Contributor

@etterli etterli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me except that the memory increase should probably be an atomic commit which also touches the RTL and DV. The reason is that otherwise the DV and potentially IBEX SW breaks.

I think increasing the memories should touch the same files as in this commit: etterli/opentitan-otbn-pqc-isa@b0ce32d

Comment on lines 800 to 801
Note that DMEM is actually 4kiB in size, but only the first 3kiB of
the memory is visible through this register interface.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TODO: Document the .bss and .scratchpad split
Note that DMEM is actually 32kiB in size, but only the first XkiB of
the memory is visible through this register interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SW:cryptolib Crypto library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants