From b60df56157ee1fd0bd4938799bac05a62fda91a1 Mon Sep 17 00:00:00 2001 From: lookshe Date: Sat, 14 Mar 2015 20:45:20 +0100 Subject: initial commit from working version --- .../flash-src/com/hurlant/math/ClassicReduction.as | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as (limited to 'signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as') diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as new file mode 100755 index 0000000..ea9f17c --- /dev/null +++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as @@ -0,0 +1,35 @@ +package com.hurlant.math +{ + use namespace bi_internal; + + /** + * Modular reduction using "classic" algorithm + */ + internal class ClassicReduction implements IReduction + { + private var m:BigInteger; + public function ClassicReduction(m:BigInteger) { + this.m = m; + } + public function convert(x:BigInteger):BigInteger { + if (x.s<0 || x.compareTo(m)>=0) { + return x.mod(m); + } + return x; + } + public function revert(x:BigInteger):BigInteger { + return x; + } + public function reduce(x:BigInteger):void { + x.divRemTo(m, null,x); + } + public function mulTo(x:BigInteger, y:BigInteger, r:BigInteger):void { + x.multiplyTo(y,r); + reduce(r); + } + public function sqrTo(x:BigInteger, r:BigInteger):void { + x.squareTo(r); + reduce(r); + } + } +} \ No newline at end of file -- cgit v1.2.3