Skip to content

Commit

Permalink
Merge pull request #16 from guzba/ryan
Browse files Browse the repository at this point in the history
0.1.8
  • Loading branch information
guzba committed Jan 28, 2023
2 parents f8c6fd1 + 647c518 commit 6dda0e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crunchy.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.1.7"
version = "0.1.8"
author = "Ryan Oldenburg"
description = "SIMD-optimized hashing, checksums and CRCs"
license = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions src/crunchy/rsa.nim
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ proc sign*(pk: RsaPrivateKey, message: string): string =
hex = prefix & hex
of 2048:
if hex.len < 512:
var prefix = newString(256 - hex.len)
var prefix = newString(512 - hex.len)
for i in 0 ..< prefix.len:
prefix[i] = '0'
hex = prefix & hex
of 4096:
if hex.len < 1024:
var prefix = newString(256 - hex.len)
var prefix = newString(1024 - hex.len)
for i in 0 ..< prefix.len:
prefix[i] = '0'
hex = prefix & hex
Expand Down
2 changes: 1 addition & 1 deletion src/crunchy/sha256.nim
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ proc hmacSha256*(key, data: openarray[uint8]): array[32, uint8] =
if key.len > blockSize:
let hash = sha256(key)
copyMem(blockSizeKey[0].addr, hash[0].unsafeAddr, hash.len)
else:
elif key.len > 0:
copyMem(blockSizeKey[0].addr, key[0].unsafeAddr, key.len)

proc applyXor(s: array[64, uint8], value: uint8): array[64, uint8] =
Expand Down

0 comments on commit 6dda0e3

Please sign in to comment.