Commit Graph

40 Commits

Author SHA1 Message Date
mratsim 2b47647019 Force checking sizes at compile-time 2018-03-26 17:39:34 +02:00
mratsim 49b3ee1006 Make the tests green again 2018-03-26 16:47:04 +02:00
mratsim 3e84c7e697 Benchmark was slowed down by Nim adding GenericResetAux 2018-03-26 16:16:07 +02:00
mratsim 34b25fd697 faster isZero 2018-03-26 16:09:31 +02:00
mratsim a809768854 Fix https://github.com/status-im/mpint/issues/7 17% speedup on modular division 2018-03-26 16:05:19 +02:00
mratsim f1935fd673 Improve speed by 90% by inline shr/shl 2018-03-26 14:46:38 +02:00
mratsim 0e7ecaef7a Add bench of modulo op 2018-03-26 12:50:50 +02:00
mratsim c65ab16512 Conversion fixes for <uint64. Also closes #4 and #5 2018-03-26 12:45:10 +02:00
mratsim 98b2086262 Use Status docker for continuous integration 2018-03-26 11:48:21 +02:00
Mamy Ratsimbazafy 3a1e5b1151
Make bits part of type (#6)
* Small reorg of conversion proc

* Rework with bits as type. Pass endianess test

* tests_comparison compiles and succeed

* Fix init with int for mpint_test compilation flag

* All tests green 🔥
2018-03-26 11:46:24 +02:00
mratsim 8b8f2a55c4 Relicense under dual Apache/MIT 2018-03-02 11:48:08 +01:00
mratsim fb2659703d Update License badge to Apache 2018-03-02 11:33:57 +01:00
Zahary Karadjov a9f51539b8 Set license to Apache v2 2018-02-27 19:37:29 +02:00
mratsim f53f7bd33a Missing overflow carry in multiplication (todo need test) 2018-02-27 13:40:18 +01:00
mratsim 8865ab874f init from uint of the same size 2018-02-17 18:32:23 +01:00
mratsim f06c02cf2a 5% more speed to divmod 2018-02-17 17:57:26 +01:00
mratsim 6fd471f243 Add division test + consistent Subtype conversion use 2018-02-17 12:44:51 +01:00
mratsim ac902b2a23 20% divmod improvement by using GCC Clang builtins when possible 2018-02-17 12:02:51 +01:00
mratsim 00040e4d38 45% faster division with 45% faster shifts (and maintainable). Fixes #1 2018-02-17 01:11:18 +01:00
mratsim 43cb3441bc Division/modulo 2x faster by removing shift in MpUint bit_length 2018-02-17 00:47:17 +01:00
mratsim 1c5da77a29 Add divmod i.e. division + modulo done! 2018-02-16 22:17:13 +01:00
mratsim a8f50c4dbe small quality of life fix + auto conversion of booleans 2018-02-16 21:07:51 +01:00
mratsim 834ff19a25 Add comparison operators + tests + fix shr forward declaration 2018-02-16 17:48:54 +01:00
mratsim f044d8a476 Add note about branchless shift being cryptographically preferable 2018-02-16 17:02:09 +01:00
mratsim 5886d76ebc Add alternative branchless shift implementation (TODO benchmark on ARM) 2018-02-16 16:47:52 +01:00
mratsim 6e27069298 less branching for shift ops 2018-02-16 14:30:07 +01:00
mratsim 35e80263a3 Add shift operators (WIP recursive implementation is slow) 2018-02-16 13:54:38 +01:00
mratsim cec8a752fb Fix shift by bytes/bit in multiplication (need tests) 2018-02-16 13:54:03 +01:00
mratsim 71d1f5bd19 Update README with build status 2018-02-16 11:48:56 +01:00
mratsim cd7929f187 Add continuous integration 2018-02-16 11:45:45 +01:00
mratsim f861af840a Use Nim input convention x, y instead of a,b 2018-02-16 11:38:48 +01:00
mratsim 32efae91ee add basic logical operations 2018-02-16 11:33:11 +01:00
mratsim 994be7fa61 We aren't using Karatsuba actually but school-grade naive mul 2018-02-16 11:01:03 +01:00
mratsim d60419a731 Karatsuba: shift constant was hardcoded + Add full overflow tests 2018-02-16 09:40:21 +01:00
mratsim 02be5c3e90 [WIP] Add multiplication with Karatsuba algorithm + basic test 2018-02-16 09:22:23 +01:00
mratsim 4d7d5897cd Add substraction implementation 2018-02-15 23:28:31 +01:00
mratsim fc6483d42e Implement addition (including proper overflow behaviour) 2018-02-15 20:26:10 +01:00
mratsim 839123b2a4 use C backend by default for testing 2018-02-15 15:09:58 +01:00
mratsim 6f77899709 Add basic data structure, initialization and endianess test 2018-02-15 15:01:08 +01:00
mratsim 364e11cf28 initial commit 2018-02-15 13:11:01 +01:00