Added groestl to algos

This commit is contained in:
Matt 2014-04-21 14:31:35 -06:00
parent 58668a9543
commit 7aa918ef95
2 changed files with 20 additions and 14 deletions

View File

@ -103,6 +103,14 @@ var algos = module.exports = global.algos = {
} }
} }
}, },
groestl: {
multiplier: Math.pow(2, 8),
hash: function(){
return function(){
return multiHashing.groestl.apply(this, arguments);
}
}
},
fugue: { fugue: {
multiplier: Math.pow(2, 8), multiplier: Math.pow(2, 8),
hash: function(){ hash: function(){

View File

@ -74,6 +74,7 @@ var JobManager = module.exports = function JobManager(options){
case 'blake': case 'blake':
case 'skein': case 'skein':
case 'fugue': case 'fugue':
case 'groestl':
if (options.coin.normalHashing === true) if (options.coin.normalHashing === true)
return util.sha256d; return util.sha256d;
else else
@ -83,27 +84,24 @@ var JobManager = module.exports = function JobManager(options){
} }
})(); })();
var blockHasher = (function(){
switch(options.coin.algorithm){ var blockHasher = (function () {
case 'x11': switch (options.coin.algorithm) {
case 'quark':
case 'keccak':
case 'skein':
case 'fugue':
case 'blake':
return function(){
return util.reverseBuffer(hashDigest.apply(this, arguments));
};
case 'scrypt': case 'scrypt':
if (options.coin.reward === 'POS') { if (options.coin.reward === 'POS') {
return function () { return function (d) {
return util.reverseBuffer(hashDigest.apply(this, arguments)); return util.reverseBuffer(hashDigest.apply(this, arguments));
}; };
} }
default: case 'scrypt-jane':
return function(d){ case 'scrypt-n':
return function (d) {
return util.reverseBuffer(util.sha256d(d)); return util.reverseBuffer(util.sha256d(d));
}; };
default:
return function () {
return util.reverseBuffer(hashDigest.apply(this, arguments));
};
} }
})(); })();