ADDED LICENSE.txt Index: LICENSE.txt ================================================================== --- /dev/null +++ LICENSE.txt @@ -0,0 +1,27 @@ +Copyright (c) 2010, Thomas Chust +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the author nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ADDED modular-arithmetic.egg Index: modular-arithmetic.egg ================================================================== --- /dev/null +++ modular-arithmetic.egg @@ -0,0 +1,11 @@ +((category math) + (synopsis "Modular Arithmetic on Finite Fields") + (author "Thomas Chust") + (license "BSD") + (version "1.0.3") + (dependencies srfi-1 matchable) + (test-dependencies test) + (components + (extension modular-arithmetic))) + +;; vim: set ai et ts=8 sts=2 sw=2 ft=scheme: ;; DELETED modular-arithmetic.meta Index: modular-arithmetic.meta ================================================================== --- modular-arithmetic.meta +++ /dev/null @@ -1,9 +0,0 @@ -((egg "modular-arithmetic.egg") - (files "modular-arithmetic.setup" "modular-arithmetic.meta" "modular-arithmetic.release-info" "modular-arithmetic.scm" "tests/run.scm") - (needs numbers matchable) - (test-depends test) - (category math) - (synopsis "Modular Arithmetic on Finite Fields") - (author "Thomas Chust") - (doc-from-wiki) - (license "BSD")) ADDED modular-arithmetic.release-info Index: modular-arithmetic.release-info ================================================================== --- /dev/null +++ modular-arithmetic.release-info @@ -0,0 +1,6 @@ +(repo fossil "https://chust.org/repos/chicken-{egg-name}") + +(uri targz "https://chust.org/repos/chicken-{egg-name}/tarball/{egg-name}.tar.gz?uuid=v{egg-release}") +(release "1.0.3") + +;; vim: set ai et ts=8 sts=2 sw=2 ft=scheme: ;; Index: modular-arithmetic.scm ================================================================== --- modular-arithmetic.scm +++ modular-arithmetic.scm @@ -1,31 +1,16 @@ -(require-library - srfi-1 - numbers matchable) - (module modular-arithmetic (xgcd mod+ mod- mod* mod/ modexpt with-modulus) (import - (except scheme - + - * / = > < >= <= - number->string string->number - exp log sin cos tan asin acos atan expt sqrt - quotient modulo remainder numerator denominator - abs max min gcd lcm - positive? negative? odd? even? zero? exact? inexact? - floor ceiling truncate round - inexact->exact exact->inexact - number? complex? real? rational? integer? - real-part imag-part magnitude) - (except chicken - add1 sub1 signum - bitwise-and bitwise-ior bitwise-xor bitwise-not - arithmetic-shift) - srfi-1 - numbers) + scheme + (chicken base) + (chicken bitwise) + srfi-1) (import-for-syntax - scheme chicken matchable) + scheme + (chicken base) + matchable) ;; Extended GCD (define (xgcd a b) (let-values ([(q m) (quotient&modulo a b)]) (if (zero? m) @@ -96,5 +81,7 @@ [/ (,(rename 'mod/) ,~modulus)] [expt (,(rename 'modexpt) ,~modulus)]) ,@body)))])))) ) + +;; vim: set ai et ts=8 sts=2 sw=2 ft=scheme: ;; DELETED modular-arithmetic.setup Index: modular-arithmetic.setup ================================================================== --- modular-arithmetic.setup +++ /dev/null @@ -1,9 +0,0 @@ -(compile -s -O2 -d1 "modular-arithmetic.scm" -j modular-arithmetic) -(compile -c -O2 -d1 "modular-arithmetic.scm" -j modular-arithmetic -unit modular-arithmetic) -(compile -s -O2 -d0 "modular-arithmetic.import.scm") - -(install-extension - 'modular-arithmetic - '("modular-arithmetic.so" "modular-arithmetic.o" "modular-arithmetic.import.so") - '((version 1.0.2) - (static "modular-arithmetic.o"))) Index: tests/run.scm ================================================================== --- tests/run.scm +++ tests/run.scm @@ -1,7 +1,7 @@ -(require-extension - test modular-arithmetic) +(import + modular-arithmetic test) (test-group "Modular Arithmetic" (test "Extended GCD" '(3 -2)