Skip to content

Commit

Permalink
Add debug messages into Montgomery Modular Exponentiation method.
Browse files Browse the repository at this point in the history
  • Loading branch information
calonso88 committed Apr 14, 2024
1 parent 0b0cda9 commit 7331ceb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ def mem (p, e, m, nbits):
# Mapping
p_int = mmm (const_m, p, m, nbits)
r_int = mmm (const_m, 1, m, nbits)

cocotb.log.info(f"MEM mapping P, R: ( {p_int}, {r_int} )")

idx = 0
while idx < nbits:
if ( ( get_bit(e, idx) >> idx ) == 1 ):
r_int = mmm (r_int, p_int, m, nbits)

p_int = mmm (p_int, p_int, m, nbits)
cocotb.log.info(f"MEM idx, P, R: ( {idx}], {p_int}, {r_int} )")
idx = idx + 1

# Remapping
Expand Down

0 comments on commit 7331ceb

Please sign in to comment.