Skip to content

Commit

Permalink
Update niahash.swift
Browse files Browse the repository at this point in the history
Does not solve #62 , but related
  • Loading branch information
PokemonGoSucks authored Dec 8, 2016
1 parent 75a4744 commit 0ddbe98
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions PGoApi/Classes/pcrypt/niahash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,16 @@ open class niahash {

if numChunks > 0 {
var offset = 0
while numChunks > 0 {
while numChunks > 1 {
offset += 128
let offsetChunk = Array(input[offset..<128 + offset])
hash = hashMuladd(hash: hash, mul: ROUND_MAGIC, add: hashChunk(chunk: offsetChunk, size: 128))
numChunks = numChunks - 2
if offset < input.count {
let offsetChunk = Array(input[offset..<128 + offset])
hash = hashMuladd(hash: hash, mul: ROUND_MAGIC, add: hashChunk(chunk: offsetChunk, size: 128))
}
numChunks -= 2
if numChunks == 1 {
numChunks = 4
}
}

if tailSize > 0 {
Expand Down

0 comments on commit 0ddbe98

Please sign in to comment.