Skip to content

Commit

Permalink
some more csprngs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim committed Aug 27, 2023
1 parent 976c29d commit daba018
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion constantine/csprngs/sysrand.nim
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ when defined(windows):
# - https://github.com/rust-random/getrandom/issues/314
# - https://learn.microsoft.com/en-us/archive/blogs/michael_howard/cryptographically-secure-random-number-on-windows-without-using-cryptoapi

proc RtlGenRandom(pbuffer: pointer, len: culong): bool {.importc, stdcall, dynlib: "advapi32.dll", sideeffect, tags: [CSPRNG].}
proc RtlGenRandom(pbuffer: pointer, len: culong): bool {.importc: "SystemFunction036", stdcall, dynlib: "advapi32.dll", sideeffect, tags: [CSPRNG].}
#https://learn.microsoft.com/en-us/archive/blogs/michael_howard/cryptographically-secure-random-number-on-windows-without-using-cryptoapi
# https://learn.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom
#
# BOOLEAN RtlGenRandom(
Expand Down Expand Up @@ -126,6 +127,8 @@ elif defined(ios) or defined(macosx):
let kCCSuccess {.importc, header: "<CommonCrypto/CommonCryptoError.h>".}: CCRNGStatus
# https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60061.30.1/include/CommonCryptoError.h.auto.html

func `==`(x, y: CCRNGStatus) {.borrow.}

Check failure on line 130 in constantine/csprngs/sysrand.nim

View workflow job for this annotation

GitHub Actions / macos-amd64-c-NO_ASM (version-1-6)

no symbol to borrow from found

Check failure on line 130 in constantine/csprngs/sysrand.nim

View workflow job for this annotation

GitHub Actions / macos-amd64-c-ASM (version-1-6)

no symbol to borrow from found

Check failure on line 130 in constantine/csprngs/sysrand.nim

View workflow job for this annotation

GitHub Actions / macos-amd64-c-NO_ASM (version-1-6)

no symbol to borrow from found

Check failure on line 130 in constantine/csprngs/sysrand.nim

View workflow job for this annotation

GitHub Actions / macos-amd64-c-ASM (version-1-6)

no symbol to borrow from found

proc CCRandomGenerateBytes(pbuffer: pointer, len: int): CCRNGStatus {.sideeffect, tags: [CSPRNG], importc, header: "<CommonCrypto/CommonRandom.h>".}
# https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60178.40.2/include/CommonRandom.h.auto.html

Expand Down

0 comments on commit daba018

Please sign in to comment.