diff options
author | Pavel V. Shatov (Meister) <meisterpaul1@yandex.ru> | 2017-02-12 22:10:17 +0300 |
---|---|---|
committer | Pavel V. Shatov (Meister) <meisterpaul1@yandex.ru> | 2017-02-12 22:10:17 +0300 |
commit | 747c165611c3016c997e092797bc20a4f900cdea (patch) | |
tree | da11c5d240fc8a54ca37720d6a4ad863720e9c9e /rtl/modular/modular_invertor/modinv_clog2.v |
Initial commit of base point multiplier core for ECDSA curve P-384.
Diffstat (limited to 'rtl/modular/modular_invertor/modinv_clog2.v')
-rw-r--r-- | rtl/modular/modular_invertor/modinv_clog2.v | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rtl/modular/modular_invertor/modinv_clog2.v b/rtl/modular/modular_invertor/modinv_clog2.v new file mode 100644 index 0000000..2f7b64d --- /dev/null +++ b/rtl/modular/modular_invertor/modinv_clog2.v @@ -0,0 +1,10 @@ +function integer clog2;
+ input integer value;
+ integer result;
+ begin
+ value = value - 1;
+ for (result = 0; value > 0; result = result + 1)
+ value = value >> 1;
+ clog2 = result;
+ end
+endfunction
|