Skip to content

Commit

Permalink
build step
Browse files Browse the repository at this point in the history
  • Loading branch information
arlolra committed Aug 19, 2012
1 parent a334128 commit 786c211
Show file tree
Hide file tree
Showing 22 changed files with 2,143 additions and 59 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ TEST=*
test:
./node_modules/.bin/mocha -R spec test/spec/unit/$(TEST).js

.PHONY: test
build:
./node_modules/.bin/grunt

.PHONY: test build
4 changes: 0 additions & 4 deletions dh.json

This file was deleted.

43 changes: 43 additions & 0 deletions grunt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = function (grunt) {

grunt.initConfig({

pkg: '<json:package.json>'
, meta: {
banner:
'/*!\n\n <%= pkg.name %>.js v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
' (c) <%= grunt.template.today("yyyy") %> - <%= pkg.author %>\n' +
' Freely distributed under the <%= pkg.license %> license.\n\n' +
' This file is concatenated for the browser.\n' +
' Please see: <%= pkg.homepage %>' +
'\n\n*/'
}
, concat: {
dist: {
src: [
'<banner:meta.banner>'
, 'lib/dh.js'
, 'lib/states.js'
, 'lib/helpers.js'
, 'lib/dsa.js'
, 'lib/sm.js'
, 'lib/ake.js'
, 'lib/parse.js'
, 'lib/otr.js'
]
, dest: 'otr.js'
}
}
, min: {
dist: {
src: ['<banner:meta.banner>', 'otr.js']
, dest: 'otr.min.js'
}
}

})

grunt.registerTask('default', 'concat min')

}
6 changes: 3 additions & 3 deletions ake.js → lib/ake.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
, STATES = root.STATES

if (typeof require !== 'undefined') {
CryptoJS || (CryptoJS = require('./vendor/cryptojs/cryptojs.js'))
BigInt || (BigInt = require('./vendor/bigint.js'))
DH || (DH = require('./dh.json'))
CryptoJS || (CryptoJS = require('../vendor/cryptojs/cryptojs.js'))
BigInt || (BigInt = require('../vendor/bigint.js'))
DH || (DH = require('./dh.js'))
SM || (SM = require('./sm.js'))
HLP || (HLP = require('./helpers.js'))
DSA || (DSA = require('./dsa.js'))
Expand Down
16 changes: 16 additions & 0 deletions lib/dh.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
;(function () {

var root = this

var DH = {
"N": "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF"
, "G": "2"
}

if (typeof exports !== 'undefined') {
module.exports = DH
} else {
root.DH = DH
}

}).call(this)
4 changes: 2 additions & 2 deletions dsa.js → lib/dsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
, HLP = root.HLP

if (typeof require !== 'undefined') {
BigInt || (BigInt = require('./vendor/bigint.js'))
CryptoJS || (CryptoJS = require('./vendor/cryptojs/cryptojs.js'))
BigInt || (BigInt = require('../vendor/bigint.js'))
CryptoJS || (CryptoJS = require('../vendor/cryptojs/cryptojs.js'))
HLP || (HLP = require('./helpers.js'))
}

Expand Down
4 changes: 2 additions & 2 deletions helpers.js → lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
, CryptoJS = root.CryptoJS

if (typeof require !== 'undefined') {
BigInt || (BigInt = require('./vendor/bigint.js'))
CryptoJS || (CryptoJS = require('./vendor/cryptojs/cryptojs.js'))
BigInt || (BigInt = require('../vendor/bigint.js'))
CryptoJS || (CryptoJS = require('../vendor/cryptojs/cryptojs.js'))
}

// data types (byte lengths)
Expand Down
Loading

0 comments on commit 786c211

Please sign in to comment.