├── .github
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .npmignore
├── .travis.yml
├── Gruntfile.js
├── LICENSE
├── NOTICE
├── README.md
├── bower.json
├── build
├── tincan-min.js
├── tincan-min.map
├── tincan-node.js
└── tincan.js
├── doc
└── development.md
├── package.json
├── src
├── About.js
├── Activity.js
├── ActivityDefinition.js
├── ActivityProfile.js
├── Agent.js
├── AgentAccount.js
├── AgentProfile.js
├── Attachment.js
├── Context.js
├── ContextActivities.js
├── Environment
│ ├── Browser.js
│ └── Node.js
├── Group.js
├── InteractionComponent.js
├── LRS.js
├── Result.js
├── Score.js
├── State.js
├── Statement.js
├── StatementRef.js
├── StatementsResult.js
├── SubStatement.js
├── TinCan.js
├── Utils.js
└── Verb.js
├── test
├── complete.html
├── config.js.template
├── config.js.travis-ci
├── files
│ └── image.jpg
├── index.html
├── js
│ ├── BrowserPrep.js
│ ├── NodePrep.js
│ └── unit
│ │ ├── About.js
│ │ ├── Activity.js
│ │ ├── ActivityDefinition.js
│ │ ├── ActivityProfile.js
│ │ ├── Agent.js
│ │ ├── AgentAccount.js
│ │ ├── AgentProfile.js
│ │ ├── Attachment.js
│ │ ├── Context.js
│ │ ├── ContextActivities.js
│ │ ├── Group.js
│ │ ├── InteractionComponent.js
│ │ ├── LRS-browser.js
│ │ ├── LRS.js
│ │ ├── Result.js
│ │ ├── Score.js
│ │ ├── State.js
│ │ ├── Statement.js
│ │ ├── StatementRef.js
│ │ ├── StatementsResult.js
│ │ ├── SubStatement.js
│ │ ├── TinCan-async.js
│ │ ├── TinCan-sync.js
│ │ ├── TinCan.js
│ │ ├── Utils.js
│ │ ├── Verb.js
│ │ └── offline.js
├── node-runner.js
├── single
│ ├── About.html
│ ├── Activity.html
│ ├── ActivityDefinition.html
│ ├── ActivityProfile.html
│ ├── Agent.html
│ ├── AgentAccount.html
│ ├── AgentProfile.html
│ ├── Attachment.html
│ ├── Context.html
│ ├── ContextActivities.html
│ ├── Group.html
│ ├── InteractionComponent.html
│ ├── LRS-browser.html
│ ├── LRS.html
│ ├── Manual-Image.html
│ ├── Result.html
│ ├── Score.html
│ ├── State.html
│ ├── Statement.html
│ ├── StatementRef.html
│ ├── StatementsResult.html
│ ├── SubStatement.html
│ ├── TinCan-async.html
│ ├── TinCan-sync.html
│ ├── TinCan.html
│ ├── Utils.html
│ ├── Verb.html
│ └── offline.html
└── vendor
│ ├── jquery-1.9.1.js
│ ├── qunit-1.10.0pre.css
│ └── qunit-1.10.0pre.js
└── vendor
├── cryptojs-v3.0.2
├── LICENSE
├── components
│ ├── aes-min.js
│ ├── aes.js
│ ├── cipher-core-min.js
│ ├── cipher-core.js
│ ├── core-min.js
│ ├── core.js
│ ├── enc-base64-min.js
│ ├── enc-base64.js
│ ├── enc-utf16-min.js
│ ├── enc-utf16.js
│ ├── evpkdf-min.js
│ ├── evpkdf.js
│ ├── hmac-min.js
│ ├── hmac.js
│ ├── md5-min.js
│ ├── md5.js
│ ├── mode-cfb-min.js
│ ├── mode-cfb.js
│ ├── mode-ctr-min.js
│ ├── mode-ctr.js
│ ├── mode-ecb-min.js
│ ├── mode-ecb.js
│ ├── mode-ofb-min.js
│ ├── mode-ofb.js
│ ├── pad-ansix923-min.js
│ ├── pad-ansix923.js
│ ├── pad-iso10126-min.js
│ ├── pad-iso10126.js
│ ├── pad-iso97971-min.js
│ ├── pad-iso97971.js
│ ├── pad-nopadding-min.js
│ ├── pad-nopadding.js
│ ├── pad-zeropadding-min.js
│ ├── pad-zeropadding.js
│ ├── pbkdf2-min.js
│ ├── pbkdf2.js
│ ├── rabbit-min.js
│ ├── rabbit.js
│ ├── rc4-min.js
│ ├── rc4.js
│ ├── sha1-min.js
│ ├── sha1.js
│ ├── sha224-min.js
│ ├── sha224.js
│ ├── sha256-min.js
│ ├── sha256.js
│ ├── sha384-min.js
│ ├── sha384.js
│ ├── sha512-min.js
│ ├── sha512.js
│ ├── tripledes-min.js
│ ├── tripledes.js
│ ├── x64-core-min.js
│ └── x64-core.js
└── rollups
│ ├── aes.js
│ ├── hmac-md5.js
│ ├── hmac-sha1.js
│ ├── hmac-sha224.js
│ ├── hmac-sha256.js
│ ├── hmac-sha384.js
│ ├── hmac-sha512.js
│ ├── md5.js
│ ├── pbkdf2.js
│ ├── rabbit.js
│ ├── rc4.js
│ ├── sha1.js
│ ├── sha224.js
│ ├── sha256.js
│ ├── sha384.js
│ ├── sha512.js
│ └── tripledes.js
└── cryptojs-v3.1.2
├── components
├── aes-min.js
├── aes.js
├── cipher-core-min.js
├── cipher-core.js
├── core-min.js
├── core.js
├── enc-base64-min.js
├── enc-base64.js
├── enc-utf16-min.js
├── enc-utf16.js
├── evpkdf-min.js
├── evpkdf.js
├── format-hex-min.js
├── format-hex.js
├── hmac-min.js
├── hmac.js
├── lib-typedarrays-min.js
├── lib-typedarrays.js
├── md5-min.js
├── md5.js
├── mode-cfb-min.js
├── mode-cfb.js
├── mode-ctr-gladman-min.js
├── mode-ctr-gladman.js
├── mode-ctr-min.js
├── mode-ctr.js
├── mode-ecb-min.js
├── mode-ecb.js
├── mode-ofb-min.js
├── mode-ofb.js
├── pad-ansix923-min.js
├── pad-ansix923.js
├── pad-iso10126-min.js
├── pad-iso10126.js
├── pad-iso97971-min.js
├── pad-iso97971.js
├── pad-nopadding-min.js
├── pad-nopadding.js
├── pad-zeropadding-min.js
├── pad-zeropadding.js
├── pbkdf2-min.js
├── pbkdf2.js
├── rabbit-legacy-min.js
├── rabbit-legacy.js
├── rabbit-min.js
├── rabbit.js
├── rc4-min.js
├── rc4.js
├── ripemd160-min.js
├── ripemd160.js
├── sha1-min.js
├── sha1.js
├── sha224-min.js
├── sha224.js
├── sha256-min.js
├── sha256.js
├── sha3-min.js
├── sha3.js
├── sha384-min.js
├── sha384.js
├── sha512-min.js
├── sha512.js
├── tripledes-min.js
├── tripledes.js
├── x64-core-min.js
└── x64-core.js
└── rollups
├── aes.js
├── hmac-md5.js
├── hmac-ripemd160.js
├── hmac-sha1.js
├── hmac-sha224.js
├── hmac-sha256.js
├── hmac-sha3.js
├── hmac-sha384.js
├── hmac-sha512.js
├── md5.js
├── pbkdf2.js
├── rabbit-legacy.js
├── rabbit.js
├── rc4.js
├── ripemd160.js
├── sha1.js
├── sha224.js
├── sha256.js
├── sha3.js
├── sha384.js
├── sha512.js
└── tripledes.js
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | Tested in:
4 |
5 | - [ ] Chrome xx
6 | - [ ] FireFox xx
7 | - [ ] Safari xx
8 | - [ ] Brave xx
9 | - [ ] IE Edge
10 | - [ ] IE 11
11 | - [ ] IE 10
12 | - [ ] IE 9
13 | - [ ] IE 8
14 | - [ ] IE 7
15 | - [ ] IE 6
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | doc/api/*
3 | node_modules/
4 | test/config.js
5 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | *.tgz
2 | src
3 | test
4 | doc
5 | vendor
6 | build/tincan-min.map
7 | .travis.yml
8 | yuidoc.json
9 | bower.json
10 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | language: node_js
3 | node_js:
4 | - "6"
5 | - "5"
6 | - "4"
7 | - "0.12"
8 | - "0.10"
9 | before_install: npm install -g grunt-cli
10 | install: npm install
11 | before_script:
12 | - grunt build
13 | - cp test/config.js.travis-ci test/config.js
14 | script: node test/node-runner.js
15 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | TinCanJS
2 | Copyright 2012 Rustici Software
3 |
4 | This product includes software developed at
5 | Rustici Software (http://www.scorm.com/).
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | A JavaScript library for implementing the Experience API (Tin Can API).
2 |
3 | [](https://travis-ci.org/RusticiSoftware/TinCanJS)
4 | [](https://github.com/RusticiSoftware/TinCanJS/releases)
5 | [](https://www.npmjs.com/package/tincanjs)
6 | []()
7 |
8 | For hosted API documentation, basic usage instructions, supported version listing, etc. visit the main project website at:
9 |
10 | http://rusticisoftware.github.io/TinCanJS/
11 |
12 | For more information about the Experience API visit:
13 |
14 | http://experienceapi.com/
15 |
16 | Browser Usage
17 | -------------
18 |
19 | TinCanJS is available via `npm` and Bower.
20 |
21 | The browser environment is well tested and supports two kinds of Cross Origin requests which
22 | is sufficient to cover most versions of Chrome, FireFox, Safari as well as IE 8+. IE 6+ are
23 | supported for non-CORS (because they don't support it).
24 |
25 | Include *one* of build/tincan-min.js or build/tincan.js as follows:
26 |
27 |
28 |
29 | Node.js Usage
30 | -------------
31 |
32 | TinCanJS is available via `npm`.
33 |
34 | The `Environment/Node.js` wrapper used in this version has a dependency on the 'xhr2' module
35 | which is also available via `npm`. It is used to allow the interfaces to the underlying LRS
36 | requests to have the same API. As such currently there is no support for synchronous requests
37 | when using this environment.
38 |
39 | Install via:
40 |
41 | npm install tincanjs
42 |
43 | And within code:
44 |
45 | var TinCan = require('tincanjs');
46 |
47 | Environments
48 | ------------
49 |
50 | Implementing a new Environment should be straightforward and requires overloading a couple
51 | of methods in the library. There are currently two examples, `Environment/Browser`
52 | and `Environment/Node`.
53 |
54 | Attachment Support
55 | ------------------
56 |
57 | Sending and retrieving statements with attachments via the multipart/mixed request/response
58 | cycle works end to end with binary attachments in Node.js 4+ and in the typical modern browsers:
59 | Chrome 53+, Firefox 48+, Safari 9+, IE 10+ (current versions at time of implementation, older versions
60 | may work without changes but have not been tested). Attachments without included content (those using
61 | only the `fileUrl` property) should be supported in all environments supported by the library.
62 |
63 | Several polyfills (TypedArrays, ArrayBuffer w/ slice, Blob, TextDecoder/TextEncoder) are needed
64 | to support various browser versions, if you are targeting a recent enough set of browsers you
65 | can reduce the overall size of the built library by commenting out those polyfills in the
66 | `Gruntfile.js` file and building yourself.
67 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tincan",
3 | "version": "0.50.0",
4 | "homepage": "http://rusticisoftware.github.com/TinCanJS/",
5 | "authors": [
6 | "Brian J. Miller "
7 | ],
8 | "description": "A JavaScript library for talking Tin Can to the world.",
9 | "keywords": [
10 | "tincan",
11 | "tin can",
12 | "e-learning",
13 | "scorm",
14 | "lrs",
15 | "experienceapi",
16 | "experience api",
17 | "xapi",
18 | "cmi5"
19 | ],
20 | "license": "Apache 2.0",
21 | "main": [
22 | "build/tincan-min.js",
23 | "build/tincan.js"
24 | ],
25 | "ignore": [
26 | "**/.*",
27 | "node_modules",
28 | "bower_components",
29 | "build.js",
30 | "doc",
31 | "src",
32 | "test",
33 | "vendor"
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/doc/development.md:
--------------------------------------------------------------------------------
1 | Development Processes
2 | =====================
3 |
4 | Build instructions
5 | ------------------
6 |
7 | For first time builds install Node.js with npm and then run `npm install gear gear-lib`.
8 |
9 | With Node.js installed and the requisite modules present, issue:
10 |
11 | ./build.js
12 |
13 | This will generate build/tincan.js and build/tincan-min.js files.
14 |
15 | API Documentation Generation
16 | ----------------------------
17 |
18 | Install yuidoc via `npm install -g yuidocjs` and then from the base directory issue:
19 |
20 | yuidoc src/
21 |
22 | Files will be output to doc/api/ which can be viewed by pointing a browser at the index.html at that path
23 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tincanjs",
3 | "description": "Experience API (Tin Can API) Library",
4 | "version": "0.50.0",
5 | "private": false,
6 | "license": "Apache-2.0",
7 | "main": "build/tincan-node.js",
8 | "directories": {
9 | "src": "src",
10 | "doc": "doc"
11 | },
12 | "dependencies": {
13 | "xhr2": "0.0.7",
14 | "js-polyfills": "0.1.22",
15 | "text-encoding": "0.6.0",
16 | "arraybuffer-slice": "0.1.2"
17 | },
18 | "author": "Rustici Software ",
19 | "contributors": [
20 | {
21 | "name": "Brian J. Miller",
22 | "email": "brian.miller@rusticisoftware.com"
23 | }
24 | ],
25 | "repository": {
26 | "type": "git",
27 | "url": "https://github.com/RusticiSoftware/TinCanJS.git"
28 | },
29 | "keywords": [
30 | "tincan",
31 | "tin can",
32 | "e-learning",
33 | "scorm",
34 | "lrs",
35 | "experienceapi",
36 | "experience api",
37 | "xapi",
38 | "cmi5"
39 | ],
40 | "devDependencies": {
41 | "grunt": "0.4.4",
42 | "grunt-contrib-concat": "0.3.0",
43 | "grunt-contrib-jshint": "0.12.0",
44 | "grunt-contrib-uglify": "0.4.0",
45 | "grunt-contrib-watch": "0.6.1",
46 | "grunt-contrib-yuidoc": "^0.5.2",
47 | "qunit": "0.9.1"
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/About.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2014 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | /**
18 | TinCan client library
19 |
20 | @module TinCan
21 | @submodule TinCan.About
22 | **/
23 | (function () {
24 | "use strict";
25 |
26 | /**
27 | @class TinCan.About
28 | @constructor
29 | */
30 | var About = TinCan.About = function (cfg) {
31 | this.log("constructor");
32 |
33 | /**
34 | @property version
35 | @type {String[]}
36 | */
37 | this.version = null;
38 |
39 | this.init(cfg);
40 | };
41 | About.prototype = {
42 | /**
43 | @property LOG_SRC
44 | */
45 | LOG_SRC: "About",
46 |
47 | /**
48 | @method log
49 | */
50 | log: TinCan.prototype.log,
51 |
52 | /**
53 | @method init
54 | @param {Object} [options] Configuration used to initialize
55 | */
56 | init: function (cfg) {
57 | this.log("init");
58 | var i,
59 | directProps = [
60 | "version"
61 | ];
62 |
63 | cfg = cfg || {};
64 |
65 | for (i = 0; i < directProps.length; i += 1) {
66 | if (cfg.hasOwnProperty(directProps[i]) && cfg[directProps[i]] !== null) {
67 | this[directProps[i]] = cfg[directProps[i]];
68 | }
69 | }
70 | }
71 | };
72 |
73 | /**
74 | @method fromJSON
75 | @return {Object} About
76 | @static
77 | */
78 | About.fromJSON = function (aboutJSON) {
79 | About.prototype.log("fromJSON");
80 | var _about = JSON.parse(aboutJSON);
81 |
82 | return new About(_about);
83 | };
84 | }());
85 |
--------------------------------------------------------------------------------
/src/ActivityProfile.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | /**
18 | TinCan client library
19 |
20 | @module TinCan
21 | @submodule TinCan.ActivityProfile
22 | **/
23 | (function () {
24 | "use strict";
25 |
26 | /**
27 | @class TinCan.ActivityProfile
28 | @constructor
29 | */
30 | var ActivityProfile = TinCan.ActivityProfile = function (cfg) {
31 | this.log("constructor");
32 |
33 | /**
34 | @property id
35 | @type String
36 | */
37 | this.id = null;
38 |
39 | /**
40 | @property activity
41 | @type TinCan.Activity
42 | */
43 | this.activity = null;
44 |
45 | /**
46 | @property updated
47 | @type String
48 | */
49 | this.updated = null;
50 |
51 | /**
52 | @property contents
53 | @type String
54 | */
55 | this.contents = null;
56 |
57 | /**
58 | SHA1 of contents as provided by the server during last fetch,
59 | this should be passed through to saveActivityProfile
60 |
61 | @property etag
62 | @type String
63 | */
64 | this.etag = null;
65 |
66 | /**
67 | @property contentType
68 | @type String
69 | */
70 | this.contentType = null;
71 |
72 | this.init(cfg);
73 | };
74 | ActivityProfile.prototype = {
75 | /**
76 | @property LOG_SRC
77 | */
78 | LOG_SRC: "ActivityProfile",
79 |
80 | /**
81 | @method log
82 | */
83 | log: TinCan.prototype.log,
84 |
85 | /**
86 | @method init
87 | @param {Object} [options] Configuration used to initialize
88 | */
89 | init: function (cfg) {
90 | this.log("init");
91 | var i,
92 | directProps = [
93 | "id",
94 | "contents",
95 | "etag",
96 | "contentType"
97 | ];
98 |
99 | cfg = cfg || {};
100 |
101 | if (cfg.hasOwnProperty("activity")) {
102 | if (cfg.activity instanceof TinCan.Activity) {
103 | this.activity = cfg.activity;
104 | }
105 | else {
106 | this.activity = new TinCan.Activity (cfg.activity);
107 | }
108 | }
109 |
110 | for (i = 0; i < directProps.length; i += 1) {
111 | if (cfg.hasOwnProperty(directProps[i]) && cfg[directProps[i]] !== null) {
112 | this[directProps[i]] = cfg[directProps[i]];
113 | }
114 | }
115 |
116 | this.updated = false;
117 | }
118 | };
119 |
120 | /**
121 | @method fromJSON
122 | @return {Object} ActivityProfile
123 | @static
124 | */
125 | ActivityProfile.fromJSON = function (stateJSON) {
126 | ActivityProfile.prototype.log("fromJSON");
127 | var _state = JSON.parse(stateJSON);
128 |
129 | return new ActivityProfile(_state);
130 | };
131 | }());
132 |
--------------------------------------------------------------------------------
/src/AgentProfile.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2013 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | /**
18 | TinCan client library
19 |
20 | @module TinCan
21 | @submodule TinCan.AgentProfile
22 | **/
23 | (function () {
24 | "use strict";
25 |
26 | /**
27 | @class TinCan.AgentProfile
28 | @constructor
29 | */
30 | var AgentProfile = TinCan.AgentProfile = function (cfg) {
31 | this.log("constructor");
32 |
33 | /**
34 | @property id
35 | @type String
36 | */
37 | this.id = null;
38 |
39 | /**
40 | @property agent
41 | @type TinCan.Agent
42 | */
43 | this.agent = null;
44 |
45 | /**
46 | @property updated
47 | @type String
48 | */
49 | this.updated = null;
50 |
51 | /**
52 | @property contents
53 | @type String
54 | */
55 | this.contents = null;
56 |
57 | /**
58 | SHA1 of contents as provided by the server during last fetch,
59 | this should be passed through to saveAgentProfile
60 |
61 | @property etag
62 | @type String
63 | */
64 | this.etag = null;
65 |
66 | /**
67 | @property contentType
68 | @type String
69 | */
70 | this.contentType = null;
71 |
72 | this.init(cfg);
73 | };
74 | AgentProfile.prototype = {
75 | /**
76 | @property LOG_SRC
77 | */
78 | LOG_SRC: "AgentProfile",
79 |
80 | /**
81 | @method log
82 | */
83 | log: TinCan.prototype.log,
84 |
85 | /**
86 | @method init
87 | @param {Object} [options] Configuration used to initialize
88 | */
89 | init: function (cfg) {
90 | this.log("init");
91 | var i,
92 | directProps = [
93 | "id",
94 | "contents",
95 | "etag",
96 | "contentType"
97 | ];
98 |
99 | cfg = cfg || {};
100 |
101 | if (cfg.hasOwnProperty("agent")) {
102 | if (cfg.agent instanceof TinCan.Agent) {
103 | this.agent = cfg.agent;
104 | }
105 | else {
106 | this.agent = new TinCan.Agent (cfg.agent);
107 | }
108 | }
109 |
110 | for (i = 0; i < directProps.length; i += 1) {
111 | if (cfg.hasOwnProperty(directProps[i]) && cfg[directProps[i]] !== null) {
112 | this[directProps[i]] = cfg[directProps[i]];
113 | }
114 | }
115 |
116 | this.updated = false;
117 | }
118 | };
119 |
120 | /**
121 | @method fromJSON
122 | @return {Object} AgentProfile
123 | @static
124 | */
125 | AgentProfile.fromJSON = function (stateJSON) {
126 | AgentProfile.prototype.log("fromJSON");
127 | var _state = JSON.parse(stateJSON);
128 |
129 | return new AgentProfile(_state);
130 | };
131 | }());
132 |
--------------------------------------------------------------------------------
/src/InteractionComponent.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | /**
18 | TinCan client library
19 |
20 | @module TinCan
21 | @submodule TinCan.InteractionComponent
22 | **/
23 | (function () {
24 | "use strict";
25 |
26 | /**
27 | @class TinCan.InteractionComponent
28 | @constructor
29 | */
30 | var InteractionComponent = TinCan.InteractionComponent = function (cfg) {
31 | this.log("constructor");
32 |
33 | /**
34 | @property id
35 | @type String
36 | */
37 | this.id = null;
38 |
39 | /**
40 | @property description
41 | @type Object
42 | */
43 | this.description = null;
44 |
45 | this.init(cfg);
46 | };
47 | InteractionComponent.prototype = {
48 | /**
49 | @property LOG_SRC
50 | */
51 | LOG_SRC: "InteractionComponent",
52 |
53 | /**
54 | @method log
55 | */
56 | log: TinCan.prototype.log,
57 |
58 | /**
59 | @method init
60 | @param {Object} [options] Configuration used to initialize
61 | */
62 | init: function (cfg) {
63 | this.log("init");
64 | var i,
65 | directProps = [
66 | "id",
67 | "description"
68 | ]
69 | ;
70 |
71 | cfg = cfg || {};
72 |
73 | for (i = 0; i < directProps.length; i += 1) {
74 | if (cfg.hasOwnProperty(directProps[i]) && cfg[directProps[i]] !== null) {
75 | this[directProps[i]] = cfg[directProps[i]];
76 | }
77 | }
78 | },
79 |
80 | /**
81 | @method asVersion
82 | @param {String} [version] Version to return (defaults to newest supported)
83 | */
84 | asVersion: function (version) {
85 | this.log("asVersion");
86 | var result = {
87 | id: this.id
88 | },
89 | optionalDirectProps = [
90 | "description"
91 | ],
92 | i,
93 | prop;
94 |
95 | version = version || TinCan.versions()[0];
96 |
97 | for (i = 0; i < optionalDirectProps.length; i += 1) {
98 | prop = optionalDirectProps[i];
99 | if (this[prop] !== null) {
100 | result[prop] = this[prop];
101 | }
102 | }
103 |
104 | return result;
105 | },
106 |
107 | /**
108 | See {{#crossLink "TinCan.Utils/getLangDictionaryValue"}}{{/crossLink}}
109 |
110 | @method getLangDictionaryValue
111 | */
112 | getLangDictionaryValue: TinCan.Utils.getLangDictionaryValue
113 | };
114 |
115 | /**
116 | @method fromJSON
117 | @return {Object} InteractionComponent
118 | @static
119 | */
120 | InteractionComponent.fromJSON = function (icJSON) {
121 | InteractionComponent.prototype.log("fromJSON");
122 | var _ic = JSON.parse(icJSON);
123 |
124 | return new InteractionComponent(_ic);
125 | };
126 | }());
127 |
--------------------------------------------------------------------------------
/src/Score.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | /**
18 | TinCan client library
19 |
20 | @module TinCan
21 | @submodule TinCan.Score
22 | **/
23 | (function () {
24 | "use strict";
25 |
26 | /**
27 | @class TinCan.Score
28 | @constructor
29 | */
30 | var Score = TinCan.Score = function (cfg) {
31 | this.log("constructor");
32 |
33 | /**
34 | @property scaled
35 | @type String
36 | */
37 | this.scaled = null;
38 |
39 | /**
40 | @property raw
41 | @type String
42 | */
43 | this.raw = null;
44 |
45 | /**
46 | @property min
47 | @type String
48 | */
49 | this.min = null;
50 |
51 | /**
52 | @property max
53 | @type String
54 | */
55 | this.max = null;
56 |
57 | this.init(cfg);
58 | };
59 | Score.prototype = {
60 | /**
61 | @property LOG_SRC
62 | */
63 | LOG_SRC: "Score",
64 |
65 | /**
66 | @method log
67 | */
68 | log: TinCan.prototype.log,
69 |
70 | /**
71 | @method init
72 | @param {Object} [options] Configuration used to initialize
73 | */
74 | init: function (cfg) {
75 | this.log("init");
76 |
77 | var i,
78 | directProps = [
79 | "scaled",
80 | "raw",
81 | "min",
82 | "max"
83 | ]
84 | ;
85 |
86 | cfg = cfg || {};
87 |
88 | for (i = 0; i < directProps.length; i += 1) {
89 | if (cfg.hasOwnProperty(directProps[i]) && cfg[directProps[i]] !== null) {
90 | this[directProps[i]] = cfg[directProps[i]];
91 | }
92 | }
93 | },
94 |
95 | /**
96 | @method asVersion
97 | @param {String} [version] Version to return (defaults to newest supported)
98 | */
99 | asVersion: function (version) {
100 | this.log("asVersion");
101 | var result = {},
102 | optionalDirectProps = [
103 | "scaled",
104 | "raw",
105 | "min",
106 | "max"
107 | ],
108 | i;
109 |
110 | version = version || TinCan.versions()[0];
111 |
112 | for (i = 0; i < optionalDirectProps.length; i += 1) {
113 | if (this[optionalDirectProps[i]] !== null) {
114 | result[optionalDirectProps[i]] = this[optionalDirectProps[i]];
115 | }
116 | }
117 |
118 | return result;
119 | }
120 | };
121 |
122 | /**
123 | @method fromJSON
124 | @return {Object} Score
125 | @static
126 | */
127 | Score.fromJSON = function (scoreJSON) {
128 | Score.prototype.log("fromJSON");
129 | var _score = JSON.parse(scoreJSON);
130 |
131 | return new Score(_score);
132 | };
133 | }());
134 |
--------------------------------------------------------------------------------
/src/State.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | /**
18 | TinCan client library
19 |
20 | @module TinCan
21 | @submodule TinCan.State
22 | **/
23 | (function () {
24 | "use strict";
25 |
26 | /**
27 | @class TinCan.State
28 | @constructor
29 | */
30 | var State = TinCan.State = function (cfg) {
31 | this.log("constructor");
32 |
33 | /**
34 | @property id
35 | @type String
36 | */
37 | this.id = null;
38 |
39 | /**
40 | @property updated
41 | @type Boolean
42 | */
43 | this.updated = null;
44 |
45 | /**
46 | @property contents
47 | @type String
48 | */
49 | this.contents = null;
50 |
51 | /**
52 | @property etag
53 | @type String
54 | */
55 | this.etag = null;
56 |
57 | /**
58 | @property contentType
59 | @type String
60 | */
61 | this.contentType = null;
62 |
63 | this.init(cfg);
64 | };
65 | State.prototype = {
66 | /**
67 | @property LOG_SRC
68 | */
69 | LOG_SRC: "State",
70 |
71 | /**
72 | @method log
73 | */
74 | log: TinCan.prototype.log,
75 |
76 | /**
77 | @method init
78 | @param {Object} [options] Configuration used to initialize
79 | */
80 | init: function (cfg) {
81 | this.log("init");
82 | var i,
83 | directProps = [
84 | "id",
85 | "contents",
86 | "etag",
87 | "contentType"
88 | ];
89 |
90 | cfg = cfg || {};
91 |
92 | for (i = 0; i < directProps.length; i += 1) {
93 | if (cfg.hasOwnProperty(directProps[i]) && cfg[directProps[i]] !== null) {
94 | this[directProps[i]] = cfg[directProps[i]];
95 | }
96 | }
97 |
98 | this.updated = false;
99 | }
100 | };
101 |
102 | /**
103 | @method fromJSON
104 | @return {Object} State
105 | @static
106 | */
107 | State.fromJSON = function (stateJSON) {
108 | State.prototype.log("fromJSON");
109 | var _state = JSON.parse(stateJSON);
110 |
111 | return new State(_state);
112 | };
113 | }());
114 |
--------------------------------------------------------------------------------
/src/StatementRef.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | /**
18 | TinCan client library
19 |
20 | @module TinCan
21 | @submodule TinCan.StatementRef
22 | **/
23 | (function () {
24 | "use strict";
25 |
26 | /**
27 | @class TinCan.StatementRef
28 | @constructor
29 | @param {Object} [cfg] Configuration used to initialize.
30 | @param {Object} [cfg.id] ID of statement to reference
31 | **/
32 | var StatementRef = TinCan.StatementRef = function (cfg) {
33 | this.log("constructor");
34 |
35 | /**
36 | @property id
37 | @type String
38 | */
39 | this.id = null;
40 |
41 | this.init(cfg);
42 | };
43 |
44 | StatementRef.prototype = {
45 | /**
46 | @property objectType
47 | @type String
48 | @default Agent
49 | */
50 | objectType: "StatementRef",
51 |
52 | /**
53 | @property LOG_SRC
54 | */
55 | LOG_SRC: "StatementRef",
56 |
57 | /**
58 | @method log
59 | */
60 | log: TinCan.prototype.log,
61 |
62 | /**
63 | @method init
64 | @param {Object} [options] Configuration used to initialize (see constructor)
65 | */
66 | init: function (cfg) {
67 | this.log("init");
68 | var i,
69 | directProps = [
70 | "id"
71 | ];
72 |
73 | cfg = cfg || {};
74 |
75 | for (i = 0; i < directProps.length; i += 1) {
76 | if (cfg.hasOwnProperty(directProps[i]) && cfg[directProps[i]] !== null) {
77 | this[directProps[i]] = cfg[directProps[i]];
78 | }
79 | }
80 | },
81 |
82 | /**
83 | @method toString
84 | @return {String} String representation of the statement
85 | */
86 | toString: function () {
87 | this.log("toString");
88 | return this.id;
89 | },
90 |
91 | /**
92 | @method asVersion
93 | @param {String} [version] Version to return (defaults to newest supported)
94 | */
95 | asVersion: function (version) {
96 | this.log("asVersion");
97 | var result = {
98 | objectType: this.objectType,
99 | id: this.id
100 | };
101 |
102 | if (version === "0.9") {
103 | result.objectType = "Statement";
104 | }
105 |
106 | return result;
107 | }
108 | };
109 |
110 | /**
111 | @method fromJSON
112 | @return {Object} StatementRef
113 | @static
114 | */
115 | StatementRef.fromJSON = function (stRefJSON) {
116 | StatementRef.prototype.log("fromJSON");
117 | var _stRef = JSON.parse(stRefJSON);
118 |
119 | return new StatementRef(_stRef);
120 | };
121 | }());
122 |
--------------------------------------------------------------------------------
/src/StatementsResult.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | /**
18 | TinCan client library
19 |
20 | @module TinCan
21 | @submodule TinCan.StatementsResult
22 | **/
23 | (function () {
24 | "use strict";
25 |
26 | /**
27 | @class TinCan.StatementsResult
28 | @constructor
29 | @param {Object} options Configuration used to initialize.
30 | @param {Array} options.statements Actor of statement
31 | @param {String} options.more URL to fetch more data
32 | **/
33 | var StatementsResult = TinCan.StatementsResult = function (cfg) {
34 | this.log("constructor");
35 |
36 | /**
37 | @property statements
38 | @type Array
39 | */
40 | this.statements = null;
41 |
42 | /**
43 | @property more
44 | @type String
45 | */
46 | this.more = null;
47 |
48 | this.init(cfg);
49 | };
50 |
51 | StatementsResult.prototype = {
52 | /**
53 | @property LOG_SRC
54 | */
55 | LOG_SRC: "StatementsResult",
56 |
57 | /**
58 | @method log
59 | */
60 | log: TinCan.prototype.log,
61 |
62 | /**
63 | @method init
64 | @param {Object} [options] Configuration used to initialize
65 | */
66 | init: function (cfg) {
67 | this.log("init");
68 |
69 | cfg = cfg || {};
70 |
71 | if (cfg.hasOwnProperty("statements")) {
72 | this.statements = cfg.statements;
73 | }
74 | if (cfg.hasOwnProperty("more")) {
75 | this.more = cfg.more;
76 | }
77 | }
78 | };
79 |
80 | /**
81 | @method fromJSON
82 | @return {Object} Agent
83 | @static
84 | */
85 | StatementsResult.fromJSON = function (resultJSON) {
86 | StatementsResult.prototype.log("fromJSON");
87 | var _result,
88 | stmts = [],
89 | stmt,
90 | i
91 | ;
92 |
93 | try {
94 | _result = JSON.parse(resultJSON);
95 | } catch (parseError) {
96 | StatementsResult.prototype.log("fromJSON - JSON.parse error: " + parseError);
97 | }
98 |
99 | if (_result) {
100 | for (i = 0; i < _result.statements.length; i += 1) {
101 | try {
102 | stmt = new TinCan.Statement (_result.statements[i], 4);
103 | } catch (error) {
104 | StatementsResult.prototype.log("fromJSON - statement instantiation failed: " + error + " (" + JSON.stringify(_result.statements[i]) + ")");
105 |
106 | stmt = new TinCan.Statement (
107 | {
108 | id: _result.statements[i].id
109 | },
110 | 4
111 | );
112 | }
113 |
114 | stmts.push(stmt);
115 | }
116 | _result.statements = stmts;
117 | }
118 |
119 | return new StatementsResult (_result);
120 | };
121 | }());
122 |
--------------------------------------------------------------------------------
/test/complete.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | TinCanJS Tests
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/test/config.js.template:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | (function () {
18 | TinCanTestCfg = {
19 | recordStores: {
20 | "1.0.1": {
21 | endpoint: "http://cloud.scorm.com/tc/public/",
22 | username: "test",
23 | password: "somepass",
24 | version: "1.0.1"
25 | },
26 | "1.0.0": {
27 | endpoint: "http://cloud.scorm.com/tc/public/",
28 | username: "test",
29 | password: "somepass",
30 | version: "1.0.0"
31 | },
32 | "0.95": {
33 | endpoint: "http://cloud.scorm.com/tc/public/",
34 | username: "test",
35 | password: "somepass",
36 | version: "0.95"
37 | },
38 | "0.9": {
39 | endpoint: "http://cloud.scorm.com/tc/public/",
40 | username: "test",
41 | password: "somepass",
42 | version: "0.9"
43 | }
44 | }
45 | };
46 |
47 | module.exports = TinCanTestCfg;
48 | }());
49 |
--------------------------------------------------------------------------------
/test/config.js.travis-ci:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright 2014 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 |
17 | (function () {
18 | TinCanTestCfg = {
19 | recordStores: {
20 | "1.0.1": {
21 | endpoint: "https://cloud.scorm.com/tc/RHY62NUREC/sandbox/",
22 | username: "M25ta_XYO2QNc1EdgIw",
23 | password: "WApOqa0C6zDFSsPxWUA",
24 | version: "1.0.1"
25 | },
26 | "1.0.0": {
27 | endpoint: "https://cloud.scorm.com/tc/RHY62NUREC/sandbox/",
28 | username: "M25ta_XYO2QNc1EdgIw",
29 | password: "WApOqa0C6zDFSsPxWUA",
30 | version: "1.0.0"
31 | },
32 | "0.95": {
33 | endpoint: "https://cloud.scorm.com/tc/RHY62NUREC/sandbox/",
34 | username: "M25ta_XYO2QNc1EdgIw",
35 | password: "WApOqa0C6zDFSsPxWUA",
36 | version: "0.95"
37 | },
38 | "0.9": {
39 | endpoint: "https://cloud.scorm.com/tc/RHY62NUREC/sandbox/",
40 | username: "M25ta_XYO2QNc1EdgIw",
41 | password: "WApOqa0C6zDFSsPxWUA",
42 | version: "0.9"
43 | }
44 | }
45 | };
46 |
47 | module.exports = TinCanTestCfg;
48 | }());
49 |
--------------------------------------------------------------------------------
/test/files/image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RusticiSoftware/TinCanJS/8733f14ddcaeea77a0579505300bc8f38921a6b1/test/files/image.jpg
--------------------------------------------------------------------------------
/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests
20 |
21 |
22 |
23 |
24 |
Full Suite
25 |
Complete Test
26 |
27 |
Single Test Files
28 |
56 |
57 |
Special Conditions
58 |
62 |
63 |
64 |
Configuration
65 |
66 |
67 |
68 |
73 |
74 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/test/js/BrowserPrep.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2013 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | log = function () {};
17 | if (typeof console !== "undefined" && console.log) {
18 | log = function (msg) {
19 | console.log("Test: " + msg);
20 | }
21 | }
22 |
23 | var TinCanTest,
24 | TinCanTestCfg;
25 |
26 | (function () {
27 | TinCanTest = TinCanTest || {};
28 |
29 | TinCanTest.assertHttpRequestType = function (xhr, name) {
30 | var desc = "assertHttpRequestType: " + name;
31 | if (typeof XDomainRequest !== "undefined" && xhr instanceof XDomainRequest) {
32 | ok(true, desc);
33 | return;
34 | }
35 |
36 | if (typeof XMLHttpRequest !== "undefined") {
37 | //
38 | // in IE7 at least XMLHttpRequest is an 'object' but it fails
39 | // the instanceof check because it apparently isn't considered
40 | // a constructor function
41 | //
42 | if (typeof XMLHttpRequest === "function") {
43 | ok(xhr instanceof XMLHttpRequest, desc);
44 | }
45 | else if (typeof XMLHttpRequest === "object") {
46 | ok(true, desc + " (XMLHttpRequest found but not constructor)");
47 | }
48 | else {
49 | ok(true, desc + " (unplanned for xhr)");
50 | }
51 | return;
52 | }
53 |
54 | ok(false, desc + " (unrecognized request environment)");
55 | };
56 |
57 | TinCanTest.loadBinaryFileContents = function (callback) {
58 | var request = new XMLHttpRequest();
59 | request.open("GET", "files/image.jpg", true);
60 | request.responseType = "arraybuffer";
61 |
62 | request.onload = function (e) {
63 | if (request.status !== 200) {
64 | throw "Failed to retrieve binary file contents (" + request.status + ")";
65 | }
66 | fileContents = request.response;
67 | callback.call(null, fileContents);
68 | };
69 |
70 | request.send();
71 | };
72 |
73 | TinCanTest.testAttachments = true;
74 |
75 | //
76 | // can't support attachments with content in browsers that don't support
77 | // an XHR2 implementation, essentially IE < 10, so set a flag to skip
78 | // testing related functionality
79 | //
80 | if (! ("withCredentials" in new XMLHttpRequest())) {
81 | TinCanTest.testAttachments = false;
82 | alert("Not testing attachments with content");
83 | }
84 | }());
85 |
--------------------------------------------------------------------------------
/test/js/NodePrep.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2013 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var fs = require("fs"),
18 | config = {
19 | assertHttpRequestType: function (xhr, name) {
20 | var desc = "(not implemented) assertHttpRequestType: " + name;
21 | ok(true, desc);
22 | },
23 | loadBinaryFileContents: function (callback) {
24 | fs.readFile(
25 | __dirname + "/../files/image.jpg",
26 | function (err, data) {
27 | var fileContents,
28 | ab,
29 | view,
30 | i;
31 |
32 | if (err) throw err;
33 |
34 | if (typeof data.buffer === "undefined") {
35 | ab = new ArrayBuffer(data.length);
36 | view = new Uint8Array(ab);
37 | for (i = 0; i < data.length; i += 1) {
38 | view[i] = data[i];
39 | }
40 | fileContents = ab;
41 | }
42 | else {
43 | fileContents = data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength);
44 | }
45 | callback.call(null, fileContents);
46 | }
47 | );
48 | },
49 | testAttachments: true
50 | };
51 |
52 | module.exports = config;
53 | }());
54 |
--------------------------------------------------------------------------------
/test/js/unit/About.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2014 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null,
18 | commonVersions = [
19 | ".95",
20 | "1.0",
21 | "1.1"
22 | ]
23 | ;
24 |
25 | QUnit.module("About Statics");
26 |
27 | test(
28 | "About.fromJSON",
29 | function () {
30 | var raw = {},
31 | string,
32 | result
33 | ;
34 |
35 | result = TinCan.About.fromJSON(JSON.stringify(raw));
36 | ok(result instanceof TinCan.About, "returns TinCan.About");
37 | }
38 | );
39 |
40 | QUnit.module("About Instance");
41 |
42 | test(
43 | "about Object",
44 | function () {
45 | var obj = new TinCan.About (),
46 | nullProps = [
47 | "version"
48 | ],
49 | i
50 | ;
51 |
52 | ok(obj instanceof TinCan.About, "object is TinCan.About");
53 |
54 | for (i = 0; i < nullProps.length; i += 1) {
55 | ok(obj.hasOwnProperty(nullProps[i]), "object has property: " + nullProps[i]);
56 | strictEqual(obj[nullProps[i]], null, "object property initial value: " + nullProps[i]);
57 | }
58 |
59 | strictEqual(obj.LOG_SRC, "About", "object property LOG_SRC initial value");
60 | }
61 | );
62 |
63 | test(
64 | "about variants",
65 | function () {
66 | var set = [
67 | {
68 | name: "basic properties: expected string type array",
69 | cfg: {
70 | version: commonVersions
71 | },
72 | checkProps: {
73 | version: commonVersions
74 | }
75 | }
76 | ],
77 | i,
78 | obj,
79 | result
80 | ;
81 |
82 | for (i = 0; i < set.length; i += 1) {
83 | row = set[i];
84 | obj = new TinCan.About (row.cfg);
85 |
86 | ok(obj instanceof TinCan.About, "object is TinCan.About (" + row.name + ")");
87 | if (typeof row.checkProps !== "undefined") {
88 | for (key in row.checkProps) {
89 | deepEqual(obj[key], row.checkProps[key], "object property initial value: " + key + " (" + row.name + ")");
90 | }
91 | }
92 | }
93 | }
94 | );
95 | }());
96 |
--------------------------------------------------------------------------------
/test/js/unit/InteractionComponent.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null;
18 |
19 | QUnit.module("InteractionComponent Statics");
20 |
21 | test(
22 | "InteractionComponent.fromJSON",
23 | function () {
24 | var raw = {},
25 | string,
26 | result
27 | ;
28 |
29 | result = TinCan.InteractionComponent.fromJSON(JSON.stringify(raw));
30 | ok(result instanceof TinCan.InteractionComponent, "returns TinCan.InteractionComponent");
31 | }
32 | );
33 | }());
34 |
--------------------------------------------------------------------------------
/test/js/unit/Result.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null;
18 |
19 | QUnit.module("Result Statics");
20 |
21 | test(
22 | "Result.fromJSON",
23 | function () {
24 | var raw = {},
25 | string,
26 | result
27 | ;
28 |
29 | result = TinCan.Result.fromJSON(JSON.stringify(raw));
30 | ok(result instanceof TinCan.Result, "returns TinCan.Result");
31 | }
32 | );
33 | }());
34 |
--------------------------------------------------------------------------------
/test/js/unit/Score.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null;
18 |
19 | QUnit.module("Score Statics");
20 |
21 | test(
22 | "Score.fromJSON",
23 | function () {
24 | var raw = {},
25 | string,
26 | result
27 | ;
28 |
29 | result = TinCan.Score.fromJSON(JSON.stringify(raw));
30 | ok(result instanceof TinCan.Score, "returns TinCan.Score");
31 | }
32 | );
33 | }());
34 |
--------------------------------------------------------------------------------
/test/js/unit/State.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null,
18 | commonId = "testState",
19 | commonContentString = "test content",
20 | commonContentStringType = "text/plain";
21 |
22 | QUnit.module("State Statics");
23 |
24 | test(
25 | "State.fromJSON",
26 | function () {
27 | var raw = {},
28 | string,
29 | result
30 | ;
31 |
32 | result = TinCan.State.fromJSON(JSON.stringify(raw));
33 | ok(result instanceof TinCan.State, "returns TinCan.State");
34 | }
35 | );
36 |
37 | QUnit.module("State Instance");
38 |
39 | test(
40 | "state Object",
41 | function () {
42 | var obj = new TinCan.State (),
43 | nullProps = [
44 | "id",
45 | "contents",
46 | "contentType",
47 | "etag"
48 | ],
49 | i
50 | ;
51 |
52 | ok(obj instanceof TinCan.State, "object is TinCan.State");
53 |
54 | for (i = 0; i < nullProps.length; i += 1) {
55 | ok(obj.hasOwnProperty(nullProps[i]), "object has property: " + nullProps[i]);
56 | strictEqual(obj[nullProps[i]], null, "object property initial value: " + nullProps[i]);
57 | }
58 |
59 | ok(obj.hasOwnProperty("updated"), "object has property: updated");
60 | strictEqual(obj.updated, false, "object property initial value: updated");
61 |
62 | strictEqual(obj.LOG_SRC, "State", "object property LOG_SRC initial value");
63 | }
64 | );
65 |
66 | test(
67 | "state variants",
68 | function () {
69 | var set = [
70 | {
71 | name: "basic properties: string content",
72 | instanceConfig: {
73 | id: commonId,
74 | contents: commonContentString,
75 | contentType: commonContentStringType
76 | },
77 | checkProps: {
78 | id: commonId,
79 | contents: commonContentString,
80 | contentType: commonContentStringType
81 | }
82 | }
83 | ],
84 | i,
85 | obj,
86 | result
87 | ;
88 |
89 | for (i = 0; i < set.length; i += 1) {
90 | row = set[i];
91 | obj = new TinCan.State (row.instanceConfig);
92 |
93 | ok(obj instanceof TinCan.State, "object is TinCan.State (" + row.name + ")");
94 | if (typeof row.checkProps !== "undefined") {
95 | for (key in row.checkProps) {
96 | deepEqual(obj[key], row.checkProps[key], "object property initial value: " + key + " (" + row.name + ")");
97 | }
98 | }
99 | }
100 | }
101 | );
102 | }());
103 |
--------------------------------------------------------------------------------
/test/js/unit/StatementRef.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null;
18 |
19 | QUnit.module("StatementRef Statics");
20 |
21 | test(
22 | "StatementRef.fromJSON",
23 | function () {
24 | var raw = {},
25 | string,
26 | result
27 | ;
28 |
29 | result = TinCan.StatementRef.fromJSON(JSON.stringify(raw));
30 | ok(result instanceof TinCan.StatementRef, "returns TinCan.StatementRef");
31 | }
32 | );
33 | }());
34 |
--------------------------------------------------------------------------------
/test/js/unit/StatementsResult.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null;
18 |
19 | QUnit.module("StatementsResult Statics");
20 |
21 | test(
22 | "StatementsResult.fromJSON",
23 | function () {
24 | var raw = {
25 | statements: []
26 | },
27 | string,
28 | result
29 | ;
30 |
31 | result = TinCan.StatementsResult.fromJSON(JSON.stringify(raw));
32 | ok(result instanceof TinCan.StatementsResult, "returns TinCan.StatementsResult");
33 | }
34 | );
35 | }());
36 |
--------------------------------------------------------------------------------
/test/js/unit/SubStatement.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null;
18 |
19 | QUnit.module("SubStatement Statics");
20 |
21 | test(
22 | "SubStatement.fromJSON",
23 | function () {
24 | var raw = {},
25 | string,
26 | result
27 | ;
28 |
29 | result = TinCan.SubStatement.fromJSON(JSON.stringify(raw));
30 | ok(result instanceof TinCan.SubStatement, "returns TinCan.SubStatement");
31 | }
32 | );
33 | test(
34 | "SubStatement.asVersion empty",
35 | function () {
36 | var raw = {},
37 | string,
38 | result,
39 | key,
40 | checkProps = {
41 | objectType: "SubStatement",
42 | actor: undefined,
43 | verb: undefined,
44 | target: undefined
45 | }
46 | ;
47 |
48 | result = TinCan.SubStatement.fromJSON(JSON.stringify(raw)).asVersion();
49 | for (key in checkProps){
50 | deepEqual(result[key], checkProps[key], "object property initial value: " + key);
51 | }
52 | }
53 | );
54 | }());
55 |
--------------------------------------------------------------------------------
/test/js/unit/TinCan.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012-3 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | // TODO: figure out how to handle dynamic configuration of LRSes
18 |
19 | var session = null,
20 | versions = TinCan.versions(),
21 | i,
22 | version;
23 |
24 | QUnit.module("TinCan Statics");
25 |
26 | test(
27 | "TinCan debugging",
28 | function () {
29 | ok(TinCan.hasOwnProperty("DEBUG"), "TinCan has property: DEBUG");
30 | ok(!TinCan.DEBUG, "TinCan.DEBUG initial value");
31 |
32 | TinCan.enableDebug()
33 | ok(TinCan.DEBUG, "TinCan.enableDebug()");
34 |
35 | TinCan.disableDebug()
36 | ok(!TinCan.DEBUG, "TinCan.disableDebug()");
37 | }
38 | );
39 | test(
40 | "TinCan.versions",
41 | function () {
42 | deepEqual(TinCan.versions(), ["1.0.2", "1.0.1", "1.0.0", "0.95", "0.9"], "Supported spec versions");
43 | }
44 | );
45 |
46 | QUnit.module("TinCan Instance");
47 |
48 | test(
49 | "tincan Object",
50 | function () {
51 | var tincan = new TinCan ();
52 |
53 | ok(tincan instanceof TinCan, "tincan is TinCan");
54 |
55 | // test direct properties from construction
56 | ok(tincan.hasOwnProperty("recordStores"), "tincan has property: recordStores");
57 | deepEqual(tincan.recordStores, [], "tincan.recordStores property initial value");
58 | ok(tincan.hasOwnProperty("actor"), "tincan has property: actor");
59 | strictEqual(tincan.actor, null, "tincan.actor property initial value");
60 | ok(tincan.hasOwnProperty("activity"), "tincan has property: activity");
61 | strictEqual(tincan.activity, null, "tincan.activity property initial value");
62 | ok(tincan.hasOwnProperty("registration"), "tincan has property: registration");
63 | strictEqual(tincan.registration, null, "tincan.registration property initial value");
64 | ok(tincan.hasOwnProperty("context"), "tincan has property: context");
65 | strictEqual(tincan.context, null, "tincan.context property initial value");
66 |
67 | // test properties from prototype
68 | strictEqual(tincan.LOG_SRC, "TinCan", "tincan property LOG_SRC initial value");
69 | }
70 | );
71 | }());
72 |
--------------------------------------------------------------------------------
/test/js/unit/Verb.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Copyright 2012 Rustici Software
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | (function () {
17 | var session = null;
18 |
19 | QUnit.module("Verb Statics");
20 |
21 | test(
22 | "Verb.fromJSON",
23 | function () {
24 | var raw = {
25 | id: "http://tincanapi.com/TinCanJS/Test/Verb_fromJSON"
26 | },
27 | string,
28 | result
29 | ;
30 |
31 | result = TinCan.Verb.fromJSON(JSON.stringify(raw));
32 | ok(result instanceof TinCan.Verb, "returns TinCan.Verb");
33 | }
34 | );
35 | }());
36 |
--------------------------------------------------------------------------------
/test/node-runner.js:
--------------------------------------------------------------------------------
1 | var testRunner = require("qunit"),
2 | args = process.argv.slice(2),
3 | tests,
4 | isJSUnitFile = /^js\/unit\//,
5 | isAbsoluteFile = /^\//;
6 |
7 | if (args.length) {
8 | tests = args;
9 | }
10 | else {
11 | tests = [
12 | "State.js",
13 | "ActivityProfile.js",
14 | "AgentProfile.js",
15 | "StatementsResult.js",
16 | "Agent.js",
17 | "Group.js",
18 | "Activity.js",
19 | "ActivityDefinition.js",
20 | "ContextActivities.js",
21 | "Context.js",
22 | "InteractionComponent.js",
23 | "Result.js",
24 | "Score.js",
25 | "Statement.js",
26 | "StatementRef.js",
27 | "SubStatement.js",
28 | "Verb.js",
29 | "Utils.js",
30 | "TinCan.js",
31 | "TinCan-async.js",
32 | "LRS.js",
33 | "About.js",
34 | "Attachment.js"
35 | ];
36 | }
37 |
38 | for (i = 0; i < tests.length; i += 1) {
39 | if (isJSUnitFile.test(tests[i])) {
40 | tests[i] = __dirname + "/" + tests[i];
41 | continue;
42 | }
43 | if (! isAbsoluteFile.test(tests[i])) {
44 | tests[i] = __dirname + "/js/unit/" + tests[i];
45 | }
46 | }
47 |
48 | testRunner.setup(
49 | {
50 | log: {
51 | // log currently testing code file
52 | testing: true
53 |
54 | // log assertions overview
55 | //,assertions: true
56 |
57 | // log tests overview
58 | //,tests: true
59 |
60 | // log expected and actual values for failed tests
61 | ,errors: true
62 |
63 | // log summary
64 | //,summary: true
65 |
66 | // log global summary (all files)
67 | ,globalSummary: true
68 | }
69 | }
70 | );
71 |
72 | testRunner.run(
73 | {
74 | deps: [
75 | { path: __dirname + "/js/NodePrep.js", namespace: "TinCanTest" },
76 | { path: __dirname + "/config.js", namespace: "TinCanTestCfg" }
77 | ],
78 | code: { path: __dirname + "/../build/tincan-node.js", namespace: "TinCan" },
79 | tests: tests
80 | },
81 | function (err, report) {
82 | if (err) {
83 | if (err instanceof Error) {
84 | throw err;
85 | }
86 | throw new Error(err);
87 | }
88 | if (report.failed > 0) {
89 | throw new Error("Tests had failures: " + report.failed);
90 | }
91 | }
92 | );
93 |
--------------------------------------------------------------------------------
/test/single/About.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (About)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Activity.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Activity)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/ActivityDefinition.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (ActivityDefinition)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/ActivityProfile.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (ActivityProfile)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Agent.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Agent)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/AgentAccount.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (AgentAccount)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/AgentProfile.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (AgentProfile)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Attachment.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Attachment)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Context.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Context)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/ContextActivities.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (ContextActivities)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Group.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Group)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/InteractionComponent.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (InteractionComponent)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/LRS-browser.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (LRS)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/LRS.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (LRS)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Result.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Result)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Score.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Score)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/State.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (State)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Statement.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Statement)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/StatementRef.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (StatementRef)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/StatementsResult.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (StatementsResult)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/SubStatement.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (SubStatement)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/TinCan-async.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (TinCan)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/TinCan-sync.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (TinCan)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/TinCan.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (TinCan)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Utils.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Utils)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/Verb.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (Verb)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/test/single/offline.html:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | TinCanJS Tests (offline)
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/LICENSE:
--------------------------------------------------------------------------------
1 | http://code.google.com/p/crypto-js/wiki/License
2 |
3 | © 2009–2012 by Jeff Mott. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6 |
7 | Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
8 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation or other materials provided with the distribution.
9 | Neither the name CryptoJS nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10 | 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 HOLDER 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.
11 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/aes-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var r=CryptoJS,u=r.lib.BlockCipher,o=r.algo,g=[],v=[],w=[],x=[],y=[],z=[],p=[],q=[],s=[],t=[];(function(){for(var b=[],c=0;256>c;c++)b[c]=128>c?c<<1:c<<1^283;for(var a=0,f=0,c=0;256>c;c++){var d=f^f<<1^f<<2^f<<3^f<<4,d=d>>>8^d&255^99;g[a]=d;v[d]=a;var e=b[a],A=b[e],h=b[A],i=257*b[d]^16843008*d;w[a]=i<<24|i>>>8;x[a]=i<<16|i>>>16;y[a]=i<<8|i>>>24;z[a]=i;i=16843009*h^65537*A^257*e^16843008*a;p[d]=i<<24|i>>>8;q[d]=i<<16|i>>>16;s[d]=i<<8|i>>>24;t[d]=i;a?(a=e^b[b[b[h^e]]],f^=b[b[f]]):a=f=1}})();
8 | var B=[0,1,2,4,8,16,32,64,128,27,54],o=o.AES=u.extend({_doReset:function(){for(var b=this._key,c=b.words,a=b.sigBytes/4,b=4*((this._nRounds=a+6)+1),f=this._keySchedule=[],d=0;d>>24]<<24|g[e>>>16&255]<<16|g[e>>>8&255]<<8|g[e&255]):(e=e<<8|e>>>24,e=g[e>>>24]<<24|g[e>>>16&255]<<16|g[e>>>8&255]<<8|g[e&255],e^=B[d/a|0]<<24);f[d]=f[d-a]^e}c=this._invKeySchedule=[];for(a=0;aa||4>=d?e:p[g[e>>>24]]^q[g[e>>>
9 | 16&255]]^s[g[e>>>8&255]]^t[g[e&255]]},encryptBlock:function(b,c){this._doCryptBlock(b,c,this._keySchedule,w,x,y,z,g)},decryptBlock:function(b,c){var a=b[c+1];b[c+1]=b[c+3];b[c+3]=a;this._doCryptBlock(b,c,this._invKeySchedule,p,q,s,t,v);a=b[c+1];b[c+1]=b[c+3];b[c+3]=a},_doCryptBlock:function(b,c,a,f,d,e,g,h){for(var i=this._nRounds,k=b[c]^a[0],l=b[c+1]^a[1],m=b[c+2]^a[2],j=b[c+3]^a[3],n=4,r=1;r>>24]^d[l>>>16&255]^e[m>>>8&255]^g[j&255]^a[n++],p=f[l>>>24]^d[m>>>16&255]^e[j>>>8&255]^
10 | g[k&255]^a[n++],q=f[m>>>24]^d[j>>>16&255]^e[k>>>8&255]^g[l&255]^a[n++],j=f[j>>>24]^d[k>>>16&255]^e[l>>>8&255]^g[m&255]^a[n++],k=o,l=p,m=q;o=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[j&255])^a[n++];p=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[k&255])^a[n++];q=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[l&255])^a[n++];j=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[m&255])^a[n++];b[c]=o;b[c+1]=p;b[c+2]=q;b[c+3]=j},keySize:8});r.AES=u._createHelper(o)})();
11 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/core-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | var CryptoJS=CryptoJS||function(h,o){var f={},j=f.lib={},k=j.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;b&&c.mixIn(b);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),i=j.WordArray=k.extend({init:function(a,b){a=
8 | this.words=a||[];this.sigBytes=b!=o?b:4*a.length},toString:function(a){return(a||p).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var e=0;e>>2]|=(c[e>>>2]>>>24-8*(e%4)&255)<<24-8*((d+e)%4);else if(65535>>2]=c[e>>>2];else b.push.apply(b,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=
9 | k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],c=0;c>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16));c.push((e&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return i.create(c,b/2)}},n=l.Latin1={stringify:function(a){for(var b=
10 | a.words,a=a.sigBytes,c=[],d=0;d>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return i.create(c,b)}},q=l.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}},m=j.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=i.create();
11 | this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=q.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,e=this.blockSize,f=d/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0),a=f*e,d=h.min(4*a,d);if(a){for(var g=0;g>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var b=b.replace(/\s/g,""),e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));
8 | for(var c=[],a=0,d=0;d>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return i.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
9 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/enc-utf16-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var e=CryptoJS,f=e.lib.WordArray;e.enc.Utf16={stringify:function(b){for(var d=b.words,b=b.sigBytes,c=[],a=0;a>>2]>>>16-8*(a%4)&65535));return c.join("")},parse:function(b){for(var d=b.length,c=[],a=0;a>>1]|=b.charCodeAt(a)<<16-16*(a%2);return f.create(c,2*d)}}})();
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/enc-utf16.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function () {
8 | // Shortcuts
9 | var C = CryptoJS;
10 | var C_lib = C.lib;
11 | var WordArray = C_lib.WordArray;
12 | var C_enc = C.enc;
13 |
14 | /**
15 | * UTF-16 BE encoding strategy.
16 | */
17 | var Utf16 = C_enc.Utf16 = {
18 | /**
19 | * Converts a word array to a UTF-16 string.
20 | *
21 | * @param {WordArray} wordArray The word array.
22 | *
23 | * @return {string} The UTF-16 string.
24 | *
25 | * @static
26 | *
27 | * @example
28 | *
29 | * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
30 | */
31 | stringify: function (wordArray) {
32 | // Shortcuts
33 | var words = wordArray.words;
34 | var sigBytes = wordArray.sigBytes;
35 |
36 | // Convert
37 | var utf16Chars = [];
38 | for (var i = 0; i < sigBytes; i += 2) {
39 | var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
40 | utf16Chars.push(String.fromCharCode(codePoint));
41 | }
42 |
43 | return utf16Chars.join('');
44 | },
45 |
46 | /**
47 | * Converts a UTF-16 string to a word array.
48 | *
49 | * @param {string} utf16Str The UTF-16 string.
50 | *
51 | * @return {WordArray} The word array.
52 | *
53 | * @static
54 | *
55 | * @example
56 | *
57 | * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
58 | */
59 | parse: function (utf16Str) {
60 | // Shortcut
61 | var utf16StrLength = utf16Str.length;
62 |
63 | // Convert
64 | var words = [];
65 | for (var i = 0; i < utf16StrLength; i++) {
66 | words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
67 | }
68 |
69 | return WordArray.create(words, utf16StrLength * 2);
70 | }
71 | };
72 | }());
73 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/evpkdf-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var b=CryptoJS,a=b.lib,f=a.Base,j=a.WordArray,a=b.algo,k=a.EvpKDF=f.extend({cfg:f.extend({keySize:4,hasher:a.MD5,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=c.hasher.create(),g=j.create(),f=g.words,h=c.keySize,c=c.iterations;f.lengthe&&(b=a.finalize(b));for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,i=g.words,d=0;d>>32-e)+c}function l(b,c,a,f,d,e,g){b=b+(c&f|a&~f)+d+g;return(b<>>32-e)+c}function m(b,c,a,f,d,e,g){b=b+(c^a^f)+d+g;return(b<>>32-e)+c}function n(b,c,a,f,d,e,g){b=b+(a^(c|~f))+d+g;return(b<>>32-e)+c}var o=CryptoJS,j=o.lib,r=j.WordArray,j=j.Hasher,p=o.algo,i=[];(function(){for(var b=0;64>b;b++)i[b]=4294967296*q.abs(q.sin(b+1))|0})();p=p.MD5=j.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,
8 | 2562383102,271733878])},_doProcessBlock:function(b,c){for(var a=0;16>a;a++){var f=c+a,d=b[f];b[f]=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360}for(var f=this._hash.words,d=f[0],e=f[1],g=f[2],h=f[3],a=0;64>a;a+=4)16>a?(d=k(d,e,g,h,b[c+a],7,i[a]),h=k(h,d,e,g,b[c+a+1],12,i[a+1]),g=k(g,h,d,e,b[c+a+2],17,i[a+2]),e=k(e,g,h,d,b[c+a+3],22,i[a+3])):32>a?(d=l(d,e,g,h,b[c+(a+1)%16],5,i[a]),h=l(h,d,e,g,b[c+(a+6)%16],9,i[a+1]),g=l(g,h,d,e,b[c+(a+11)%16],14,i[a+2]),e=l(e,g,h,d,b[c+a%16],20,i[a+3])):48>a?(d=
9 | m(d,e,g,h,b[c+(3*a+5)%16],4,i[a]),h=m(h,d,e,g,b[c+(3*a+8)%16],11,i[a+1]),g=m(g,h,d,e,b[c+(3*a+11)%16],16,i[a+2]),e=m(e,g,h,d,b[c+(3*a+14)%16],23,i[a+3])):(d=n(d,e,g,h,b[c+3*a%16],6,i[a]),h=n(h,d,e,g,b[c+(3*a+7)%16],10,i[a+1]),g=n(g,h,d,e,b[c+(3*a+14)%16],15,i[a+2]),e=n(e,g,h,d,b[c+(3*a+5)%16],21,i[a+3]));f[0]=f[0]+d|0;f[1]=f[1]+e|0;f[2]=f[2]+g|0;f[3]=f[3]+h|0},_doFinalize:function(){var b=this._data,c=b.words,a=8*this._nDataBytes,f=8*b.sigBytes;c[f>>>5]|=128<<24-f%32;c[(f+64>>>9<<4)+14]=(a<<8|a>>>
10 | 24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(c.length+1);this._process();b=this._hash.words;for(c=0;4>c;c++)a=b[c],b[c]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});o.MD5=j._createHelper(p);o.HmacMD5=j._createHmacHelper(p)})(Math);
11 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/mode-cfb-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.mode.CFB=function(){function g(c,b,e,a){var d=this._iv;d?(d=d.slice(0),this._iv=void 0):d=this._prevBlock;a.encryptBlock(d,0);for(a=0;a>>2]|=c<<24-8*(b%4);a.sigBytes+=c},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-ansix923.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * ANSI X.923 padding strategy.
9 | */
10 | CryptoJS.pad.AnsiX923 = {
11 | pad: function (data, blockSize) {
12 | // Shortcuts
13 | var dataSigBytes = data.sigBytes;
14 | var blockSizeBytes = blockSize * 4;
15 |
16 | // Count padding bytes
17 | var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
18 |
19 | // Compute last byte position
20 | var lastBytePos = dataSigBytes + nPaddingBytes - 1;
21 |
22 | // Pad
23 | data.clamp();
24 | data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
25 | data.sigBytes += nPaddingBytes;
26 | },
27 |
28 | unpad: function (data) {
29 | // Get number of padding bytes from last byte
30 | var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
31 |
32 | // Remove padding
33 | data.sigBytes -= nPaddingBytes;
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-iso10126-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.pad.Iso10126={pad:function(a,c){var b=4*c,b=b-a.sigBytes%b;a.concat(CryptoJS.lib.WordArray.random(b-1)).concat(CryptoJS.lib.WordArray.create([b<<24],1))},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-iso10126.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * ISO 10126 padding strategy.
9 | */
10 | CryptoJS.pad.Iso10126 = {
11 | pad: function (data, blockSize) {
12 | // Shortcut
13 | var blockSizeBytes = blockSize * 4;
14 |
15 | // Count padding bytes
16 | var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
17 |
18 | // Pad
19 | data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
20 | concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
21 | },
22 |
23 | unpad: function (data) {
24 | // Get number of padding bytes from last byte
25 | var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
26 |
27 | // Remove padding
28 | data.sigBytes -= nPaddingBytes;
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-iso97971-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.pad.Iso97971={pad:function(a,b){a.concat(CryptoJS.lib.WordArray.create([2147483648],1));CryptoJS.pad.ZeroPadding.pad(a,b)},unpad:function(a){CryptoJS.pad.ZeroPadding.unpad(a);a.sigBytes--}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-iso97971.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * ISO/IEC 9797-1 Padding Method 2.
9 | */
10 | CryptoJS.pad.Iso97971 = {
11 | pad: function (data, blockSize) {
12 | // Add 0x80 byte
13 | data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
14 |
15 | // Zero pad the rest
16 | CryptoJS.pad.ZeroPadding.pad(data, blockSize);
17 | },
18 |
19 | unpad: function (data) {
20 | // Remove zero padding
21 | CryptoJS.pad.ZeroPadding.unpad(data);
22 |
23 | // Remove one more byte -- the 0x80 byte
24 | data.sigBytes--;
25 | }
26 | };
27 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-nopadding-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-nopadding.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * A noop padding strategy.
9 | */
10 | CryptoJS.pad.NoPadding = {
11 | pad: function () {
12 | },
13 |
14 | unpad: function () {
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-zeropadding-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.pad.ZeroPadding={pad:function(a,c){var b=4*c;a.clamp();a.sigBytes+=b-(a.sigBytes%b||b)},unpad:function(a){for(var c=a.words,b=a.sigBytes-1;!(c[b>>>2]>>>24-8*(b%4)&255);)b--;a.sigBytes=b+1}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pad-zeropadding.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * Zero padding strategy.
9 | */
10 | CryptoJS.pad.ZeroPadding = {
11 | pad: function (data, blockSize) {
12 | // Shortcut
13 | var blockSizeBytes = blockSize * 4;
14 |
15 | // Pad
16 | data.clamp();
17 | data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
18 | },
19 |
20 | unpad: function (data) {
21 | // Shortcut
22 | var dataWords = data.words;
23 |
24 | // Unpad
25 | var i = data.sigBytes - 1;
26 | while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
27 | i--;
28 | }
29 | data.sigBytes = i + 1;
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/pbkdf2-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var b=CryptoJS,a=b.lib,d=a.Base,l=a.WordArray,a=b.algo,o=a.HMAC,k=a.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:a.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,f=o.create(c.hasher,a),g=l.create(),d=l.create([1]),k=g.words,p=d.words,m=c.keySize,c=c.iterations;k.lengthb[0]>>>0?1:0)|0;b[2]=b[2]+886263092+(3545052371>b[1]>>>0?1:0)|0;b[3]=b[3]+1295307597+(886263092>b[2]>>>0?1:0)|0;b[4]=b[4]+3545052371+(1295307597>b[3]>>>0?1:0)|0;b[5]=b[5]+886263092+(3545052371>b[4]>>>0?1:0)|0;b[6]=b[6]+1295307597+(886263092>b[5]>>>0?1:0)|0;b[7]=b[7]+3545052371+(1295307597>b[6]>>>0?1:0)|0;this._b=3545052371>b[7]>>>0?1:0;for(var a=0;8>a;a++){var d=c[a]+b[a],e=d&65535,g=d>>>
8 | 16;h[a]=((e*e>>>17)+e*g>>>15)+g*g^((d&4294901760)*d|0)+((d&65535)*d|0)}var b=h[0],a=h[1],d=h[2],e=h[3],g=h[4],f=h[5],i=h[6],j=h[7];c[0]=b+(j<<16|j>>>16)+(i<<16|i>>>16)|0;c[1]=a+(b<<8|b>>>24)+j|0;c[2]=d+(a<<16|a>>>16)+(b<<16|b>>>16)|0;c[3]=e+(d<<8|d>>>24)+a|0;c[4]=g+(e<<16|e>>>16)+(d<<16|d>>>16)|0;c[5]=f+(g<<8|g>>>24)+e|0;c[6]=i+(f<<16|f>>>16)+(g<<16|g>>>16)|0;c[7]=j+(i<<8|i>>>24)+f|0}var l=CryptoJS,m=l.lib.StreamCipher,f=[],h=[],n=l.algo.Rabbit=m.extend({_doReset:function(){for(var c=this._key.words,
9 | b=c[0],a=c[1],d=c[2],e=c[3],c=this._X=[b,e<<16|d>>>16,a,b<<16|e>>>16,d,a<<16|b>>>16,e,d<<16|a>>>16],b=this._C=[d<<16|d>>>16,b&4294901760|a&65535,e<<16|e>>>16,a&4294901760|d&65535,b<<16|b>>>16,d&4294901760|e&65535,a<<16|a>>>16,e&4294901760|b&65535],a=this._b=0;4>a;a++)k.call(this);for(a=0;8>a;a++)b[a]^=c[a+4&7];if(c=this.cfg.iv){a=c.words;c=a[0];a=a[1];c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;d=c>>>16|a&4294901760;e=a<<16|c&65535;b[0]^=c;b[1]^=
10 | d;b[2]^=a;b[3]^=e;b[4]^=c;b[5]^=d;b[6]^=a;b[7]^=e;for(a=0;4>a;a++)k.call(this)}},_doProcessBlock:function(c,b){var a=this._X;k.call(this);f[0]=a[0]^a[5]>>>16^a[3]<<16;f[1]=a[2]^a[7]>>>16^a[5]<<16;f[2]=a[4]^a[1]>>>16^a[7]<<16;f[3]=a[6]^a[3]>>>16^a[1]<<16;for(a=0;4>a;a++){var d=f[a],d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360;c[b+a]^=d}},blockSize:4,ivSize:2});l.Rabbit=m._createHelper(n)})();
11 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/rc4-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){function k(){for(var a=this._S,d=this._i,c=this._j,b=0,e=0;4>e;e++){var d=(d+1)%256,c=(c+a[d])%256,f=a[d];a[d]=a[c];a[c]=f;b|=a[(a[d]+a[c])%256]<<24-8*e}this._i=d;this._j=c;return b}var g=CryptoJS,j=g.lib.StreamCipher,h=g.algo,i=h.RC4=j.extend({_doReset:function(){for(var a=this._key,d=a.words,a=a.sigBytes,c=this._S=[],b=0;256>b;b++)c[b]=b;for(var e=b=0;256>b;b++){var f=b%a,e=(e+c[b]+(d[f>>>2]>>>24-8*(f%4)&255))%256,f=c[b];c[b]=c[e];c[e]=f}this._i=this._j=0},_doProcessBlock:function(a,
8 | d){a[d]^=k.call(this)},keySize:8,ivSize:0});g.RC4=j._createHelper(i);h=h.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var a=this.cfg.drop;0>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
34 |
35 | j = (j + S[i] + keyByte) % 256;
36 |
37 | // Swap
38 | var t = S[i];
39 | S[i] = S[j];
40 | S[j] = t;
41 | }
42 |
43 | // Counters
44 | this._i = this._j = 0;
45 | },
46 |
47 | _doProcessBlock: function (M, offset) {
48 | M[offset] ^= generateKeystreamWord.call(this);
49 | },
50 |
51 | keySize: 256/32,
52 |
53 | ivSize: 0
54 | });
55 |
56 | function generateKeystreamWord() {
57 | // Shortcuts
58 | var S = this._S;
59 | var i = this._i;
60 | var j = this._j;
61 |
62 | // Generate keystream word
63 | var keystreamWord = 0;
64 | for (var n = 0; n < 4; n++) {
65 | i = (i + 1) % 256;
66 | j = (j + S[i]) % 256;
67 |
68 | // Swap
69 | var t = S[i];
70 | S[i] = S[j];
71 | S[j] = t;
72 |
73 | keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
74 | }
75 |
76 | // Update counters
77 | this._i = i;
78 | this._j = j;
79 |
80 | return keystreamWord;
81 | }
82 |
83 | /**
84 | * Shortcut functions to the cipher's object interface.
85 | *
86 | * @example
87 | *
88 | * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
89 | * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
90 | */
91 | C.RC4 = StreamCipher._createHelper(RC4);
92 |
93 | /**
94 | * RC4-drop stream cipher algorithm.
95 | */
96 | var RC4Drop = C_algo.RC4Drop = RC4.extend({
97 | /**
98 | * Configuration options.
99 | *
100 | * @property {number} drop The number of keystream words to drop. Default 192
101 | */
102 | cfg: RC4.cfg.extend({
103 | drop: 192
104 | }),
105 |
106 | _doReset: function () {
107 | RC4._doReset.call(this);
108 |
109 | // Drop
110 | for (var i = this.cfg.drop; i > 0; i--) {
111 | generateKeystreamWord.call(this);
112 | }
113 | }
114 | });
115 |
116 | /**
117 | * Shortcut functions to the cipher's object interface.
118 | *
119 | * @example
120 | *
121 | * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
122 | * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
123 | */
124 | C.RC4Drop = StreamCipher._createHelper(RC4Drop);
125 | }());
126 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/sha1-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var d=CryptoJS,c=d.lib,l=c.WordArray,c=c.Hasher,j=[],k=d.algo.SHA1=c.extend({_doReset:function(){this._hash=l.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,m){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],i=a[3],d=a[4],b=0;80>b;b++){if(16>b)j[b]=c[m+b]|0;else{var g=j[b-3]^j[b-8]^j[b-14]^j[b-16];j[b]=g<<1|g>>>31}g=(e<<5|e>>>27)+d+j[b];g=20>b?g+((f&h|~f&i)+1518500249):40>b?g+((f^h^i)+1859775393):60>b?g+((f&h|f&i|h&i)-1894007588):g+((f^h^i)-
8 | 899497514);d=i;i=h;h=f<<30|f>>>2;f=e;e=g}a[0]=a[0]+e|0;a[1]=a[1]+f|0;a[2]=a[2]+h|0;a[3]=a[3]+i|0;a[4]=a[4]+d|0},_doFinalize:function(){var d=this._data,c=d.words,a=8*this._nDataBytes,e=8*d.sigBytes;c[e>>>5]|=128<<24-e%32;c[(e+64>>>9<<4)+15]=a;d.sigBytes=4*c.length;this._process()}});d.SHA1=c._createHelper(k);d.HmacSHA1=c._createHmacHelper(k)})();
9 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/sha224-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var b=CryptoJS,d=b.lib.WordArray,a=b.algo,c=a.SHA256,a=a.SHA224=c.extend({_doReset:function(){this._hash=d.create([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){c._doFinalize.call(this);this._hash.sigBytes-=4}});b.SHA224=c._createHelper(a);b.HmacSHA224=c._createHmacHelper(a)})();
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/sha224.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function () {
8 | // Shortcuts
9 | var C = CryptoJS;
10 | var C_lib = C.lib;
11 | var WordArray = C_lib.WordArray;
12 | var C_algo = C.algo;
13 | var SHA256 = C_algo.SHA256;
14 |
15 | /**
16 | * SHA-224 hash algorithm.
17 | */
18 | var SHA224 = C_algo.SHA224 = SHA256.extend({
19 | _doReset: function () {
20 | this._hash = WordArray.create([
21 | 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
22 | 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
23 | ]);
24 | },
25 |
26 | _doFinalize: function () {
27 | SHA256._doFinalize.call(this);
28 |
29 | this._hash.sigBytes -= 4;
30 | }
31 | });
32 |
33 | /**
34 | * Shortcut function to the hasher's object interface.
35 | *
36 | * @param {WordArray|string} message The message to hash.
37 | *
38 | * @return {WordArray} The hash.
39 | *
40 | * @static
41 | *
42 | * @example
43 | *
44 | * var hash = CryptoJS.SHA224('message');
45 | * var hash = CryptoJS.SHA224(wordArray);
46 | */
47 | C.SHA224 = SHA256._createHelper(SHA224);
48 |
49 | /**
50 | * Shortcut function to the HMAC's object interface.
51 | *
52 | * @param {WordArray|string} message The message to hash.
53 | * @param {WordArray|string} key The secret key.
54 | *
55 | * @return {WordArray} The HMAC.
56 | *
57 | * @static
58 | *
59 | * @example
60 | *
61 | * var hmac = CryptoJS.HmacSHA224(message, key);
62 | */
63 | C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
64 | }());
65 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/sha256-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(k){var h=CryptoJS,i=h.lib,r=i.WordArray,i=i.Hasher,c=h.algo,p=[],q=[];(function(){function g(a){for(var b=k.sqrt(a),d=2;d<=b;d++)if(!(a%d))return!1;return!0}function d(a){return 4294967296*(a-(a|0))|0}for(var a=2,b=0;64>b;)g(a)&&(8>b&&(p[b]=d(k.pow(a,0.5))),q[b]=d(k.pow(a,1/3)),b++),a++})();var g=[],c=c.SHA256=i.extend({_doReset:function(){this._hash=r.create(p.slice(0))},_doProcessBlock:function(i,d){for(var a=this._hash.words,b=a[0],m=a[1],n=a[2],h=a[3],f=a[4],c=a[5],o=a[6],k=a[7],e=0;64>
8 | e;e++){if(16>e)g[e]=i[d+e]|0;else{var j=g[e-15],l=g[e-2];g[e]=((j<<25|j>>>7)^(j<<14|j>>>18)^j>>>3)+g[e-7]+((l<<15|l>>>17)^(l<<13|l>>>19)^l>>>10)+g[e-16]}j=k+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&c^~f&o)+q[e]+g[e];l=((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+(b&m^b&n^m&n);k=o;o=c;c=f;f=h+j|0;h=n;n=m;m=b;b=j+l|0}a[0]=a[0]+b|0;a[1]=a[1]+m|0;a[2]=a[2]+n|0;a[3]=a[3]+h|0;a[4]=a[4]+f|0;a[5]=a[5]+c|0;a[6]=a[6]+o|0;a[7]=a[7]+k|0},_doFinalize:function(){var c=this._data,d=c.words,a=8*this._nDataBytes,
9 | b=8*c.sigBytes;d[b>>>5]|=128<<24-b%32;d[(b+64>>>9<<4)+15]=a;c.sigBytes=4*d.length;this._process()}});h.SHA256=i._createHelper(c);h.HmacSHA256=i._createHmacHelper(c)})(Math);
10 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/sha384-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var c=CryptoJS,a=c.x64,b=a.Word,e=a.WordArray,a=c.algo,d=a.SHA512,a=a.SHA384=d.extend({_doReset:function(){this._hash=e.create([b.create(3418070365,3238371032),b.create(1654270250,914150663),b.create(2438529370,812702999),b.create(355462360,4144912697),b.create(1731405415,4290775857),b.create(2394180231,1750603025),b.create(3675008525,1694076839),b.create(1203062813,3204075428)])},_doFinalize:function(){d._doFinalize.call(this);this._hash.sigBytes-=16}});c.SHA384=d._createHelper(a);c.HmacSHA384=
8 | d._createHmacHelper(a)})();
9 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/sha384.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function () {
8 | // Shortcuts
9 | var C = CryptoJS;
10 | var C_x64 = C.x64;
11 | var X64Word = C_x64.Word;
12 | var X64WordArray = C_x64.WordArray;
13 | var C_algo = C.algo;
14 | var SHA512 = C_algo.SHA512;
15 |
16 | /**
17 | * SHA-384 hash algorithm.
18 | */
19 | var SHA384 = C_algo.SHA384 = SHA512.extend({
20 | _doReset: function () {
21 | this._hash = X64WordArray.create([
22 | X64Word.create(0xcbbb9d5d, 0xc1059ed8), X64Word.create(0x629a292a, 0x367cd507),
23 | X64Word.create(0x9159015a, 0x3070dd17), X64Word.create(0x152fecd8, 0xf70e5939),
24 | X64Word.create(0x67332667, 0xffc00b31), X64Word.create(0x8eb44a87, 0x68581511),
25 | X64Word.create(0xdb0c2e0d, 0x64f98fa7), X64Word.create(0x47b5481d, 0xbefa4fa4)
26 | ]);
27 | },
28 |
29 | _doFinalize: function () {
30 | SHA512._doFinalize.call(this);
31 |
32 | this._hash.sigBytes -= 16;
33 | }
34 | });
35 |
36 | /**
37 | * Shortcut function to the hasher's object interface.
38 | *
39 | * @param {WordArray|string} message The message to hash.
40 | *
41 | * @return {WordArray} The hash.
42 | *
43 | * @static
44 | *
45 | * @example
46 | *
47 | * var hash = CryptoJS.SHA384('message');
48 | * var hash = CryptoJS.SHA384(wordArray);
49 | */
50 | C.SHA384 = SHA512._createHelper(SHA384);
51 |
52 | /**
53 | * Shortcut function to the HMAC's object interface.
54 | *
55 | * @param {WordArray|string} message The message to hash.
56 | * @param {WordArray|string} key The secret key.
57 | *
58 | * @return {WordArray} The HMAC.
59 | *
60 | * @static
61 | *
62 | * @example
63 | *
64 | * var hmac = CryptoJS.HmacSHA384(message, key);
65 | */
66 | C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
67 | }());
68 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.0.2/components/x64-core-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.0.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2012 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(g){var a=CryptoJS,f=a.lib,e=f.Base,h=f.WordArray,a=a.x64={};a.Word=e.extend({init:function(b,c){this.high=b;this.low=c}});a.WordArray=e.extend({init:function(b,c){b=this.words=b||[];this.sigBytes=c!=g?c:8*b.length},toX32:function(){for(var b=this.words,c=b.length,a=[],d=0;dk;k++)g[k]=128>k?k<<1:k<<1^283;for(var n=0,l=0,k=0;256>k;k++){var f=l^l<<1^l<<2^l<<3^l<<4,f=f>>>8^f&255^99;j[n]=f;y[f]=n;var t=g[n],D=g[t],E=g[D],b=257*g[f]^16843008*f;z[n]=b<<24|b>>>8;A[n]=b<<16|b>>>16;B[n]=b<<8|b>>>24;C[n]=b;b=16843009*E^65537*D^257*t^16843008*n;s[f]=b<<24|b>>>8;u[f]=b<<16|b>>>16;v[f]=b<<8|b>>>24;w[f]=b;n?(n=t^g[g[g[E^t]]],l^=g[g[l]]):n=l=1}var F=[0,1,2,4,8,
8 | 16,32,64,128,27,54],r=r.AES=x.extend({_doReset:function(){for(var c=this._key,e=c.words,a=c.sigBytes/4,c=4*((this._nRounds=a+6)+1),b=this._keySchedule=[],h=0;h>>24]<<24|j[d>>>16&255]<<16|j[d>>>8&255]<<8|j[d&255]):(d=d<<8|d>>>24,d=j[d>>>24]<<24|j[d>>>16&255]<<16|j[d>>>8&255]<<8|j[d&255],d^=F[h/a|0]<<24);b[h]=b[h-a]^d}e=this._invKeySchedule=[];for(a=0;aa||4>=h?d:s[j[d>>>24]]^u[j[d>>>16&255]]^v[j[d>>>
9 | 8&255]]^w[j[d&255]]},encryptBlock:function(c,e){this._doCryptBlock(c,e,this._keySchedule,z,A,B,C,j)},decryptBlock:function(c,e){var a=c[e+1];c[e+1]=c[e+3];c[e+3]=a;this._doCryptBlock(c,e,this._invKeySchedule,s,u,v,w,y);a=c[e+1];c[e+1]=c[e+3];c[e+3]=a},_doCryptBlock:function(c,e,a,b,h,d,j,m){for(var n=this._nRounds,f=c[e]^a[0],g=c[e+1]^a[1],k=c[e+2]^a[2],p=c[e+3]^a[3],l=4,t=1;t>>24]^h[g>>>16&255]^d[k>>>8&255]^j[p&255]^a[l++],r=b[g>>>24]^h[k>>>16&255]^d[p>>>8&255]^j[f&255]^a[l++],s=
10 | b[k>>>24]^h[p>>>16&255]^d[f>>>8&255]^j[g&255]^a[l++],p=b[p>>>24]^h[f>>>16&255]^d[g>>>8&255]^j[k&255]^a[l++],f=q,g=r,k=s;q=(m[f>>>24]<<24|m[g>>>16&255]<<16|m[k>>>8&255]<<8|m[p&255])^a[l++];r=(m[g>>>24]<<24|m[k>>>16&255]<<16|m[p>>>8&255]<<8|m[f&255])^a[l++];s=(m[k>>>24]<<24|m[p>>>16&255]<<16|m[f>>>8&255]<<8|m[g&255])^a[l++];p=(m[p>>>24]<<24|m[f>>>16&255]<<16|m[g>>>8&255]<<8|m[k&255])^a[l++];c[e]=q;c[e+1]=r;c[e+2]=s;c[e+3]=p},keySize:8});q.AES=x._createHelper(r)})();
11 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/core-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | var CryptoJS=CryptoJS||function(h,r){var k={},l=k.lib={},n=function(){},f=l.Base={extend:function(a){n.prototype=this;var b=new n;a&&b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
8 | j=l.WordArray=f.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=r?b:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;a=a.sigBytes;this.clamp();if(c%4)for(var e=0;e>>2]|=(d[e>>>2]>>>24-8*(e%4)&255)<<24-8*((c+e)%4);else if(65535>>2]=d[e>>>2];else b.push.apply(b,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<
9 | 32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d>>2]>>>24-8*(c%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>3]|=parseInt(a.substr(c,
10 | 2),16)<<24-4*(c%8);return new j.init(d,b/2)}},p=m.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return new j.init(d,b)}},t=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}},
11 | q=l.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new j.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=t.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;c=h.min(4*a,c);if(a){for(var g=0;g>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));for(var c=[],a=0,d=0;d<
8 | e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
9 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/enc-utf16-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var e=CryptoJS,f=e.lib.WordArray,e=e.enc;e.Utf16=e.Utf16BE={stringify:function(b){var d=b.words;b=b.sigBytes;for(var c=[],a=0;a>>2]>>>16-8*(a%4)&65535));return c.join("")},parse:function(b){for(var d=b.length,c=[],a=0;a>>1]|=b.charCodeAt(a)<<16-16*(a%2);return f.create(c,2*d)}};e.Utf16LE={stringify:function(b){var d=b.words;b=b.sigBytes;for(var c=[],a=0;a>>2]>>>16-8*(a%4)&65535)<<8&4278255360|(d[a>>>
8 | 2]>>>16-8*(a%4)&65535)>>>8&16711935));return c.join("")},parse:function(b){for(var d=b.length,c=[],a=0;a>>1,j=e[g],h=b.charCodeAt(a)<<16-16*(a%2);e[g]=j|h<<8&4278255360|h>>>8&16711935}return f.create(c,2*d)}}})();
9 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/evpkdf-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var b=CryptoJS,a=b.lib,f=a.Base,k=a.WordArray,a=b.algo,l=a.EvpKDF=f.extend({cfg:f.extend({keySize:4,hasher:a.MD5,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=c.hasher.create(),g=k.create(),f=g.words,h=c.keySize,c=c.iterations;f.lengthe&&(b=a.finalize(b));b.clamp();for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,j=g.words,d=0;d>>2]|=a[c]<<
8 | 24-8*(c%4);e.call(this,d,b)}else e.apply(this,arguments)}).prototype=b}})();
9 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/lib-typedarrays.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function () {
8 | // Check if typed arrays are supported
9 | if (typeof ArrayBuffer != 'function') {
10 | return;
11 | }
12 |
13 | // Shortcuts
14 | var C = CryptoJS;
15 | var C_lib = C.lib;
16 | var WordArray = C_lib.WordArray;
17 |
18 | // Reference original init
19 | var superInit = WordArray.init;
20 |
21 | // Augment WordArray.init to handle typed arrays
22 | var subInit = WordArray.init = function (typedArray) {
23 | // Convert buffers to uint8
24 | if (typedArray instanceof ArrayBuffer) {
25 | typedArray = new Uint8Array(typedArray);
26 | }
27 |
28 | // Convert other array views to uint8
29 | if (
30 | typedArray instanceof Int8Array ||
31 | typedArray instanceof Uint8ClampedArray ||
32 | typedArray instanceof Int16Array ||
33 | typedArray instanceof Uint16Array ||
34 | typedArray instanceof Int32Array ||
35 | typedArray instanceof Uint32Array ||
36 | typedArray instanceof Float32Array ||
37 | typedArray instanceof Float64Array
38 | ) {
39 | typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
40 | }
41 |
42 | // Handle Uint8Array
43 | if (typedArray instanceof Uint8Array) {
44 | // Shortcut
45 | var typedArrayByteLength = typedArray.byteLength;
46 |
47 | // Extract bytes
48 | var words = [];
49 | for (var i = 0; i < typedArrayByteLength; i++) {
50 | words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
51 | }
52 |
53 | // Initialize this word array
54 | superInit.call(this, words, typedArrayByteLength);
55 | } else {
56 | // Else call normal init
57 | superInit.apply(this, arguments);
58 | }
59 | };
60 |
61 | subInit.prototype = WordArray;
62 | }());
63 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/md5-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(E){function h(a,f,g,j,p,h,k){a=a+(f&g|~f&j)+p+k;return(a<>>32-h)+f}function k(a,f,g,j,p,h,k){a=a+(f&j|g&~j)+p+k;return(a<>>32-h)+f}function l(a,f,g,j,h,k,l){a=a+(f^g^j)+h+l;return(a<>>32-k)+f}function n(a,f,g,j,h,k,l){a=a+(g^(f|~j))+h+l;return(a<>>32-k)+f}for(var r=CryptoJS,q=r.lib,F=q.WordArray,s=q.Hasher,q=r.algo,a=[],t=0;64>t;t++)a[t]=4294967296*E.abs(E.sin(t+1))|0;q=q.MD5=s.extend({_doReset:function(){this._hash=new F.init([1732584193,4023233417,2562383102,271733878])},
8 | _doProcessBlock:function(m,f){for(var g=0;16>g;g++){var j=f+g,p=m[j];m[j]=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360}var g=this._hash.words,j=m[f+0],p=m[f+1],q=m[f+2],r=m[f+3],s=m[f+4],t=m[f+5],u=m[f+6],v=m[f+7],w=m[f+8],x=m[f+9],y=m[f+10],z=m[f+11],A=m[f+12],B=m[f+13],C=m[f+14],D=m[f+15],b=g[0],c=g[1],d=g[2],e=g[3],b=h(b,c,d,e,j,7,a[0]),e=h(e,b,c,d,p,12,a[1]),d=h(d,e,b,c,q,17,a[2]),c=h(c,d,e,b,r,22,a[3]),b=h(b,c,d,e,s,7,a[4]),e=h(e,b,c,d,t,12,a[5]),d=h(d,e,b,c,u,17,a[6]),c=h(c,d,e,b,v,22,a[7]),
9 | b=h(b,c,d,e,w,7,a[8]),e=h(e,b,c,d,x,12,a[9]),d=h(d,e,b,c,y,17,a[10]),c=h(c,d,e,b,z,22,a[11]),b=h(b,c,d,e,A,7,a[12]),e=h(e,b,c,d,B,12,a[13]),d=h(d,e,b,c,C,17,a[14]),c=h(c,d,e,b,D,22,a[15]),b=k(b,c,d,e,p,5,a[16]),e=k(e,b,c,d,u,9,a[17]),d=k(d,e,b,c,z,14,a[18]),c=k(c,d,e,b,j,20,a[19]),b=k(b,c,d,e,t,5,a[20]),e=k(e,b,c,d,y,9,a[21]),d=k(d,e,b,c,D,14,a[22]),c=k(c,d,e,b,s,20,a[23]),b=k(b,c,d,e,x,5,a[24]),e=k(e,b,c,d,C,9,a[25]),d=k(d,e,b,c,r,14,a[26]),c=k(c,d,e,b,w,20,a[27]),b=k(b,c,d,e,B,5,a[28]),e=k(e,b,
10 | c,d,q,9,a[29]),d=k(d,e,b,c,v,14,a[30]),c=k(c,d,e,b,A,20,a[31]),b=l(b,c,d,e,t,4,a[32]),e=l(e,b,c,d,w,11,a[33]),d=l(d,e,b,c,z,16,a[34]),c=l(c,d,e,b,C,23,a[35]),b=l(b,c,d,e,p,4,a[36]),e=l(e,b,c,d,s,11,a[37]),d=l(d,e,b,c,v,16,a[38]),c=l(c,d,e,b,y,23,a[39]),b=l(b,c,d,e,B,4,a[40]),e=l(e,b,c,d,j,11,a[41]),d=l(d,e,b,c,r,16,a[42]),c=l(c,d,e,b,u,23,a[43]),b=l(b,c,d,e,x,4,a[44]),e=l(e,b,c,d,A,11,a[45]),d=l(d,e,b,c,D,16,a[46]),c=l(c,d,e,b,q,23,a[47]),b=n(b,c,d,e,j,6,a[48]),e=n(e,b,c,d,v,10,a[49]),d=n(d,e,b,c,
11 | C,15,a[50]),c=n(c,d,e,b,t,21,a[51]),b=n(b,c,d,e,A,6,a[52]),e=n(e,b,c,d,r,10,a[53]),d=n(d,e,b,c,y,15,a[54]),c=n(c,d,e,b,p,21,a[55]),b=n(b,c,d,e,w,6,a[56]),e=n(e,b,c,d,D,10,a[57]),d=n(d,e,b,c,u,15,a[58]),c=n(c,d,e,b,B,21,a[59]),b=n(b,c,d,e,s,6,a[60]),e=n(e,b,c,d,z,10,a[61]),d=n(d,e,b,c,q,15,a[62]),c=n(c,d,e,b,x,21,a[63]);g[0]=g[0]+b|0;g[1]=g[1]+c|0;g[2]=g[2]+d|0;g[3]=g[3]+e|0},_doFinalize:function(){var a=this._data,f=a.words,g=8*this._nDataBytes,j=8*a.sigBytes;f[j>>>5]|=128<<24-j%32;var h=E.floor(g/
12 | 4294967296);f[(j+64>>>9<<4)+15]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;f[(j+64>>>9<<4)+14]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360;a.sigBytes=4*(f.length+1);this._process();a=this._hash;f=a.words;for(g=0;4>g;g++)j=f[g],f[g]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360;return a},clone:function(){var a=s.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=s._createHelper(q);r.HmacMD5=s._createHmacHelper(q)})(Math);
13 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/mode-cfb-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.mode.CFB=function(){function g(c,b,e,a){var d=this._iv;d?(d=d.slice(0),this._iv=void 0):d=this._prevBlock;a.encryptBlock(d,0);for(a=0;a>24&255)){var c=a>>16&255,b=a>>8&255,e=a&255;255===c?(c=0,255===b?(b=0,255===e?e=0:++e):++b):++c;a=0+(c<<16)+(b<<8);a+=e}else a+=16777216;return a}var g=CryptoJS.lib.BlockCipherMode.extend(),j=g.Encryptor=g.extend({processBlock:function(a,c){var b=this._cipher,e=b.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0);d=f;if(0===(d[0]=h(d[0])))d[1]=h(d[1]);f=f.slice(0);b.encryptBlock(f,0);for(b=0;b> 24) & 0xff) === 0xff) { //overflow
18 | var b1 = (word >> 16)&0xff;
19 | var b2 = (word >> 8)&0xff;
20 | var b3 = word & 0xff;
21 |
22 | if (b1 === 0xff) // overflow b1
23 | {
24 | b1 = 0;
25 | if (b2 === 0xff)
26 | {
27 | b2 = 0;
28 | if (b3 === 0xff)
29 | {
30 | b3 = 0;
31 | }
32 | else
33 | {
34 | ++b3;
35 | }
36 | }
37 | else
38 | {
39 | ++b2;
40 | }
41 | }
42 | else
43 | {
44 | ++b1;
45 | }
46 |
47 | word = 0;
48 | word += (b1 << 16);
49 | word += (b2 << 8);
50 | word += b3;
51 | }
52 | else
53 | {
54 | word += (0x01 << 24);
55 | }
56 | return word;
57 | }
58 |
59 | function incCounter(counter)
60 | {
61 | if ((counter[0] = incWord(counter[0])) === 0)
62 | {
63 | // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
64 | counter[1] = incWord(counter[1]);
65 | }
66 | return counter;
67 | }
68 |
69 | var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
70 | processBlock: function (words, offset) {
71 | // Shortcuts
72 | var cipher = this._cipher
73 | var blockSize = cipher.blockSize;
74 | var iv = this._iv;
75 | var counter = this._counter;
76 |
77 | // Generate keystream
78 | if (iv) {
79 | counter = this._counter = iv.slice(0);
80 |
81 | // Remove IV for subsequent blocks
82 | this._iv = undefined;
83 | }
84 |
85 | incCounter(counter);
86 |
87 | var keystream = counter.slice(0);
88 | cipher.encryptBlock(keystream, 0);
89 |
90 | // Encrypt
91 | for (var i = 0; i < blockSize; i++) {
92 | words[offset + i] ^= keystream[i];
93 | }
94 | }
95 | });
96 |
97 | CTRGladman.Decryptor = Encryptor;
98 |
99 | return CTRGladman;
100 | }());
101 |
102 |
103 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/mode-ctr-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.mode.CTR=function(){var b=CryptoJS.lib.BlockCipherMode.extend(),g=b.Encryptor=b.extend({processBlock:function(b,f){var a=this._cipher,e=a.blockSize,c=this._iv,d=this._counter;c&&(d=this._counter=c.slice(0),this._iv=void 0);c=d.slice(0);a.encryptBlock(c,0);d[e-1]=d[e-1]+1|0;for(a=0;a>>2]|=c<<24-8*(b%4);a.sigBytes+=c},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-ansix923.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * ANSI X.923 padding strategy.
9 | */
10 | CryptoJS.pad.AnsiX923 = {
11 | pad: function (data, blockSize) {
12 | // Shortcuts
13 | var dataSigBytes = data.sigBytes;
14 | var blockSizeBytes = blockSize * 4;
15 |
16 | // Count padding bytes
17 | var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
18 |
19 | // Compute last byte position
20 | var lastBytePos = dataSigBytes + nPaddingBytes - 1;
21 |
22 | // Pad
23 | data.clamp();
24 | data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
25 | data.sigBytes += nPaddingBytes;
26 | },
27 |
28 | unpad: function (data) {
29 | // Get number of padding bytes from last byte
30 | var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
31 |
32 | // Remove padding
33 | data.sigBytes -= nPaddingBytes;
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-iso10126-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.pad.Iso10126={pad:function(a,c){var b=4*c,b=b-a.sigBytes%b;a.concat(CryptoJS.lib.WordArray.random(b-1)).concat(CryptoJS.lib.WordArray.create([b<<24],1))},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-iso10126.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * ISO 10126 padding strategy.
9 | */
10 | CryptoJS.pad.Iso10126 = {
11 | pad: function (data, blockSize) {
12 | // Shortcut
13 | var blockSizeBytes = blockSize * 4;
14 |
15 | // Count padding bytes
16 | var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
17 |
18 | // Pad
19 | data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
20 | concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
21 | },
22 |
23 | unpad: function (data) {
24 | // Get number of padding bytes from last byte
25 | var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
26 |
27 | // Remove padding
28 | data.sigBytes -= nPaddingBytes;
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-iso97971-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.pad.Iso97971={pad:function(a,b){a.concat(CryptoJS.lib.WordArray.create([2147483648],1));CryptoJS.pad.ZeroPadding.pad(a,b)},unpad:function(a){CryptoJS.pad.ZeroPadding.unpad(a);a.sigBytes--}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-iso97971.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * ISO/IEC 9797-1 Padding Method 2.
9 | */
10 | CryptoJS.pad.Iso97971 = {
11 | pad: function (data, blockSize) {
12 | // Add 0x80 byte
13 | data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
14 |
15 | // Zero pad the rest
16 | CryptoJS.pad.ZeroPadding.pad(data, blockSize);
17 | },
18 |
19 | unpad: function (data) {
20 | // Remove zero padding
21 | CryptoJS.pad.ZeroPadding.unpad(data);
22 |
23 | // Remove one more byte -- the 0x80 byte
24 | data.sigBytes--;
25 | }
26 | };
27 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-nopadding-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-nopadding.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * A noop padding strategy.
9 | */
10 | CryptoJS.pad.NoPadding = {
11 | pad: function () {
12 | },
13 |
14 | unpad: function () {
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-zeropadding-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | CryptoJS.pad.ZeroPadding={pad:function(a,c){var b=4*c;a.clamp();a.sigBytes+=b-(a.sigBytes%b||b)},unpad:function(a){for(var c=a.words,b=a.sigBytes-1;!(c[b>>>2]>>>24-8*(b%4)&255);)b--;a.sigBytes=b+1}};
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pad-zeropadding.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | /**
8 | * Zero padding strategy.
9 | */
10 | CryptoJS.pad.ZeroPadding = {
11 | pad: function (data, blockSize) {
12 | // Shortcut
13 | var blockSizeBytes = blockSize * 4;
14 |
15 | // Pad
16 | data.clamp();
17 | data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
18 | },
19 |
20 | unpad: function (data) {
21 | // Shortcut
22 | var dataWords = data.words;
23 |
24 | // Unpad
25 | var i = data.sigBytes - 1;
26 | while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
27 | i--;
28 | }
29 | data.sigBytes = i + 1;
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/pbkdf2-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var b=CryptoJS,a=b.lib,d=a.Base,m=a.WordArray,a=b.algo,q=a.HMAC,l=a.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:a.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,f=q.create(c.hasher,a),g=m.create(),d=m.create([1]),l=g.words,r=d.words,n=c.keySize,c=c.iterations;l.lengthc;c++)f[c]=d[c];d[0]=d[0]+1295307597+this._b|0;d[1]=d[1]+3545052371+(d[0]>>>0>>0?1:0)|0;d[2]=d[2]+886263092+(d[1]>>>0>>0?1:0)|0;d[3]=d[3]+1295307597+(d[2]>>>0>>0?1:0)|0;d[4]=d[4]+3545052371+(d[3]>>>0>>0?1:0)|0;d[5]=d[5]+886263092+(d[4]>>>0>>0?1:0)|0;d[6]=d[6]+1295307597+(d[5]>>>0>>0?1:0)|0;d[7]=d[7]+3545052371+(d[6]>>>0>>0?1:0)|0;this._b=d[7]>>>0>>0?1:0;for(c=0;8>c;c++){var h=a[c]+d[c],e=h&65535,
8 | g=h>>>16;b[c]=((e*e>>>17)+e*g>>>15)+g*g^((h&4294901760)*h|0)+((h&65535)*h|0)}a[0]=b[0]+(b[7]<<16|b[7]>>>16)+(b[6]<<16|b[6]>>>16)|0;a[1]=b[1]+(b[0]<<8|b[0]>>>24)+b[7]|0;a[2]=b[2]+(b[1]<<16|b[1]>>>16)+(b[0]<<16|b[0]>>>16)|0;a[3]=b[3]+(b[2]<<8|b[2]>>>24)+b[1]|0;a[4]=b[4]+(b[3]<<16|b[3]>>>16)+(b[2]<<16|b[2]>>>16)|0;a[5]=b[5]+(b[4]<<8|b[4]>>>24)+b[3]|0;a[6]=b[6]+(b[5]<<16|b[5]>>>16)+(b[4]<<16|b[4]>>>16)|0;a[7]=b[7]+(b[6]<<8|b[6]>>>24)+b[5]|0}var j=CryptoJS,k=j.lib.StreamCipher,e=[],f=[],b=[],l=j.algo.RabbitLegacy=
9 | k.extend({_doReset:function(){for(var a=this._key.words,d=this.cfg.iv,c=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],a=this._C=[a[2]<<16|a[2]>>>16,a[0]&4294901760|a[1]&65535,a[3]<<16|a[3]>>>16,a[1]&4294901760|a[2]&65535,a[0]<<16|a[0]>>>16,a[2]&4294901760|a[3]&65535,a[1]<<16|a[1]>>>16,a[3]&4294901760|a[0]&65535],b=this._b=0;4>b;b++)g.call(this);for(b=0;8>b;b++)a[b]^=c[b+4&7];if(d){var c=d.words,d=c[0],c=c[1],d=(d<<8|d>>>24)&16711935|(d<<
10 | 24|d>>>8)&4278255360,c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,b=d>>>16|c&4294901760,e=c<<16|d&65535;a[0]^=d;a[1]^=b;a[2]^=c;a[3]^=e;a[4]^=d;a[5]^=b;a[6]^=c;a[7]^=e;for(b=0;4>b;b++)g.call(this)}},_doProcessBlock:function(a,b){var c=this._X;g.call(this);e[0]=c[0]^c[5]>>>16^c[3]<<16;e[1]=c[2]^c[7]>>>16^c[5]<<16;e[2]=c[4]^c[1]>>>16^c[7]<<16;e[3]=c[6]^c[3]>>>16^c[1]<<16;for(c=0;4>c;c++)e[c]=(e[c]<<8|e[c]>>>24)&16711935|(e[c]<<24|e[c]>>>8)&4278255360,a[b+c]^=e[c]},blockSize:4,ivSize:2});j.RabbitLegacy=
11 | k._createHelper(l)})();
12 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/rabbit-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){function g(){for(var b=this._X,d=this._C,a=0;8>a;a++)f[a]=d[a];d[0]=d[0]+1295307597+this._b|0;d[1]=d[1]+3545052371+(d[0]>>>0>>0?1:0)|0;d[2]=d[2]+886263092+(d[1]>>>0>>0?1:0)|0;d[3]=d[3]+1295307597+(d[2]>>>0>>0?1:0)|0;d[4]=d[4]+3545052371+(d[3]>>>0>>0?1:0)|0;d[5]=d[5]+886263092+(d[4]>>>0>>0?1:0)|0;d[6]=d[6]+1295307597+(d[5]>>>0>>0?1:0)|0;d[7]=d[7]+3545052371+(d[6]>>>0>>0?1:0)|0;this._b=d[7]>>>0>>0?1:0;for(a=0;8>a;a++){var h=b[a]+d[a],e=h&65535,
8 | g=h>>>16;c[a]=((e*e>>>17)+e*g>>>15)+g*g^((h&4294901760)*h|0)+((h&65535)*h|0)}b[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0;b[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0;b[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0;b[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0;b[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0;b[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0;b[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0;b[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}var j=CryptoJS,k=j.lib.StreamCipher,e=[],f=[],c=[],l=j.algo.Rabbit=
9 | k.extend({_doReset:function(){for(var b=this._key.words,d=this.cfg.iv,a=0;4>a;a++)b[a]=(b[a]<<8|b[a]>>>24)&16711935|(b[a]<<24|b[a]>>>8)&4278255360;for(var c=this._X=[b[0],b[3]<<16|b[2]>>>16,b[1],b[0]<<16|b[3]>>>16,b[2],b[1]<<16|b[0]>>>16,b[3],b[2]<<16|b[1]>>>16],b=this._C=[b[2]<<16|b[2]>>>16,b[0]&4294901760|b[1]&65535,b[3]<<16|b[3]>>>16,b[1]&4294901760|b[2]&65535,b[0]<<16|b[0]>>>16,b[2]&4294901760|b[3]&65535,b[1]<<16|b[1]>>>16,b[3]&4294901760|b[0]&65535],a=this._b=0;4>a;a++)g.call(this);for(a=0;8>
10 | a;a++)b[a]^=c[a+4&7];if(d){var a=d.words,d=a[0],a=a[1],d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360,a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,c=d>>>16|a&4294901760,e=a<<16|d&65535;b[0]^=d;b[1]^=c;b[2]^=a;b[3]^=e;b[4]^=d;b[5]^=c;b[6]^=a;b[7]^=e;for(a=0;4>a;a++)g.call(this)}},_doProcessBlock:function(b,c){var a=this._X;g.call(this);e[0]=a[0]^a[5]>>>16^a[3]<<16;e[1]=a[2]^a[7]>>>16^a[5]<<16;e[2]=a[4]^a[1]>>>16^a[7]<<16;e[3]=a[6]^a[3]>>>16^a[1]<<16;for(a=0;4>a;a++)e[a]=(e[a]<<8|e[a]>>>24)&
11 | 16711935|(e[a]<<24|e[a]>>>8)&4278255360,b[c+a]^=e[a]},blockSize:4,ivSize:2});j.Rabbit=k._createHelper(l)})();
12 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/rc4-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){function l(){for(var a=this._S,d=this._i,c=this._j,b=0,e=0;4>e;e++){var d=(d+1)%256,c=(c+a[d])%256,f=a[d];a[d]=a[c];a[c]=f;b|=a[(a[d]+a[c])%256]<<24-8*e}this._i=d;this._j=c;return b}var g=CryptoJS,k=g.lib.StreamCipher,h=g.algo,j=h.RC4=k.extend({_doReset:function(){for(var a=this._key,d=a.words,a=a.sigBytes,c=this._S=[],b=0;256>b;b++)c[b]=b;for(var e=b=0;256>b;b++){var f=b%a,e=(e+c[b]+(d[f>>>2]>>>24-8*(f%4)&255))%256,f=c[b];c[b]=c[e];c[e]=f}this._i=this._j=0},_doProcessBlock:function(a,
8 | d){a[d]^=l.call(this)},keySize:8,ivSize:0});g.RC4=k._createHelper(j);h=h.RC4Drop=j.extend({cfg:j.cfg.extend({drop:192}),_doReset:function(){j._doReset.call(this);for(var a=this.cfg.drop;0>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
34 |
35 | j = (j + S[i] + keyByte) % 256;
36 |
37 | // Swap
38 | var t = S[i];
39 | S[i] = S[j];
40 | S[j] = t;
41 | }
42 |
43 | // Counters
44 | this._i = this._j = 0;
45 | },
46 |
47 | _doProcessBlock: function (M, offset) {
48 | M[offset] ^= generateKeystreamWord.call(this);
49 | },
50 |
51 | keySize: 256/32,
52 |
53 | ivSize: 0
54 | });
55 |
56 | function generateKeystreamWord() {
57 | // Shortcuts
58 | var S = this._S;
59 | var i = this._i;
60 | var j = this._j;
61 |
62 | // Generate keystream word
63 | var keystreamWord = 0;
64 | for (var n = 0; n < 4; n++) {
65 | i = (i + 1) % 256;
66 | j = (j + S[i]) % 256;
67 |
68 | // Swap
69 | var t = S[i];
70 | S[i] = S[j];
71 | S[j] = t;
72 |
73 | keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
74 | }
75 |
76 | // Update counters
77 | this._i = i;
78 | this._j = j;
79 |
80 | return keystreamWord;
81 | }
82 |
83 | /**
84 | * Shortcut functions to the cipher's object interface.
85 | *
86 | * @example
87 | *
88 | * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
89 | * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
90 | */
91 | C.RC4 = StreamCipher._createHelper(RC4);
92 |
93 | /**
94 | * Modified RC4 stream cipher algorithm.
95 | */
96 | var RC4Drop = C_algo.RC4Drop = RC4.extend({
97 | /**
98 | * Configuration options.
99 | *
100 | * @property {number} drop The number of keystream words to drop. Default 192
101 | */
102 | cfg: RC4.cfg.extend({
103 | drop: 192
104 | }),
105 |
106 | _doReset: function () {
107 | RC4._doReset.call(this);
108 |
109 | // Drop
110 | for (var i = this.cfg.drop; i > 0; i--) {
111 | generateKeystreamWord.call(this);
112 | }
113 | }
114 | });
115 |
116 | /**
117 | * Shortcut functions to the cipher's object interface.
118 | *
119 | * @example
120 | *
121 | * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
122 | * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
123 | */
124 | C.RC4Drop = StreamCipher._createHelper(RC4Drop);
125 | }());
126 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/sha1-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var k=CryptoJS,b=k.lib,m=b.WordArray,l=b.Hasher,d=[],b=k.algo.SHA1=l.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(n,p){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],j=a[3],b=a[4],c=0;80>c;c++){if(16>c)d[c]=n[p+c]|0;else{var g=d[c-3]^d[c-8]^d[c-14]^d[c-16];d[c]=g<<1|g>>>31}g=(e<<5|e>>>27)+b+d[c];g=20>c?g+((f&h|~f&j)+1518500249):40>c?g+((f^h^j)+1859775393):60>c?g+((f&h|f&j|h&j)-1894007588):g+((f^h^
8 | j)-899497514);b=j;j=h;h=f<<30|f>>>2;f=e;e=g}a[0]=a[0]+e|0;a[1]=a[1]+f|0;a[2]=a[2]+h|0;a[3]=a[3]+j|0;a[4]=a[4]+b|0},_doFinalize:function(){var b=this._data,d=b.words,a=8*this._nDataBytes,e=8*b.sigBytes;d[e>>>5]|=128<<24-e%32;d[(e+64>>>9<<4)+14]=Math.floor(a/4294967296);d[(e+64>>>9<<4)+15]=a;b.sigBytes=4*d.length;this._process();return this._hash},clone:function(){var b=l.clone.call(this);b._hash=this._hash.clone();return b}});k.SHA1=l._createHelper(b);k.HmacSHA1=l._createHmacHelper(b)})();
9 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/sha224-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var b=CryptoJS,d=b.lib.WordArray,a=b.algo,c=a.SHA256,a=a.SHA224=c.extend({_doReset:function(){this._hash=new d.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=c._doFinalize.call(this);a.sigBytes-=4;return a}});b.SHA224=c._createHelper(a);b.HmacSHA224=c._createHmacHelper(a)})();
8 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/sha224.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function () {
8 | // Shortcuts
9 | var C = CryptoJS;
10 | var C_lib = C.lib;
11 | var WordArray = C_lib.WordArray;
12 | var C_algo = C.algo;
13 | var SHA256 = C_algo.SHA256;
14 |
15 | /**
16 | * SHA-224 hash algorithm.
17 | */
18 | var SHA224 = C_algo.SHA224 = SHA256.extend({
19 | _doReset: function () {
20 | this._hash = new WordArray.init([
21 | 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
22 | 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
23 | ]);
24 | },
25 |
26 | _doFinalize: function () {
27 | var hash = SHA256._doFinalize.call(this);
28 |
29 | hash.sigBytes -= 4;
30 |
31 | return hash;
32 | }
33 | });
34 |
35 | /**
36 | * Shortcut function to the hasher's object interface.
37 | *
38 | * @param {WordArray|string} message The message to hash.
39 | *
40 | * @return {WordArray} The hash.
41 | *
42 | * @static
43 | *
44 | * @example
45 | *
46 | * var hash = CryptoJS.SHA224('message');
47 | * var hash = CryptoJS.SHA224(wordArray);
48 | */
49 | C.SHA224 = SHA256._createHelper(SHA224);
50 |
51 | /**
52 | * Shortcut function to the HMAC's object interface.
53 | *
54 | * @param {WordArray|string} message The message to hash.
55 | * @param {WordArray|string} key The secret key.
56 | *
57 | * @return {WordArray} The HMAC.
58 | *
59 | * @static
60 | *
61 | * @example
62 | *
63 | * var hmac = CryptoJS.HmacSHA224(message, key);
64 | */
65 | C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
66 | }());
67 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/sha256-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(k){for(var g=CryptoJS,h=g.lib,v=h.WordArray,j=h.Hasher,h=g.algo,s=[],t=[],u=function(q){return 4294967296*(q-(q|0))|0},l=2,b=0;64>b;){var d;a:{d=l;for(var w=k.sqrt(d),r=2;r<=w;r++)if(!(d%r)){d=!1;break a}d=!0}d&&(8>b&&(s[b]=u(k.pow(l,0.5))),t[b]=u(k.pow(l,1/3)),b++);l++}var n=[],h=h.SHA256=j.extend({_doReset:function(){this._hash=new v.init(s.slice(0))},_doProcessBlock:function(q,h){for(var a=this._hash.words,c=a[0],d=a[1],b=a[2],k=a[3],f=a[4],g=a[5],j=a[6],l=a[7],e=0;64>e;e++){if(16>e)n[e]=
8 | q[h+e]|0;else{var m=n[e-15],p=n[e-2];n[e]=((m<<25|m>>>7)^(m<<14|m>>>18)^m>>>3)+n[e-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+n[e-16]}m=l+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&g^~f&j)+t[e]+n[e];p=((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+(c&d^c&b^d&b);l=j;j=g;g=f;f=k+m|0;k=b;b=d;d=c;c=m+p|0}a[0]=a[0]+c|0;a[1]=a[1]+d|0;a[2]=a[2]+b|0;a[3]=a[3]+k|0;a[4]=a[4]+f|0;a[5]=a[5]+g|0;a[6]=a[6]+j|0;a[7]=a[7]+l|0},_doFinalize:function(){var d=this._data,b=d.words,a=8*this._nDataBytes,c=8*d.sigBytes;
9 | b[c>>>5]|=128<<24-c%32;b[(c+64>>>9<<4)+14]=k.floor(a/4294967296);b[(c+64>>>9<<4)+15]=a;d.sigBytes=4*b.length;this._process();return this._hash},clone:function(){var b=j.clone.call(this);b._hash=this._hash.clone();return b}});g.SHA256=j._createHelper(h);g.HmacSHA256=j._createHmacHelper(h)})(Math);
10 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/sha3-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(y){for(var p=CryptoJS,m=p.lib,z=m.WordArray,q=m.Hasher,s=p.x64.Word,m=p.algo,v=[],w=[],x=[],c=1,d=0,l=0;24>l;l++){v[c+5*d]=(l+1)*(l+2)/2%64;var r=(2*c+3*d)%5,c=d%5,d=r}for(c=0;5>c;c++)for(d=0;5>d;d++)w[c+5*d]=d+5*((2*c+3*d)%5);c=1;for(d=0;24>d;d++){for(var t=r=l=0;7>t;t++){if(c&1){var u=(1<u?r^=1<c;c++)j[c]=s.create();m=m.SHA3=q.extend({cfg:q.cfg.extend({outputLength:512}),_doReset:function(){for(var c=this._state=
8 | [],n=0;25>n;n++)c[n]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(c,n){for(var h=this._state,d=this.blockSize/2,b=0;b>>24)&16711935|(e<<24|e>>>8)&4278255360,f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,a=h[b];a.high^=f;a.low^=e}for(d=0;24>d;d++){for(b=0;5>b;b++){for(var k=e=0,g=0;5>g;g++)a=h[b+5*g],e^=a.high,k^=a.low;a=j[b];a.high=e;a.low=k}for(b=0;5>b;b++){a=j[(b+4)%5];e=j[(b+1)%5];f=e.high;g=e.low;e=a.high^
9 | (f<<1|g>>>31);k=a.low^(g<<1|f>>>31);for(g=0;5>g;g++)a=h[b+5*g],a.high^=e,a.low^=k}for(f=1;25>f;f++)a=h[f],b=a.high,a=a.low,g=v[f],32>g?(e=b<>>32-g,k=a<>>32-g):(e=a<>>64-g,k=b<>>64-g),a=j[w[f]],a.high=e,a.low=k;a=j[0];b=h[0];a.high=b.high;a.low=b.low;for(b=0;5>b;b++)for(g=0;5>g;g++)f=b+5*g,a=h[f],e=j[f],f=j[(b+1)%5+5*g],k=j[(b+2)%5+5*g],a.high=e.high^~f.high&k.high,a.low=e.low^~f.low&k.low;a=h[0];b=x[d];a.high^=b.high;a.low^=b.low}},_doFinalize:function(){var c=this._data,
10 | d=c.words,h=8*c.sigBytes,j=32*this.blockSize;d[h>>>5]|=1<<24-h%32;d[(y.ceil((h+1)/j)*j>>>5)-1]|=128;c.sigBytes=4*d.length;this._process();for(var c=this._state,d=this.cfg.outputLength/8,h=d/8,j=[],b=0;b>>24)&16711935|(f<<24|f>>>8)&4278255360,e=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360;j.push(e);j.push(f)}return new z.init(j,d)},clone:function(){for(var c=q.clone.call(this),d=c._state=this._state.slice(0),h=0;25>h;h++)d[h]=d[h].clone();return c}});
11 | p.SHA3=q._createHelper(m);p.HmacSHA3=q._createHmacHelper(m)})(Math);
12 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/sha384-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(){var c=CryptoJS,a=c.x64,b=a.Word,e=a.WordArray,a=c.algo,d=a.SHA512,a=a.SHA384=d.extend({_doReset:function(){this._hash=new e.init([new b.init(3418070365,3238371032),new b.init(1654270250,914150663),new b.init(2438529370,812702999),new b.init(355462360,4144912697),new b.init(1731405415,4290775857),new b.init(2394180231,1750603025),new b.init(3675008525,1694076839),new b.init(1203062813,3204075428)])},_doFinalize:function(){var a=d._doFinalize.call(this);a.sigBytes-=16;return a}});c.SHA384=
8 | d._createHelper(a);c.HmacSHA384=d._createHmacHelper(a)})();
9 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/sha384.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function () {
8 | // Shortcuts
9 | var C = CryptoJS;
10 | var C_x64 = C.x64;
11 | var X64Word = C_x64.Word;
12 | var X64WordArray = C_x64.WordArray;
13 | var C_algo = C.algo;
14 | var SHA512 = C_algo.SHA512;
15 |
16 | /**
17 | * SHA-384 hash algorithm.
18 | */
19 | var SHA384 = C_algo.SHA384 = SHA512.extend({
20 | _doReset: function () {
21 | this._hash = new X64WordArray.init([
22 | new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
23 | new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
24 | new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
25 | new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
26 | ]);
27 | },
28 |
29 | _doFinalize: function () {
30 | var hash = SHA512._doFinalize.call(this);
31 |
32 | hash.sigBytes -= 16;
33 |
34 | return hash;
35 | }
36 | });
37 |
38 | /**
39 | * Shortcut function to the hasher's object interface.
40 | *
41 | * @param {WordArray|string} message The message to hash.
42 | *
43 | * @return {WordArray} The hash.
44 | *
45 | * @static
46 | *
47 | * @example
48 | *
49 | * var hash = CryptoJS.SHA384('message');
50 | * var hash = CryptoJS.SHA384(wordArray);
51 | */
52 | C.SHA384 = SHA512._createHelper(SHA384);
53 |
54 | /**
55 | * Shortcut function to the HMAC's object interface.
56 | *
57 | * @param {WordArray|string} message The message to hash.
58 | * @param {WordArray|string} key The secret key.
59 | *
60 | * @return {WordArray} The HMAC.
61 | *
62 | * @static
63 | *
64 | * @example
65 | *
66 | * var hmac = CryptoJS.HmacSHA384(message, key);
67 | */
68 | C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
69 | }());
70 |
--------------------------------------------------------------------------------
/vendor/cryptojs-v3.1.2/components/x64-core-min.js:
--------------------------------------------------------------------------------
1 | /*
2 | CryptoJS v3.1.2
3 | code.google.com/p/crypto-js
4 | (c) 2009-2013 by Jeff Mott. All rights reserved.
5 | code.google.com/p/crypto-js/wiki/License
6 | */
7 | (function(g){var a=CryptoJS,f=a.lib,e=f.Base,h=f.WordArray,a=a.x64={};a.Word=e.extend({init:function(b,c){this.high=b;this.low=c}});a.WordArray=e.extend({init:function(b,c){b=this.words=b||[];this.sigBytes=c!=g?c:8*b.length},toX32:function(){for(var b=this.words,c=b.length,a=[],d=0;d