mako 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/mako +133 -0
- data/lib/mako/build.rb +336 -0
- data/lib/mako/data/flash_widget_dev_core/Dependencies.txt +10 -0
- data/lib/mako/data/flash_widget_dev_core/libs/Degrafa_.2.11.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/KogneatoGraphics.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/KogneatoSymbols.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/libs/flash.swc +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/images/RichTextEditor.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/ARLRDBD.TTF +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/FTD_____.TTF +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdana.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanab.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanai.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/fonts/verdanaz.ttf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/DefaultError.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barbgfill.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/barshadow.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bold.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/bullets.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/center.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/close-x.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/fullscreenPopup_close.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc2.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/mc3.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/qa.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/gameTypeIcons/so.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/importIcon.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/italic.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/justify.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/kogLogo.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/left.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-href.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-pagelink.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-delete.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip-edit.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/oml-tooltip.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/pencil.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/right.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/underline.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/creatorStyle.css +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/styles/style.css +929 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/embeddedfonts.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/helpBubble.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/assets/materia/swf/videobg.swf +0 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/LICENSE.txt +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/CubeRotate.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Distortion.as +168 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/DistortionConstants.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Door.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Flip.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Gate.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Pop.as +53 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/Push.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/SimpleDistortion.as +619 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/CubeRotateInstance.as +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DistortBaseInstance.as +258 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/DoorInstance.as +116 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/FlipInstance.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/GateInstance.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PopInstance.as +91 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/mxeffects/effectClasses/PushInstance.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBounds.as +64 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/DisplayObjectBoundsUtil.as +42 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/ac/util/SimpleDisplayObjectBoundsUtil.as +60 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/HMAC.as +108 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5.as +250 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/MD5Stream.as +343 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA1.as +250 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA224.as +226 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/SHA256.as +229 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/crypto/WSSEUsernameToken.as +100 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFade.as +107 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadeInstance.as +178 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/effects/SaturationFadePopUpBlocker.as +88 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/errors/IllegalStateError.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Address.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Email.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/Phone.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCard.as +47 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/fileformats/vcard/VCardParser.as +234 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/BitString.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/JPGEncoder.as +584 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/images/PNGEncoder.as +133 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/DynamicURLLoader.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/IURIResolver.as +70 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/MimeTypeMap.as +192 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URI.as +2139 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/URIEncodingBitmap.as +122 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/net/proxies/RFC2817Socket.as +179 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Database.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Definition.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Dict.as +322 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/DictionaryServer.as +50 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/MatchStrategy.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/Response.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ConnectedEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DatabaseEvent.as +54 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DefinitionHeaderEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DictionaryServerEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/DisconnectedEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/ErrorEvent.as +64 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchEvent.as +54 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/MatchStrategiesEvent.as +56 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/events/NoMatchEvent.as +44 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/CompleteResponseEvent.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/protocols/dict/util/SocketHelper.as +70 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSON.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONDecoder.as +303 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONEncoder.as +277 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONParseError.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONToken.as +79 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenType.as +49 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/serialization/json/JSONTokenizer.as +605 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/ArrayUtil.as +166 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DateUtil.as +657 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/DictionaryUtil.as +73 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/IntUtil.as +85 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/NumberFormatter.as +63 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/StringUtil.as +220 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/utils/XMLUtil.as +148 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/ServiceBase.as +39 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/URLLoaderBase.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/adobe/webapis/events/ServiceEvent.as +67 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/geom/ColorMatrix.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTween.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweenTimeline.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/GTweener.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Back.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Bounce.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Circular.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Cubic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Elastic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Exponential.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Linear.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quadratic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quartic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Quintic.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/easing/Sine.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/AutoHidePlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/BlurPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorAdjustPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/ColorTransformPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/CurrentFramePlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/IGTweenPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MatrixPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/MotionBlurPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SmartRotationPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SnappingPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/motion/plugins/SoundTransformPlugin.as +1 -0
- data/lib/mako/data/flash_widget_dev_core/src/com/gskinner/utils/SWFBridgeAS3.as +83 -0
- data/lib/mako/data/flash_widget_dev_core/src/etc/GUID.as +82 -0
- data/lib/mako/data/flash_widget_dev_core/src/etc/MathExt.as +114 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/OverwriteManager.as +143 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenFilterLite.as +502 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenLite.as +512 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/TweenMax.as +987 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Back.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Bounce.as +22 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Circ.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Cubic.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Elastic.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Expo.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Linear.as +16 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quad.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quart.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Quint.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Sine.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/Strong.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/easing/easing_readme.txt +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/events/TweenEvent.as +26 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BevelFilterVars.as +63 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/BlurFilterVars.as +42 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/ColorMatrixFilterVars.as +86 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/DropShadowFilterVars.as +66 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/GlowFilterVars.as +57 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenFilterLiteVars.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenLiteVars.as +269 -0
- data/lib/mako/data/flash_widget_dev_core/src/gs/utils/tween/TweenMaxVars.as +103 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenEvent.as +17 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenObject.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/TweenSingleton.as +86 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Constant.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlow.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/FastSlowFast.as +8 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/Shake.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFast.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/it/animation/methods/SlowFastSlow.as +8 -0
- data/lib/mako/data/flash_widget_dev_core/src/jac/image/ImageUtils.as +173 -0
- data/lib/mako/data/flash_widget_dev_core/src/jac/image/ResizeStyle.as +52 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorBase.mxml +504 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorConfig.as +45 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/CreatorEvents.as +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/Dialog.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/MateriaButton.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/PopUpAlert.mxml +271 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/GradientBackground.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/PercentField.mxml +104 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/ScrollableSizableImage.mxml +654 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextAreaWithDefaultText.mxml +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/TextInputWithDefaultText.mxml +94 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/VertCenterTextRenderer.mxml +37 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/ImportEvent.as +22 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/itemRenderers/CheckBoxColumn.mxml +23 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDetails.mxml +68 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionDisplay.mxml +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGrid.mxml +247 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/importer/questions/QuestionsDataGridEvent.as +20 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerColumn.as +13 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/QuestionAnswerDataGrid.mxml +692 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputItem.mxml +584 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/questionAnswerDataGrid/TextInputObject.as +28 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/KogneatoToolTip.as +196 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/components/toolTips/TipManager.as +150 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpBubble.mxml +245 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpDot.mxml +21 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpManager.as +92 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/HelpObject.as +33 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/help/IHelpGuided.as +7 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/media/ImageCacherImage.mxml +56 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/media/MateriaUploader.as +61 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/Question.as +386 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionGroup.as +313 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/questionStorage/QuestionSet.as +21 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/KogneatoToolTip.as +196 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/toolTips/TipManager.as +150 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/CommonUtils.as +186 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/DateUtils.as +273 -0
- data/lib/mako/data/flash_widget_dev_core/src/materia/utils/ImageCacher.as +93 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/Randomize.as +19 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/arrays/SimpleClone.as +32 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Color.as +102 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/Draw.as +65 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dashed.as +48 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/lines/Dotted.as +83 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Check.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/Rect.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBevel.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectBorder.as +39 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRound.as +33 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/RectRoundBorder.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/TriangleEquilateral.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/draw/shapes/X.as +28 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/errors/ScoringError.as +10 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/errors/StorageError.as +10 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/ButtonEvent.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/PayloadEvent.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/events/StandardEvent.as +26 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/Question.as +72 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionGroup.as +87 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/QuestionSet.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/WidgetSettings.as +14 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerEvents.as +17 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/coms/ServerMessageEvent.as +31 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/logging/Log.as +92 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/scoring/Scoring.as +87 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageManager.as +91 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/common/storage/StorageTable.as +72 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/gameServ/engines/EngineCore.as +222 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/geom/Dimension.as +76 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/Respondus.as +612 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusAnswer.as +11 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusError.as +18 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuestion.as +43 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/respondus/RespondusQuiz.as +68 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/AlertWindow.as +182 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/BlueButton.as +102 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button.as +88 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Button_base.as +168 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Component.as +98 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ContentBlocker.as +38 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FlexUIScaler.as +59 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/FormInput.as +191 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/GrabZoomClip.as +305 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/HelpLayer.as +55 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Label.as +25 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List.as +62 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/List_Base.as +644 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProcessingBar.as +112 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar.as +35 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ProgressBar_base.as +69 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollBar_base.as +378 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollClip.as +468 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText.as +29 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ScrollText_base.as +295 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/SimpleScrollBar.as +247 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StageRef.as +34 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTank.as +233 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/StorageTankHorizontal.as +109 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/ToolTip.as +930 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/TweeningDragDropBankList.as +503 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window.as +144 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/Window_base.as +385 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/CenterScale.as +27 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowManager.as +163 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/ui/layout/WindowStage.as +96 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/BitField.as +99 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/ObjPeek.as +148 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/Objects.as +49 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/Printer.as +548 -0
- data/lib/mako/data/flash_widget_dev_core/src/nm/util/StringUtil.as +12 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/FaultEvent.as +37 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingCall.as +211 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingConnection.as +41 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/RemotingService.as +214 -0
- data/lib/mako/data/flash_widget_dev_core/src/org/rubyamf/remoting/ssr/ResultEvent.as +36 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/DistortImage.as +281 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/SandyPoint.as +29 -0
- data/lib/mako/data/flash_widget_dev_core/src/sandy/util/Triangle.as +32 -0
- data/lib/mako/data/html/thistest.html +0 -0
- data/lib/mako/data/template_creator/src/Creator.mxml +138 -0
- data/lib/mako/data/template_creator/src/assets/images/RichTextEditor.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/DefaultError.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/barbgfill.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/barshadow.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/bold.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/bullets.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/center.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/close-x.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/fullscreenPopup_close.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/importIcon.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/italic.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/justify.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/left.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-href-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-href.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-pagelink.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-delete.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-disabled.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip-edit.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/oml-tooltip.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/pencil.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/right.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/underline.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPauseButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerPlayButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/images/videoPlayerSoundButton_over.png +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/styles/creatorStyle.css +63 -0
- data/lib/mako/data/template_creator/src/assets/materia/styles/style.css +1127 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/embeddedfonts.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/helpBubble.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/kogneatoSymbols.swf +0 -0
- data/lib/mako/data/template_creator/src/assets/materia/swf/videobg.swf +0 -0
- data/lib/mako/data/template_creator/src/components/SmallRichTextEditor.mxml +678 -0
- data/lib/mako/data/template_creator/src/components/SmallRichTextEditorToolbar.mxml +133 -0
- data/lib/mako/data/templates/html/README.md +11 -0
- data/lib/mako/data/templates/html/_creator/build.yaml +12 -0
- data/lib/mako/data/templates/html/_creator/creator.html +19 -0
- data/lib/mako/data/templates/html/_creator/css/creator.less +29 -0
- data/lib/mako/data/templates/html/_creator/js/creator.coffee +122 -0
- data/lib/mako/data/templates/html/_creator/test.html +0 -0
- data/lib/mako/data/templates/html/_engine/build.yaml +12 -0
- data/lib/mako/data/templates/html/_engine/css/widget.scss +18 -0
- data/lib/mako/data/templates/html/_engine/js/widget.coffee +143 -0
- data/lib/mako/data/templates/html/_engine/widget.html +21 -0
- data/lib/mako/data/templates/html/_icons/icon-275.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-394.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-60.png +0 -0
- data/lib/mako/data/templates/html/_icons/icon-92.png +0 -0
- data/lib/mako/data/templates/html/_score/score_module.php +48 -0
- data/lib/mako/data/templates/html/_score/test_score_module.php +157 -0
- data/lib/mako/data/templates/html/_screen-shots/1-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/1.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/2-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/2.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/3-thumb.png +0 -0
- data/lib/mako/data/templates/html/_screen-shots/3.png +0 -0
- data/lib/mako/data/templates/html/build.yaml +4 -0
- data/lib/mako/data/templates/html/demo.yaml +7 -0
- data/lib/mako/data/templates/html/install.yaml +94 -0
- data/lib/mako/path.rb +48 -0
- data/lib/mako/scaffold.rb +69 -0
- metadata +597 -0
@@ -0,0 +1,343 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
3
|
+
All rights reserved.
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are
|
6
|
+
met:
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
11
|
+
documentation and/or other materials provided with the distribution.
|
12
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
13
|
+
contributors may be used to endorse or promote products derived from
|
14
|
+
this software without specific prior written permission.
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
16
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
17
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
18
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
19
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
20
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
22
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
23
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
24
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
*/
|
27
|
+
package com.adobe.crypto
|
28
|
+
{
|
29
|
+
import com.adobe.utils.IntUtil;
|
30
|
+
import flash.utils.ByteArray;
|
31
|
+
/**
|
32
|
+
* Perform MD5 hash of an input stream in chunks. This class is
|
33
|
+
* based on com.adobe.crypto.MD5 and can process data in
|
34
|
+
* chunks. Both block creation and hash computation are done
|
35
|
+
* together for whatever input is available so that the memory
|
36
|
+
* overhead at a time is always fixed. Memory usage is governed by
|
37
|
+
* two parameters: one is the amount of data passed in to update()
|
38
|
+
* and the other is memoryBlockSize. The latter comes into play
|
39
|
+
* only when the memory window exceeds the pre allocated memory
|
40
|
+
* window of flash player. Usage: create an instance, call
|
41
|
+
* update(data) repeatedly for all chunks and finally complete()
|
42
|
+
* which will return the md5 hash.
|
43
|
+
*/
|
44
|
+
public class MD5Stream
|
45
|
+
{
|
46
|
+
private static var mask:int = 0xFF;
|
47
|
+
private var arr:Array = [];
|
48
|
+
/* running count of length */
|
49
|
+
private var arrLen:int;
|
50
|
+
// initialize the md buffers
|
51
|
+
private var a:int = 1732584193;
|
52
|
+
private var b:int = -271733879;
|
53
|
+
private var c:int = -1732584194;
|
54
|
+
private var d:int = 271733878;
|
55
|
+
// variables to store previous values
|
56
|
+
private var aa:int;
|
57
|
+
private var bb:int;
|
58
|
+
private var cc:int;
|
59
|
+
private var dd:int;
|
60
|
+
/* index for data read */
|
61
|
+
private var arrIndexLen:int = 0;
|
62
|
+
/* index for hash computation */
|
63
|
+
private var arrProcessIndex:int = 0;
|
64
|
+
/* index for removing stale arr values */
|
65
|
+
private var cleanIndex:int = 0;
|
66
|
+
/**
|
67
|
+
* Change this value from the default (16384) in the range of
|
68
|
+
* MBs to actually affect GC as GC allocates in pools of
|
69
|
+
* memory */
|
70
|
+
public var memoryBlockSize:int = 16384;
|
71
|
+
public function MD5Stream()
|
72
|
+
{
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* Pass in chunks of the input data with update(), call
|
76
|
+
* complete() with an optional chunk which will return the
|
77
|
+
* final hash. Equivalent to the way
|
78
|
+
* java.security.MessageDigest works.
|
79
|
+
*
|
80
|
+
* @param input The optional bytearray chunk which is the final part of the input
|
81
|
+
* @return A string containing the hash value
|
82
|
+
* @langversion ActionScript 3.0
|
83
|
+
* @playerversion Flash 8.5
|
84
|
+
* @tiptext
|
85
|
+
*/
|
86
|
+
public function complete(input:ByteArray=null):String
|
87
|
+
{
|
88
|
+
if ( arr.length == 0 )
|
89
|
+
{
|
90
|
+
if ( input == null )
|
91
|
+
{
|
92
|
+
throw new Error("null input to complete without prior call to update. At least an empty bytearray must be passed.");
|
93
|
+
}
|
94
|
+
}
|
95
|
+
if ( input != null )
|
96
|
+
{
|
97
|
+
readIntoArray(input);
|
98
|
+
}
|
99
|
+
//pad, append length
|
100
|
+
padArray(arrLen);
|
101
|
+
hashRemainingChunks(false);
|
102
|
+
var res:String = IntUtil.toHex( a ) + IntUtil.toHex( b ) +
|
103
|
+
IntUtil.toHex( c ) + IntUtil.toHex( d );
|
104
|
+
resetFields();
|
105
|
+
return res;
|
106
|
+
}
|
107
|
+
/**
|
108
|
+
* Pass in chunks of the input data with update(), call
|
109
|
+
* complete() with an optional chunk which will return the
|
110
|
+
* final hash. Equivalent to the way
|
111
|
+
* java.security.MessageDigest works.
|
112
|
+
*
|
113
|
+
* @param input The bytearray chunk to perform the hash on
|
114
|
+
* @langversion ActionScript 3.0
|
115
|
+
* @playerversion Flash 8.5
|
116
|
+
* @tiptext
|
117
|
+
*/
|
118
|
+
public function update(input:ByteArray):void
|
119
|
+
{
|
120
|
+
readIntoArray(input);
|
121
|
+
hashRemainingChunks();
|
122
|
+
}
|
123
|
+
/**
|
124
|
+
* Re-initialize this instance for use to perform hashing on
|
125
|
+
* another input stream. This is called automatically by
|
126
|
+
* complete().
|
127
|
+
*
|
128
|
+
* @langversion ActionScript 3.0
|
129
|
+
* @playerversion Flash 8.5
|
130
|
+
* @tiptext
|
131
|
+
*/
|
132
|
+
public function resetFields():void
|
133
|
+
{
|
134
|
+
//truncate array
|
135
|
+
arr.length = 0;
|
136
|
+
arrLen = 0;
|
137
|
+
// initialize the md buffers
|
138
|
+
a = 1732584193;
|
139
|
+
b = -271733879;
|
140
|
+
c = -1732584194;
|
141
|
+
d = 271733878;
|
142
|
+
// variables to store previous values
|
143
|
+
aa = 0;
|
144
|
+
bb = 0;
|
145
|
+
cc = 0;
|
146
|
+
dd = 0;
|
147
|
+
arrIndexLen = 0;
|
148
|
+
arrProcessIndex = 0;
|
149
|
+
cleanIndex = 0;
|
150
|
+
}
|
151
|
+
/** read into arr and free up used blocks of arr */
|
152
|
+
private function readIntoArray(input:ByteArray):void
|
153
|
+
{
|
154
|
+
var closestChunkLen:int = input.length * 8;
|
155
|
+
arrLen += closestChunkLen;
|
156
|
+
/* clean up memory. if there are entries in the array that
|
157
|
+
* are already processed and the amount is greater than
|
158
|
+
* memoryBlockSize, create a new array, copy the last
|
159
|
+
* block into it and let the old one get picked up by
|
160
|
+
* GC. */
|
161
|
+
if ( arrProcessIndex - cleanIndex > memoryBlockSize )
|
162
|
+
{
|
163
|
+
var newarr:Array= new Array();
|
164
|
+
/* AS Arrays in sparse arrays. arr[2002] can exist
|
165
|
+
* without values for arr[0] - arr[2001] */
|
166
|
+
for ( var j:int = arrProcessIndex; j < arr.length; j++ )
|
167
|
+
{
|
168
|
+
newarr[j] = arr[j];
|
169
|
+
}
|
170
|
+
cleanIndex = arrProcessIndex;
|
171
|
+
arr = null;
|
172
|
+
arr = newarr;
|
173
|
+
}
|
174
|
+
for ( var k:int = 0; k < closestChunkLen; k+=8 )
|
175
|
+
{
|
176
|
+
//discard high bytes (convert to uint)
|
177
|
+
arr[ int(arrIndexLen >> 5) ] |= ( input[ k / 8 ] & mask ) << ( arrIndexLen % 32 );
|
178
|
+
arrIndexLen += 8;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
private function hashRemainingChunks(bUpdate:Boolean=true):void
|
182
|
+
{
|
183
|
+
var len:int = arr.length;
|
184
|
+
/* leave a 16 word block untouched if we are called from
|
185
|
+
* update. This is because, padArray() can modify the last
|
186
|
+
* block and this modification has to happen before we
|
187
|
+
* compute the hash. */
|
188
|
+
if ( bUpdate )
|
189
|
+
{
|
190
|
+
len -= 16;
|
191
|
+
}
|
192
|
+
/* don't do anything if don't have a 16 word block. */
|
193
|
+
if ( arrProcessIndex >= len || len - arrProcessIndex < 15 )
|
194
|
+
{
|
195
|
+
return;
|
196
|
+
}
|
197
|
+
for ( var i:int = arrProcessIndex; i < len ; i += 16, arrProcessIndex += 16)
|
198
|
+
{
|
199
|
+
// save previous values
|
200
|
+
aa = a;
|
201
|
+
bb = b;
|
202
|
+
cc = c;
|
203
|
+
dd = d;
|
204
|
+
// Round 1
|
205
|
+
a = ff( a, b, c, d, arr[int(i+ 0)], 7, -680876936 ); // 1
|
206
|
+
d = ff( d, a, b, c, arr[int(i+ 1)], 12, -389564586 ); // 2
|
207
|
+
c = ff( c, d, a, b, arr[int(i+ 2)], 17, 606105819 ); // 3
|
208
|
+
b = ff( b, c, d, a, arr[int(i+ 3)], 22, -1044525330 ); // 4
|
209
|
+
a = ff( a, b, c, d, arr[int(i+ 4)], 7, -176418897 ); // 5
|
210
|
+
d = ff( d, a, b, c, arr[int(i+ 5)], 12, 1200080426 ); // 6
|
211
|
+
c = ff( c, d, a, b, arr[int(i+ 6)], 17, -1473231341 ); // 7
|
212
|
+
b = ff( b, c, d, a, arr[int(i+ 7)], 22, -45705983 ); // 8
|
213
|
+
a = ff( a, b, c, d, arr[int(i+ 8)], 7, 1770035416 ); // 9
|
214
|
+
d = ff( d, a, b, c, arr[int(i+ 9)], 12, -1958414417 ); // 10
|
215
|
+
c = ff( c, d, a, b, arr[int(i+10)], 17, -42063 ); // 11
|
216
|
+
b = ff( b, c, d, a, arr[int(i+11)], 22, -1990404162 ); // 12
|
217
|
+
a = ff( a, b, c, d, arr[int(i+12)], 7, 1804603682 ); // 13
|
218
|
+
d = ff( d, a, b, c, arr[int(i+13)], 12, -40341101 ); // 14
|
219
|
+
c = ff( c, d, a, b, arr[int(i+14)], 17, -1502002290 ); // 15
|
220
|
+
b = ff( b, c, d, a, arr[int(i+15)], 22, 1236535329 ); // 16
|
221
|
+
// Round 2
|
222
|
+
a = gg( a, b, c, d, arr[int(i+ 1)], 5, -165796510 ); // 17
|
223
|
+
d = gg( d, a, b, c, arr[int(i+ 6)], 9, -1069501632 ); // 18
|
224
|
+
c = gg( c, d, a, b, arr[int(i+11)], 14, 643717713 ); // 19
|
225
|
+
b = gg( b, c, d, a, arr[int(i+ 0)], 20, -373897302 ); // 20
|
226
|
+
a = gg( a, b, c, d, arr[int(i+ 5)], 5, -701558691 ); // 21
|
227
|
+
d = gg( d, a, b, c, arr[int(i+10)], 9, 38016083 ); // 22
|
228
|
+
c = gg( c, d, a, b, arr[int(i+15)], 14, -660478335 ); // 23
|
229
|
+
b = gg( b, c, d, a, arr[int(i+ 4)], 20, -405537848 ); // 24
|
230
|
+
a = gg( a, b, c, d, arr[int(i+ 9)], 5, 568446438 ); // 25
|
231
|
+
d = gg( d, a, b, c, arr[int(i+14)], 9, -1019803690 ); // 26
|
232
|
+
c = gg( c, d, a, b, arr[int(i+ 3)], 14, -187363961 ); // 27
|
233
|
+
b = gg( b, c, d, a, arr[int(i+ 8)], 20, 1163531501 ); // 28
|
234
|
+
a = gg( a, b, c, d, arr[int(i+13)], 5, -1444681467 ); // 29
|
235
|
+
d = gg( d, a, b, c, arr[int(i+ 2)], 9, -51403784 ); // 30
|
236
|
+
c = gg( c, d, a, b, arr[int(i+ 7)], 14, 1735328473 ); // 31
|
237
|
+
b = gg( b, c, d, a, arr[int(i+12)], 20, -1926607734 ); // 32
|
238
|
+
// Round 3
|
239
|
+
a = hh( a, b, c, d, arr[int(i+ 5)], 4, -378558 ); // 33
|
240
|
+
d = hh( d, a, b, c, arr[int(i+ 8)], 11, -2022574463 ); // 34
|
241
|
+
c = hh( c, d, a, b, arr[int(i+11)], 16, 1839030562 ); // 35
|
242
|
+
b = hh( b, c, d, a, arr[int(i+14)], 23, -35309556 ); // 36
|
243
|
+
a = hh( a, b, c, d, arr[int(i+ 1)], 4, -1530992060 ); // 37
|
244
|
+
d = hh( d, a, b, c, arr[int(i+ 4)], 11, 1272893353 ); // 38
|
245
|
+
c = hh( c, d, a, b, arr[int(i+ 7)], 16, -155497632 ); // 39
|
246
|
+
b = hh( b, c, d, a, arr[int(i+10)], 23, -1094730640 ); // 40
|
247
|
+
a = hh( a, b, c, d, arr[int(i+13)], 4, 681279174 ); // 41
|
248
|
+
d = hh( d, a, b, c, arr[int(i+ 0)], 11, -358537222 ); // 42
|
249
|
+
c = hh( c, d, a, b, arr[int(i+ 3)], 16, -722521979 ); // 43
|
250
|
+
b = hh( b, c, d, a, arr[int(i+ 6)], 23, 76029189 ); // 44
|
251
|
+
a = hh( a, b, c, d, arr[int(i+ 9)], 4, -640364487 ); // 45
|
252
|
+
d = hh( d, a, b, c, arr[int(i+12)], 11, -421815835 ); // 46
|
253
|
+
c = hh( c, d, a, b, arr[int(i+15)], 16, 530742520 ); // 47
|
254
|
+
b = hh( b, c, d, a, arr[int(i+ 2)], 23, -995338651 ); // 48
|
255
|
+
// Round 4
|
256
|
+
a = ii( a, b, c, d, arr[int(i+ 0)], 6, -198630844 ); // 49
|
257
|
+
d = ii( d, a, b, c, arr[int(i+ 7)], 10, 1126891415 ); // 50
|
258
|
+
c = ii( c, d, a, b, arr[int(i+14)], 15, -1416354905 ); // 51
|
259
|
+
b = ii( b, c, d, a, arr[int(i+ 5)], 21, -57434055 ); // 52
|
260
|
+
a = ii( a, b, c, d, arr[int(i+12)], 6, 1700485571 ); // 53
|
261
|
+
d = ii( d, a, b, c, arr[int(i+ 3)], 10, -1894986606 ); // 54
|
262
|
+
c = ii( c, d, a, b, arr[int(i+10)], 15, -1051523 ); // 55
|
263
|
+
b = ii( b, c, d, a, arr[int(i+ 1)], 21, -2054922799 ); // 56
|
264
|
+
a = ii( a, b, c, d, arr[int(i+ 8)], 6, 1873313359 ); // 57
|
265
|
+
d = ii( d, a, b, c, arr[int(i+15)], 10, -30611744 ); // 58
|
266
|
+
c = ii( c, d, a, b, arr[int(i+ 6)], 15, -1560198380 ); // 59
|
267
|
+
b = ii( b, c, d, a, arr[int(i+13)], 21, 1309151649 ); // 60
|
268
|
+
a = ii( a, b, c, d, arr[int(i+ 4)], 6, -145523070 ); // 61
|
269
|
+
d = ii( d, a, b, c, arr[int(i+11)], 10, -1120210379 ); // 62
|
270
|
+
c = ii( c, d, a, b, arr[int(i+ 2)], 15, 718787259 ); // 63
|
271
|
+
b = ii( b, c, d, a, arr[int(i+ 9)], 21, -343485551 ); // 64
|
272
|
+
a += aa;
|
273
|
+
b += bb;
|
274
|
+
c += cc;
|
275
|
+
d += dd;
|
276
|
+
}
|
277
|
+
}
|
278
|
+
private function padArray(len:int):void
|
279
|
+
{
|
280
|
+
arr[ int(len >> 5) ] |= 0x80 << ( len % 32 );
|
281
|
+
arr[ int(( ( ( len + 64 ) >>> 9 ) << 4 ) + 14) ] = len;
|
282
|
+
arrLen = arr.length;
|
283
|
+
}
|
284
|
+
/* Code below same as com.adobe.crypto.MD5 */
|
285
|
+
/**
|
286
|
+
* Auxiliary function f as defined in RFC
|
287
|
+
*/
|
288
|
+
private static function f( x:int, y:int, z:int ):int {
|
289
|
+
return ( x & y ) | ( (~x) & z );
|
290
|
+
}
|
291
|
+
/**
|
292
|
+
* Auxiliary function g as defined in RFC
|
293
|
+
*/
|
294
|
+
private static function g( x:int, y:int, z:int ):int {
|
295
|
+
return ( x & z ) | ( y & (~z) );
|
296
|
+
}
|
297
|
+
/**
|
298
|
+
* Auxiliary function h as defined in RFC
|
299
|
+
*/
|
300
|
+
private static function h( x:int, y:int, z:int ):int {
|
301
|
+
return x ^ y ^ z;
|
302
|
+
}
|
303
|
+
/**
|
304
|
+
* Auxiliary function i as defined in RFC
|
305
|
+
*/
|
306
|
+
private static function i( x:int, y:int, z:int ):int {
|
307
|
+
return y ^ ( x | (~z) );
|
308
|
+
}
|
309
|
+
/**
|
310
|
+
* A generic transformation function. The logic of ff, gg, hh, and
|
311
|
+
* ii are all the same, minus the function used, so pull that logic
|
312
|
+
* out and simplify the method bodies for the transoformation functions.
|
313
|
+
*/
|
314
|
+
private static function transform( func:Function, a:int, b:int, c:int, d:int, x:int, s:int, t:int):int {
|
315
|
+
var tmp:int = a + int( func( b, c, d ) ) + x + t;
|
316
|
+
return IntUtil.rol( tmp, s ) + b;
|
317
|
+
}
|
318
|
+
/**
|
319
|
+
* ff transformation function
|
320
|
+
*/
|
321
|
+
private static function ff ( a:int, b:int, c:int, d:int, x:int, s:int, t:int ):int {
|
322
|
+
return transform( f, a, b, c, d, x, s, t );
|
323
|
+
}
|
324
|
+
/**
|
325
|
+
* gg transformation function
|
326
|
+
*/
|
327
|
+
private static function gg ( a:int, b:int, c:int, d:int, x:int, s:int, t:int ):int {
|
328
|
+
return transform( g, a, b, c, d, x, s, t );
|
329
|
+
}
|
330
|
+
/**
|
331
|
+
* hh transformation function
|
332
|
+
*/
|
333
|
+
private static function hh ( a:int, b:int, c:int, d:int, x:int, s:int, t:int ):int {
|
334
|
+
return transform( h, a, b, c, d, x, s, t );
|
335
|
+
}
|
336
|
+
/**
|
337
|
+
* ii transformation function
|
338
|
+
*/
|
339
|
+
private static function ii ( a:int, b:int, c:int, d:int, x:int, s:int, t:int ):int {
|
340
|
+
return transform( i, a, b, c, d, x, s, t );
|
341
|
+
}
|
342
|
+
}
|
343
|
+
}
|
@@ -0,0 +1,250 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
3
|
+
All rights reserved.
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are
|
6
|
+
met:
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright
|
10
|
+
notice, this list of conditions and the following disclaimer in the
|
11
|
+
documentation and/or other materials provided with the distribution.
|
12
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
13
|
+
contributors may be used to endorse or promote products derived from
|
14
|
+
this software without specific prior written permission.
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
16
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
17
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
18
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
19
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
20
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
22
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
23
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
24
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
25
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
*/
|
27
|
+
package com.adobe.crypto
|
28
|
+
{
|
29
|
+
import com.adobe.utils.IntUtil;
|
30
|
+
import flash.utils.ByteArray;
|
31
|
+
import mx.utils.Base64Encoder;
|
32
|
+
/**
|
33
|
+
* US Secure Hash Algorithm 1 (SHA1)
|
34
|
+
*
|
35
|
+
* Implementation based on algorithm description at
|
36
|
+
* http://www.faqs.org/rfcs/rfc3174.html
|
37
|
+
*/
|
38
|
+
public class SHA1
|
39
|
+
{
|
40
|
+
public static var digest:ByteArray;
|
41
|
+
/**
|
42
|
+
* Performs the SHA1 hash algorithm on a string.
|
43
|
+
*
|
44
|
+
* @param s The string to hash
|
45
|
+
* @return A string containing the hash value of s
|
46
|
+
* @langversion ActionScript 3.0
|
47
|
+
* @playerversion 9.0
|
48
|
+
* @tiptext
|
49
|
+
*/
|
50
|
+
public static function hash( s:String ):String
|
51
|
+
{
|
52
|
+
var blocks:Array = createBlocksFromString( s );
|
53
|
+
var byteArray:ByteArray = hashBlocks( blocks );
|
54
|
+
return IntUtil.toHex( byteArray.readInt(), true )
|
55
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
56
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
57
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
58
|
+
+ IntUtil.toHex( byteArray.readInt(), true );
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Performs the SHA1 hash algorithm on a ByteArray.
|
62
|
+
*
|
63
|
+
* @param data The ByteArray data to hash
|
64
|
+
* @return A string containing the hash value of data
|
65
|
+
* @langversion ActionScript 3.0
|
66
|
+
* @playerversion 9.0
|
67
|
+
*/
|
68
|
+
public static function hashBytes( data:ByteArray ):String
|
69
|
+
{
|
70
|
+
var blocks:Array = SHA1.createBlocksFromByteArray( data );
|
71
|
+
var byteArray:ByteArray = hashBlocks(blocks);
|
72
|
+
return IntUtil.toHex( byteArray.readInt(), true )
|
73
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
74
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
75
|
+
+ IntUtil.toHex( byteArray.readInt(), true )
|
76
|
+
+ IntUtil.toHex( byteArray.readInt(), true );
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* Performs the SHA1 hash algorithm on a string, then does
|
80
|
+
* Base64 encoding on the result.
|
81
|
+
*
|
82
|
+
* @param s The string to hash
|
83
|
+
* @return The base64 encoded hash value of s
|
84
|
+
* @langversion ActionScript 3.0
|
85
|
+
* @playerversion 9.0
|
86
|
+
* @tiptext
|
87
|
+
*/
|
88
|
+
public static function hashToBase64( s:String ):String
|
89
|
+
{
|
90
|
+
var blocks:Array = SHA1.createBlocksFromString( s );
|
91
|
+
var byteArray:ByteArray = hashBlocks(blocks);
|
92
|
+
// ByteArray.toString() returns the contents as a UTF-8 string,
|
93
|
+
// which we can't use because certain byte sequences might trigger
|
94
|
+
// a UTF-8 conversion. Instead, we convert the bytes to characters
|
95
|
+
// one by one.
|
96
|
+
var charsInByteArray:String = "";
|
97
|
+
byteArray.position = 0;
|
98
|
+
for (var j:int = 0; j < byteArray.length; j++)
|
99
|
+
{
|
100
|
+
var byte:uint = byteArray.readUnsignedByte();
|
101
|
+
charsInByteArray += String.fromCharCode(byte);
|
102
|
+
}
|
103
|
+
var encoder:Base64Encoder = new Base64Encoder();
|
104
|
+
encoder.encode(charsInByteArray);
|
105
|
+
return encoder.flush();
|
106
|
+
}
|
107
|
+
private static function hashBlocks( blocks:Array ):ByteArray
|
108
|
+
{
|
109
|
+
// initialize the h's
|
110
|
+
var h0:int = 0x67452301;
|
111
|
+
var h1:int = 0xefcdab89;
|
112
|
+
var h2:int = 0x98badcfe;
|
113
|
+
var h3:int = 0x10325476;
|
114
|
+
var h4:int = 0xc3d2e1f0;
|
115
|
+
var len:int = blocks.length;
|
116
|
+
var w:Array = new Array( 80 );
|
117
|
+
var temp:int;
|
118
|
+
// loop over all of the blocks
|
119
|
+
for ( var i:int = 0; i < len; i += 16 ) {
|
120
|
+
// 6.1.c
|
121
|
+
var a:int = h0;
|
122
|
+
var b:int = h1;
|
123
|
+
var c:int = h2;
|
124
|
+
var d:int = h3;
|
125
|
+
var e:int = h4;
|
126
|
+
// 80 steps to process each block
|
127
|
+
var t:int;
|
128
|
+
for ( t = 0; t < 20; t++ ) {
|
129
|
+
if ( t < 16 ) {
|
130
|
+
// 6.1.a
|
131
|
+
w[ t ] = blocks[ i + t ];
|
132
|
+
} else {
|
133
|
+
// 6.1.b
|
134
|
+
temp = w[ t - 3 ] ^ w[ t - 8 ] ^ w[ t - 14 ] ^ w[ t - 16 ];
|
135
|
+
w[ t ] = ( temp << 1 ) | ( temp >>> 31 )
|
136
|
+
}
|
137
|
+
// 6.1.d
|
138
|
+
temp = ( ( a << 5 ) | ( a >>> 27 ) ) + ( ( b & c ) | ( ~b & d ) ) + e + int( w[ t ] ) + 0x5a827999;
|
139
|
+
e = d;
|
140
|
+
d = c;
|
141
|
+
c = ( b << 30 ) | ( b >>> 2 );
|
142
|
+
b = a;
|
143
|
+
a = temp;
|
144
|
+
}
|
145
|
+
for ( ; t < 40; t++ )
|
146
|
+
{
|
147
|
+
// 6.1.b
|
148
|
+
temp = w[ t - 3 ] ^ w[ t - 8 ] ^ w[ t - 14 ] ^ w[ t - 16 ];
|
149
|
+
w[ t ] = ( temp << 1 ) | ( temp >>> 31 )
|
150
|
+
// 6.1.d
|
151
|
+
temp = ( ( a << 5 ) | ( a >>> 27 ) ) + ( b ^ c ^ d ) + e + int( w[ t ] ) + 0x6ed9eba1;
|
152
|
+
e = d;
|
153
|
+
d = c;
|
154
|
+
c = ( b << 30 ) | ( b >>> 2 );
|
155
|
+
b = a;
|
156
|
+
a = temp;
|
157
|
+
}
|
158
|
+
for ( ; t < 60; t++ )
|
159
|
+
{
|
160
|
+
// 6.1.b
|
161
|
+
temp = w[ t - 3 ] ^ w[ t - 8 ] ^ w[ t - 14 ] ^ w[ t - 16 ];
|
162
|
+
w[ t ] = ( temp << 1 ) | ( temp >>> 31 )
|
163
|
+
// 6.1.d
|
164
|
+
temp = ( ( a << 5 ) | ( a >>> 27 ) ) + ( ( b & c ) | ( b & d ) | ( c & d ) ) + e + int( w[ t ] ) + 0x8f1bbcdc;
|
165
|
+
e = d;
|
166
|
+
d = c;
|
167
|
+
c = ( b << 30 ) | ( b >>> 2 );
|
168
|
+
b = a;
|
169
|
+
a = temp;
|
170
|
+
}
|
171
|
+
for ( ; t < 80; t++ )
|
172
|
+
{
|
173
|
+
// 6.1.b
|
174
|
+
temp = w[ t - 3 ] ^ w[ t - 8 ] ^ w[ t - 14 ] ^ w[ t - 16 ];
|
175
|
+
w[ t ] = ( temp << 1 ) | ( temp >>> 31 )
|
176
|
+
// 6.1.d
|
177
|
+
temp = ( ( a << 5 ) | ( a >>> 27 ) ) + ( b ^ c ^ d ) + e + int( w[ t ] ) + 0xca62c1d6;
|
178
|
+
e = d;
|
179
|
+
d = c;
|
180
|
+
c = ( b << 30 ) | ( b >>> 2 );
|
181
|
+
b = a;
|
182
|
+
a = temp;
|
183
|
+
}
|
184
|
+
// 6.1.e
|
185
|
+
h0 += a;
|
186
|
+
h1 += b;
|
187
|
+
h2 += c;
|
188
|
+
h3 += d;
|
189
|
+
h4 += e;
|
190
|
+
}
|
191
|
+
var byteArray:ByteArray = new ByteArray();
|
192
|
+
byteArray.writeInt(h0);
|
193
|
+
byteArray.writeInt(h1);
|
194
|
+
byteArray.writeInt(h2);
|
195
|
+
byteArray.writeInt(h3);
|
196
|
+
byteArray.writeInt(h4);
|
197
|
+
byteArray.position = 0;
|
198
|
+
digest = new ByteArray();
|
199
|
+
digest.writeBytes(byteArray);
|
200
|
+
digest.position = 0;
|
201
|
+
return byteArray;
|
202
|
+
}
|
203
|
+
/**
|
204
|
+
* Converts a ByteArray to a sequence of 16-word blocks
|
205
|
+
* that we'll do the processing on. Appends padding
|
206
|
+
* and length in the process.
|
207
|
+
*
|
208
|
+
* @param data The data to split into blocks
|
209
|
+
* @return An array containing the blocks into which data was split
|
210
|
+
*/
|
211
|
+
private static function createBlocksFromByteArray( data:ByteArray ):Array
|
212
|
+
{
|
213
|
+
var oldPosition:int = data.position;
|
214
|
+
data.position = 0;
|
215
|
+
var blocks:Array = new Array();
|
216
|
+
var len:int = data.length * 8;
|
217
|
+
var mask:int = 0xFF; // ignore hi byte of characters > 0xFF
|
218
|
+
for( var i:int = 0; i < len; i += 8 )
|
219
|
+
{
|
220
|
+
blocks[ i >> 5 ] |= ( data.readByte() & mask ) << ( 24 - i % 32 );
|
221
|
+
}
|
222
|
+
// append padding and length
|
223
|
+
blocks[ len >> 5 ] |= 0x80 << ( 24 - len % 32 );
|
224
|
+
blocks[ ( ( ( len + 64 ) >> 9 ) << 4 ) + 15 ] = len;
|
225
|
+
data.position = oldPosition;
|
226
|
+
return blocks;
|
227
|
+
}
|
228
|
+
/**
|
229
|
+
* Converts a string to a sequence of 16-word blocks
|
230
|
+
* that we'll do the processing on. Appends padding
|
231
|
+
* and length in the process.
|
232
|
+
*
|
233
|
+
* @param s The string to split into blocks
|
234
|
+
* @return An array containing the blocks that s was split into.
|
235
|
+
*/
|
236
|
+
private static function createBlocksFromString( s:String ):Array
|
237
|
+
{
|
238
|
+
var blocks:Array = new Array();
|
239
|
+
var len:int = s.length * 8;
|
240
|
+
var mask:int = 0xFF; // ignore hi byte of characters > 0xFF
|
241
|
+
for( var i:int = 0; i < len; i += 8 ) {
|
242
|
+
blocks[ i >> 5 ] |= ( s.charCodeAt( i / 8 ) & mask ) << ( 24 - i % 32 );
|
243
|
+
}
|
244
|
+
// append padding and length
|
245
|
+
blocks[ len >> 5 ] |= 0x80 << ( 24 - len % 32 );
|
246
|
+
blocks[ ( ( ( len + 64 ) >> 9 ) << 4 ) + 15 ] = len;
|
247
|
+
return blocks;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|