Commit Graph

202 Commits

Author SHA1 Message Date
Mamy André-Ratsimbazafy b9a37825a3
COnsistent IO API between fromRawUint and fromHex and add fromUint 2020-02-09 15:38:30 +01:00
Mamy André-Ratsimbazafy 1d92ab1f48
Remove the limb accessor templates, introduce config file for debug template 2020-02-09 13:02:09 +01:00
Mamy André-Ratsimbazafy ff8b22e1d1
Use file-wide "no exceptions" enforcement 2020-02-09 01:03:06 +01:00
Mamy André-Ratsimbazafy 9db77ad0eb
Prepare for testing finite fields, comment cleanups 2020-02-09 00:52:24 +01:00
Mamy André-Ratsimbazafy edd728610c
Add addition limbs carry test 2020-02-08 19:09:20 +01:00
Mamy André-Ratsimbazafy 2c750cbc5b
Add bigint isZero, and equality and initial tests 2020-02-08 18:50:01 +01:00
Mamy André-Ratsimbazafy 3034c07525
fromHex supports space and underscores 2020-02-08 18:22:19 +01:00
Mamy André-Ratsimbazafy 706678d2ee
Compiler enforced no exceptions 2020-02-08 18:21:47 +01:00
Mamy André-Ratsimbazafy 8da9e20ebb
Cosmetic changes: dumpHex with 0x prefix, montgomery magic part of curve param 2020-02-08 17:03:30 +01:00
Mamy André-Ratsimbazafy 18625cc5ac
Allow compilation of FInite Field and Montgomery domain, workaround showstopper bug: https://github.com/nim-lang/Nim/issues/11142 and #5 2020-02-08 15:33:05 +01:00
Mamy André-Ratsimbazafy bd2b10817e
Add curve configuration + BN254 config (zkSnarks, ZCash, Ethereum 1 precompile) 2020-02-08 14:55:49 +01:00
Mamy André-Ratsimbazafy f18a958d5e
Support 1.0+ int128 (can't use magic for bitnot) 2020-02-08 13:28:43 +01:00
Mamy André-Ratsimbazafy 8229bf384b
Remove specialization for static big int. They will be stored in the binary bss section and passed as ptr + length to save on codesize anyway. 2020-02-08 11:51:17 +01:00
Mamy André-Ratsimbazafy 5dc97927c5
Switch to personal project -> update copyright 2020-02-08 11:42:35 +01:00
Mamy André-Ratsimbazafy c4b3d49e69
Allow constant time booleans init from constant time uints 2019-04-29 23:17:56 +02:00
Mamy André-Ratsimbazafy cadd81b978
Add hex conversion 2019-04-28 17:42:30 +02:00
Mamy André-Ratsimbazafy 007c5e3071
Fix booleans initialization 2019-04-28 14:12:46 +02:00
Mamy André-Ratsimbazafy 08e12df4ed
internal proc renaming 2019-04-28 14:05:13 +02:00
Bruno Škvorc 3e9a03fc02
Update README.md 2019-01-02 15:09:55 +01:00
mratsim 411e40b843 use CtTrueCtFalse instead of True/False for alias of the constant time bool 2018-12-03 21:10:36 +01:00
Mamy Ratsimbazafy 6eaa24e91b
Merge pull request #3 from status-im/bigInt-dump
Big int dump
2018-12-03 21:03:21 +01:00
mratsim 059439b2c3 fix little-endian parsing 2018-12-03 21:01:29 +01:00
mratsim 2856378427 [IO] dumping 2^63 works 2018-12-03 19:56:14 +01:00
mratsim df72a0896b initial implementation of bigInt dump 2018-12-02 22:18:17 +01:00
mratsim 43ac4972a0 Add constant-time raw bytes/integers parsing 2018-12-02 20:57:32 +01:00
mratsim b496f57c68 Replace HighLimb by MaxWord as well 2018-12-02 19:32:52 +01:00
mratsim 9b1dc4ca30 Replace Limb terminology by Word 2018-12-02 19:30:17 +01:00
mratsim 27e2d2d2bc Implement to Montgomery domain conversion 2018-12-02 19:28:42 +01:00
mratsim 22d8bc218d Implement scale accumulate 2018-12-02 19:08:21 +01:00
mratsim c226987ab0 Add extended precision multiplication 2018-12-02 18:14:32 +01:00
mratsim 057ce0cbf9 Implement fused multiply add modular multiplication for single limb "bigint". TODO fallback from assembly. 2018-12-02 16:32:38 +01:00
mratsim 408bc9b6f3 Introduce convention, all for loop should have an explicit static range 2018-12-02 13:01:54 +01:00
mratsim 71e5b576c4 Fix mod inverse 2^k nb of iterations 2018-12-02 12:59:46 +01:00
mratsim 67d038c650 Implement modular inverse mod 2^k for Montgomery multiplication 2018-12-02 03:45:13 +01:00
mratsim befbf30319 Add modular addition over Fp 2018-12-02 00:35:55 +01:00
mratsim 463b8a4fcb use `add` instead of `madd` even though it mutates 2018-12-01 23:28:35 +01:00
mratsim d09116d0a9 Add big int in-place addition and substraction 2018-12-01 23:26:03 +01:00
mratsim eb15fb33b5 Rebrand to Constantine. Bigints representation should stay opaque. Exporting just the word_types would make a super small library. 2018-12-01 20:12:05 +01:00
mratsim cae9f743d3 Add more tests for multiplexer 2018-12-01 18:03:52 +01:00
mratsim d545147b0b Use distinct range for Hardened booleans + first select test 2018-12-01 18:01:41 +01:00
mratsim 8d6e328397 Add boolean not and comparison tests 2018-12-01 17:32:08 +01:00
mratsim acd06e1174 Add unary minus test 2018-12-01 17:04:55 +01:00
mratsim 9815047234 Add shifts and operators test 2018-12-01 16:49:45 +01:00
mratsim b43e289780 Initial tests for bitwise operator 2018-12-01 16:32:21 +01:00
mratsim 1cc299e82e Add MSB, cmp to zero and init primitives 2018-12-01 15:54:29 +01:00
Jacek Sieka 1b0ffe25cf
appveyor: fix version check 2018-09-06 12:07:02 -06:00
Jacek Sieka 28c4b2cf98
readme: update license 2018-09-05 12:47:55 -06:00
Jacek Sieka 97ec36f447
ci: update
readme: fix badges, license
tests: fix
nimble: add description
2018-09-04 22:38:34 -06:00
Jacek Sieka 78d8a628e2
travis: use cached nim instead of docker 2018-09-02 21:02:08 -06:00
mratsim 12cc5dcad8 Fix primitive types, add bitwise, shift, add, sub and constant time comparison 2018-08-05 15:07:35 +02:00