mbedtls wrapper done
This commit is contained in:
parent
d4aab29d74
commit
e69b25bbf1
|
@ -1,32 +1,14 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
|
||||
# Included but not used
|
||||
# import "private_access"
|
||||
# import "build_info"
|
||||
# import "mbedtls_config"
|
||||
# import "config_psa"
|
||||
# import "check_config"
|
||||
# import "platform_time"
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/aes.c".}
|
||||
{.compile: "./mbedtls/library/aesni.c".}
|
||||
# Generated @ 2023-05-11T11:19:07+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/aes.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_AES_ENCRYPT* = 1
|
||||
MBEDTLS_AES_DECRYPT* = 0
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/aria.c".}
|
||||
# Generated @ 2023-05-11T11:19:07+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/aria.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ARIA_ENCRYPT* = 1
|
||||
MBEDTLS_ARIA_DECRYPT* = 0
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "bignum"
|
||||
|
||||
{.compile: "./mbedtls/library/asn1parse.c".}
|
||||
# Generated @ 2023-05-11T11:19:07+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/asn1.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_ASN1_OUT_OF_DATA* = -0x00000060
|
||||
MBEDTLS_ERR_ASN1_UNEXPECTED_TAG* = -0x00000062
|
||||
|
|
|
@ -1,26 +1,14 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "asn1"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
|
||||
{.compile: "./mbedtls/library/asn1write.c".}
|
||||
# Generated @ 2023-05-11T11:19:07+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/asn1write.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
proc mbedtls_asn1_write_len*(p: ptr ptr byte; start: ptr byte; len: uint): cint {.
|
||||
importc, cdecl.}
|
||||
proc mbedtls_asn1_write_tag*(p: ptr ptr byte; start: ptr byte; tag: byte): cint {.
|
||||
|
|
|
@ -1,28 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# import "build_info"
|
||||
# import "mbedtls_config"
|
||||
# import "config_psa"
|
||||
# import "check_config"
|
||||
import "constant_time"
|
||||
|
||||
{.compile: "./mbedtls/library/base64.c".}
|
||||
# Generated @ 2023-05-11T11:19:07+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/base64.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL* = -0x0000002A
|
||||
MBEDTLS_ERR_BASE64_INVALID_CHARACTER* = -0x0000002C
|
||||
|
|
|
@ -1,69 +1,18 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "md"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/bignum.c".}
|
||||
{.compile: "./mbedtls/library/bignum_core.c".}
|
||||
{.compile: "./mbedtls/library/constant_time.c".}
|
||||
# Generated @ 2023-05-11T11:19:07+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/bignum.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_mpi_gen_prime_flag_t)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_MPI_FILE_IO_ERROR* = -0x00000002
|
||||
MBEDTLS_ERR_MPI_BAD_INPUT_DATA* = -0x00000004
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-11T11:19:08+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/build_info.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_VERSION_MAJOR* = 3
|
||||
MBEDTLS_VERSION_MINOR* = 4
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/camellia.c".}
|
||||
# Generated @ 2023-05-11T11:19:08+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/camellia.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_CAMELLIA_ENCRYPT* = 1
|
||||
MBEDTLS_CAMELLIA_DECRYPT* = 0
|
||||
|
|
|
@ -1,30 +1,11 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# import "private_access"
|
||||
# import "build_info"
|
||||
# import "mbedtls_config"
|
||||
# import "config_psa"
|
||||
# import "check_config"
|
||||
import "cipher"
|
||||
# import "platform_util"
|
||||
import "platform_time"
|
||||
# Generated @ 2023-05-11T11:19:08+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ccm.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_CCM_DECRYPT* = 0
|
||||
MBEDTLS_CCM_ENCRYPT* = 1
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/chacha20.c".}
|
||||
# Generated @ 2023-05-11T11:19:08+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/chacha20.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA* = -0x00000051
|
||||
type
|
||||
|
|
|
@ -1,68 +1,17 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "poly1305"
|
||||
import "chacha20"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/chachapoly.c".}
|
||||
# Generated @ 2023-05-11T11:19:08+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/chachapoly.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_chachapoly_mode_t)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_CHACHAPOLY_BAD_STATE* = -0x00000054
|
||||
MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED* = -0x00000056
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-11T11:19:08+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/check_config.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
type
|
||||
mbedtls_iso_c_forbids_empty_translation_units* = cint
|
||||
{.pop.}
|
|
@ -1,27 +1,16 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "aes"
|
||||
import "aria"
|
||||
import "camellia"
|
||||
import "chachapoly"
|
||||
import "des"
|
||||
import "constant_time"
|
||||
import "platform_time"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/ccm.c".}
|
||||
{.compile: "./mbedtls/library/gcm.c".}
|
||||
{.compile: "./mbedtls/library/nist_kw.c".}
|
||||
{.compile: "./mbedtls/library/cipher_wrap.c".}
|
||||
{.compile: "./mbedtls/library/cipher.c".}
|
||||
# Generated @ 2023-05-11T11:19:08+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/cipher.h
|
||||
|
||||
# proc 'mbedtls_cipher_info_get_type' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_cipher_info_get_mode' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
|
@ -38,60 +27,21 @@ import "platform_time"
|
|||
# proc 'mbedtls_cipher_get_name' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_cipher_get_key_bitlen' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_cipher_get_operation' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_cipher_id_t)
|
||||
defineEnum(mbedtls_cipher_type_t)
|
||||
defineEnum(mbedtls_cipher_mode_t)
|
||||
defineEnum(mbedtls_cipher_padding_t)
|
||||
defineEnum(mbedtls_operation_t)
|
||||
defineEnum(Enum_cipherh1)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE* = -0x00006080
|
||||
MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA* = -0x00006100
|
||||
|
|
|
@ -1,25 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "cipher"
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/cmac.c".}
|
||||
# Generated @ 2023-05-11T11:19:09+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/cmac.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_AES_BLOCK_SIZE* = 16
|
||||
MBEDTLS_DES3_BLOCK_SIZE* = 8
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-11T11:19:09+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/compat-2.x.h
|
||||
|
||||
# const 'mbedtls_ctr_drbg_update_ret' has unsupported value 'mbedtls_ctr_drbg_update'
|
||||
# const 'mbedtls_hmac_drbg_update_ret' has unsupported value 'mbedtls_hmac_drbg_update'
|
||||
# const 'mbedtls_md5_starts_ret' has unsupported value 'mbedtls_md5_starts'
|
||||
# const 'mbedtls_md5_update_ret' has unsupported value 'mbedtls_md5_update'
|
||||
# const 'mbedtls_md5_finish_ret' has unsupported value 'mbedtls_md5_finish'
|
||||
# const 'mbedtls_md5_ret' has unsupported value 'mbedtls_md5'
|
||||
# const 'mbedtls_ripemd160_starts_ret' has unsupported value 'mbedtls_ripemd160_starts'
|
||||
# const 'mbedtls_ripemd160_update_ret' has unsupported value 'mbedtls_ripemd160_update'
|
||||
# const 'mbedtls_ripemd160_finish_ret' has unsupported value 'mbedtls_ripemd160_finish'
|
||||
# const 'mbedtls_ripemd160_ret' has unsupported value 'mbedtls_ripemd160'
|
||||
# const 'mbedtls_sha1_starts_ret' has unsupported value 'mbedtls_sha1_starts'
|
||||
# const 'mbedtls_sha1_update_ret' has unsupported value 'mbedtls_sha1_update'
|
||||
# const 'mbedtls_sha1_finish_ret' has unsupported value 'mbedtls_sha1_finish'
|
||||
# const 'mbedtls_sha1_ret' has unsupported value 'mbedtls_sha1'
|
||||
# const 'mbedtls_sha256_starts_ret' has unsupported value 'mbedtls_sha256_starts'
|
||||
# const 'mbedtls_sha256_update_ret' has unsupported value 'mbedtls_sha256_update'
|
||||
# const 'mbedtls_sha256_finish_ret' has unsupported value 'mbedtls_sha256_finish'
|
||||
# const 'mbedtls_sha256_ret' has unsupported value 'mbedtls_sha256'
|
||||
# const 'mbedtls_sha512_starts_ret' has unsupported value 'mbedtls_sha512_starts'
|
||||
# const 'mbedtls_sha512_update_ret' has unsupported value 'mbedtls_sha512_update'
|
||||
# const 'mbedtls_sha512_finish_ret' has unsupported value 'mbedtls_sha512_finish'
|
||||
# const 'mbedtls_sha512_ret' has unsupported value 'mbedtls_sha512'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
{.pop.}
|
|
@ -1,22 +1,9 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-11T11:19:09+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/config_psa.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_PSA_BUILTIN_ALG_HMAC* = 1
|
||||
PSA_WANT_ALG_HMAC* = 1
|
||||
|
|
|
@ -1,21 +1,8 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "bignum"
|
||||
# {.compile: "./mbedtls/library/constant_time.c".}
|
||||
# Generated @ 2023-05-11T11:19:09+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/constant_time.h
|
||||
# TODO: Remove bignum, it's not used in this file.
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
|
|
@ -1,33 +1,15 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "aes"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "entropy"
|
||||
import "md"
|
||||
# TODO: Remove entropy, it's not used in this file.
|
||||
|
||||
{.compile: "./mbedtls/library/ctr_drbg.c".}
|
||||
# Generated @ 2023-05-11T11:19:09+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ctr_drbg.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED* = -0x00000034
|
||||
MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG* = -0x00000036
|
||||
|
|
|
@ -1,101 +1,20 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "ssl"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "private_access"
|
||||
import "bignum"
|
||||
import "ecp"
|
||||
import "ssl_ciphersuites"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecdsa"
|
||||
import "cipher"
|
||||
import "x509_crt"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "x509_crl"
|
||||
import "dhm"
|
||||
import "ecdh"
|
||||
import "md5"
|
||||
import "ripemd160"
|
||||
import "sha1"
|
||||
import "sha256"
|
||||
import "sha512"
|
||||
import "cmac"
|
||||
import "gcm"
|
||||
import "ccm"
|
||||
import "chachapoly"
|
||||
import "poly1305"
|
||||
import "chacha20"
|
||||
import "ecjpake"
|
||||
{.compile: "./mbedtls/library/debug.c".}
|
||||
# Generated @ 2023-05-11T11:19:09+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/debug.h
|
||||
import "utils"
|
||||
|
||||
# const 'MBEDTLS_PRINTF_MS_TIME' has unsupported value 'PRId64'
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_debug_ecdh_attr)
|
||||
|
||||
const
|
||||
MBEDTLS_PRINTF_SIZET* = "zu"
|
||||
MBEDTLS_PRINTF_LONGLONG* = "lld"
|
||||
|
|
|
@ -1,30 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/des.c".}
|
||||
# Generated @ 2023-05-11T11:19:09+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/des.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_DES_ENCRYPT* = 1
|
||||
MBEDTLS_DES_DECRYPT* = 0
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,74 +1,18 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "ecp"
|
||||
import "bignum"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/ecdh.c".}
|
||||
# Generated @ 2023-05-11T11:19:09+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ecdh.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_ecdh_side)
|
||||
defineEnum(mbedtls_ecdh_variant)
|
||||
|
||||
const
|
||||
MBEDTLS_ECDH_OURS* = (0).mbedtls_ecdh_side
|
||||
MBEDTLS_ECDH_THEIRS* = (MBEDTLS_ECDH_OURS + 1).mbedtls_ecdh_side
|
||||
|
|
|
@ -1,31 +1,17 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "ecp"
|
||||
import "bignum"
|
||||
import "md"
|
||||
import "platform_time"
|
||||
import "hmac_drbg"
|
||||
import "asn1"
|
||||
import "asn1write"
|
||||
|
||||
{.compile: "./mbedtls/library/ecdsa.c".}
|
||||
# Generated @ 2023-05-11T11:19:10+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ecdsa.h
|
||||
|
||||
# const 'MBEDTLS_ECDSA_MAX_LEN' has unsupported value 'MBEDTLS_ECDSA_MAX_SIG_LEN(MBEDTLS_ECP_MAX_BITS)'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type
|
||||
mbedtls_ecdsa_context* = mbedtls_ecp_keypair
|
||||
mbedtls_ecdsa_restart_ctx* = object
|
||||
|
|
|
@ -1,71 +1,20 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "ecp"
|
||||
import "bignum"
|
||||
import "md"
|
||||
import "hash_info"
|
||||
import "platform_time"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/ecjpake.c".}
|
||||
# Generated @ 2023-05-11T11:19:10+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ecjpake.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_ecjpake_role)
|
||||
|
||||
const
|
||||
MBEDTLS_ECJPAKE_CLIENT* = (0).mbedtls_ecjpake_role
|
||||
MBEDTLS_ECJPAKE_SERVER* = (MBEDTLS_ECJPAKE_CLIENT + 1).mbedtls_ecjpake_role
|
||||
|
|
|
@ -1,75 +1,19 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "bignum"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/ecp.c".}
|
||||
{.compile: "./mbedtls/library/ecp_curves.c".}
|
||||
# Generated @ 2023-05-11T11:19:10+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ecp.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_ecp_group_id)
|
||||
defineEnum(mbedtls_ecp_curve_type)
|
||||
defineEnum(mbedtls_ecp_modulus_type)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_ECP_BAD_INPUT_DATA* = -0x00004F80
|
||||
MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL* = -0x00004F00
|
||||
|
|
|
@ -1,34 +1,17 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "md"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/entropy.c".}
|
||||
{.compile: "./mbedtls/library/entropy_poll.c".}
|
||||
# Generated @ 2023-05-11T11:19:10+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/entropy.h
|
||||
|
||||
# const 'MBEDTLS_ENTROPY_MD' has unsupported value 'MBEDTLS_MD_SHA512'
|
||||
# const 'MBEDTLS_ENTROPY_SOURCE_MANUAL' has unsupported value 'MBEDTLS_ENTROPY_MAX_SOURCES'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ENTROPY_BLOCK_SIZE* = 64
|
||||
MBEDTLS_ERR_ENTROPY_SOURCE_FAILED* = -0x0000003C
|
||||
|
|
|
@ -1,28 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
{.compile: "./mbedtls/library/error.c".}
|
||||
# Generated @ 2023-05-11T11:19:10+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/error.h
|
||||
|
||||
# proc 'mbedtls_error_add' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_ERROR_GENERIC_ERROR* = -0x00000001
|
||||
MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED* = -0x0000006E
|
||||
|
|
|
@ -1,31 +1,11 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "cipher"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
#{.compile: "./mbedtls/library/gcm.c".}
|
||||
# Generated @ 2023-05-11T11:19:10+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/gcm.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_GCM_ENCRYPT* = 1
|
||||
MBEDTLS_GCM_DECRYPT* = 0
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# TODO: Put the .compile. pragma in one of the file using it without breaking everything
|
||||
{.compile: "./mbedtls/library/hash_info.c".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
|
|
@ -1,31 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "md"
|
||||
import "private_access"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/hkdf.c".}
|
||||
# Generated @ 2023-05-11T11:19:10+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/hkdf.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_HKDF_BAD_INPUT_DATA* = -0x00005F80
|
||||
proc mbedtls_hkdf*(md: ptr mbedtls_md_info_t; salt: ptr byte; salt_len: uint;
|
||||
|
|
|
@ -1,31 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "md"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/hmac_drbg.c".}
|
||||
# Generated @ 2023-05-11T11:19:11+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/hmac_drbg.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG* = -0x00000003
|
||||
MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG* = -0x00000005
|
||||
|
|
|
@ -1,69 +1,18 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "psa/crypto"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/lms.c".}
|
||||
{.compile: "./mbedtls/library/lmots.c".}
|
||||
# Generated @ 2023-05-11T11:19:11+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/lms.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_lms_algorithm_type_t)
|
||||
defineEnum(mbedtls_lmots_algorithm_type_t)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_LMS_BAD_INPUT_DATA* = -0x00000011
|
||||
MBEDTLS_ERR_LMS_OUT_OF_PRIVATE_KEYS* = -0x00000013
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-11T11:19:11+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/mbedtls_config.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT* = 0
|
||||
MBEDTLS_SSL_MAX_EARLY_DATA_SIZE* = 1024
|
||||
|
|
|
@ -1,78 +1,21 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
import "ripemd160"
|
||||
import "sha1"
|
||||
import "sha256"
|
||||
import "sha512"
|
||||
import "md5"
|
||||
# {.compile: "./mbedtls/library/ripemd160.c".}
|
||||
# {.compile: "./mbedtls/library/sha1.c".}
|
||||
# {.compile: "./mbedtls/library/sha256.c".}
|
||||
# {.compile: "./mbedtls/library/sha512.c".}
|
||||
# {.compile: "./mbedtls/library/md5.c".}
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/md.c".}
|
||||
# Generated @ 2023-05-11T11:19:11+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/md.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_md_type_t)
|
||||
defineEnum(mbedtls_md_engine_t)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE* = -0x00005080
|
||||
MBEDTLS_ERR_MD_BAD_INPUT_DATA* = -0x00005100
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/md5.c".}
|
||||
# Generated @ 2023-05-11T11:19:11+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/md5.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type
|
||||
mbedtls_md5_context* {.bycopy.} = object
|
||||
private_total*: array[2, uint32]
|
||||
|
|
|
@ -1,27 +1,11 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
{.compile: "./mbedtls/library/memory_buffer_alloc.c".}
|
||||
# Generated @ 2023-05-11T11:19:11+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/memory_buffer_alloc.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_MEMORY_ALIGN_MULTIPLE* = 4
|
||||
MBEDTLS_MEMORY_VERIFY_NONE* = 0
|
||||
|
|
|
@ -1,57 +1,11 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "ssl"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
import "ecp"
|
||||
import "ssl_ciphersuites"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecdsa"
|
||||
import "cipher"
|
||||
import "x509_crt"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "x509_crl"
|
||||
import "dhm"
|
||||
import "ecdh"
|
||||
import "md5"
|
||||
import "ripemd160"
|
||||
import "sha1"
|
||||
import "sha256"
|
||||
import "sha512"
|
||||
import "cmac"
|
||||
import "gcm"
|
||||
import "ccm"
|
||||
import "chachapoly"
|
||||
import "poly1305"
|
||||
import "chacha20"
|
||||
import "ecjpake"
|
||||
{.compile: "./mbedtls/library/net_sockets.c".}
|
||||
# Generated @ 2023-05-11T11:19:11+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/net_sockets.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_NET_SOCKET_FAILED* = -0x00000042
|
||||
MBEDTLS_ERR_NET_CONNECT_FAILED* = -0x00000044
|
||||
|
|
|
@ -1,73 +1,14 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "cipher"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
# Generated @ 2023-05-11T11:19:11+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/nist_kw.h
|
||||
import "utils"
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_nist_kw_mode_t)
|
||||
|
||||
const
|
||||
MBEDTLS_KW_MODE_KW* = (0).mbedtls_nist_kw_mode_t
|
||||
MBEDTLS_KW_MODE_KWP* = (1).mbedtls_nist_kw_mode_t
|
||||
|
|
|
@ -1,20 +1,8 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "asn1"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "ecp"
|
||||
import "cipher"
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/oid.h
|
||||
|
||||
# const 'MBEDTLS_OID_RSA_COMPANY' has unsupported value 'MBEDTLS_OID_ISO_MEMBER_BODIES MBEDTLS_OID_COUNTRY_US MBEDTLS_OID_ORG_RSA_DATA_SECURITY'
|
||||
# const 'MBEDTLS_OID_ANSI_X9_62' has unsupported value 'MBEDTLS_OID_ISO_MEMBER_BODIES MBEDTLS_OID_COUNTRY_US MBEDTLS_OID_ORG_ANSI_X9_62'
|
||||
|
@ -167,12 +155,13 @@ import "cipher"
|
|||
# const 'MBEDTLS_OID_ECDSA_SHA256' has unsupported value 'MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x02"'
|
||||
# const 'MBEDTLS_OID_ECDSA_SHA384' has unsupported value 'MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x03"'
|
||||
# const 'MBEDTLS_OID_ECDSA_SHA512' has unsupported value 'MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x04"'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_OID_NOT_FOUND* = -0x0000002E
|
||||
MBEDTLS_ERR_OID_BUF_TOO_SMALL* = -0x0000000B
|
||||
|
|
|
@ -1,28 +1,17 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "aes"
|
||||
import "base64"
|
||||
import "des"
|
||||
import "constant_time"
|
||||
|
||||
{.compile: "./mbedtls/library/pem.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/pem.h
|
||||
|
||||
# proc 'mbedtls_pem_get_buffer' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT* = -0x00001080
|
||||
MBEDTLS_ERR_PEM_INVALID_DATA* = -0x00001100
|
||||
|
|
|
@ -1,83 +1,29 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "pem"
|
||||
import "md"
|
||||
import "platform_time"
|
||||
import "rsa"
|
||||
import "ecp"
|
||||
import "ecdh"
|
||||
import "ecdsa"
|
||||
import "psa_util"
|
||||
import "psa/crypto"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/pk_wrap.c".}
|
||||
{.compile: "./mbedtls/library/pk.c".}
|
||||
{.compile: "./mbedtls/library/pkparse.c".}
|
||||
{.compile: "./mbedtls/library/pkwrite.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/pk.h
|
||||
|
||||
# const 'MBEDTLS_PK_SIGNATURE_MAX_SIZE' has unsupported value 'MBEDTLS_MPI_MAX_SIZE'
|
||||
# proc 'mbedtls_pk_get_len' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_pk_rsa' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_pk_ec' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_pk_type_t)
|
||||
defineEnum(mbedtls_pk_debug_type)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_PK_ALLOC_FAILED* = -0x00003F80
|
||||
MBEDTLS_ERR_PK_TYPE_MISMATCH* = -0x00003F00
|
||||
|
|
|
@ -1,29 +1,18 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "md"
|
||||
import "platform_time"
|
||||
import "cipher"
|
||||
import "asn1"
|
||||
import "ctr_drbg"
|
||||
import "hash_info"
|
||||
|
||||
{.compile: "./mbedtls/library/pkcs12.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/pkcs12.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA* = -0x00001F80
|
||||
MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE* = -0x00001F00
|
||||
|
|
|
@ -1,30 +1,17 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "asn1"
|
||||
import "platform_time"
|
||||
import "md"
|
||||
import "cipher"
|
||||
import "ctr_drbg"
|
||||
import "rsa"
|
||||
import "hash_info"
|
||||
|
||||
{.compile: "./mbedtls/library/pkcs5.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/pkcs5.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA* = -0x00002F80
|
||||
MBEDTLS_ERR_PKCS5_INVALID_FORMAT* = -0x00002F00
|
||||
|
|
|
@ -1,76 +1,19 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "asn1"
|
||||
import "platform_time"
|
||||
import "x509"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecp"
|
||||
import "ecdsa"
|
||||
import "x509_crt"
|
||||
import "x509_crl"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/pkcs7.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/pkcs7.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_pkcs7_type)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_PKCS7_INVALID_FORMAT* = -0x00005300
|
||||
MBEDTLS_ERR_PKCS7_FEATURE_UNAVAILABLE* = -0x00005380
|
||||
|
|
|
@ -1,22 +1,6 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/platform.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/platform.h
|
||||
|
||||
# const 'MBEDTLS_PLATFORM_STD_SNPRINTF' has unsupported value 'snprintf'
|
||||
# const 'MBEDTLS_PLATFORM_STD_VSNPRINTF' has unsupported value 'vsnprintf'
|
||||
|
@ -41,12 +25,13 @@ import "platform_time"
|
|||
# const 'mbedtls_exit' has unsupported value 'exit'
|
||||
# const 'MBEDTLS_EXIT_SUCCESS' has unsupported value 'MBEDTLS_PLATFORM_STD_EXIT_SUCCESS'
|
||||
# const 'MBEDTLS_EXIT_FAILURE' has unsupported value 'MBEDTLS_PLATFORM_STD_EXIT_FAILURE'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_PLATFORM_STD_NV_SEED_FILE* = "seedfile"
|
||||
type
|
||||
|
|
|
@ -1,21 +1,5 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# import "build_info"
|
||||
# import "mbedtls_config"
|
||||
# import "config_psa"
|
||||
# import "check_config"
|
||||
{.used.}
|
||||
{.compile: "./mbedtls/library/platform_util.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/platform_time.h
|
||||
|
||||
# const 'mbedtls_time' has unsupported value 'time'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
@ -23,10 +7,10 @@
|
|||
import std/time_t as std_time_t
|
||||
type time_t* = std_time_t.Time
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type
|
||||
mbedtls_time_t* = time_t
|
||||
mbedtls_ms_time_t* = int64
|
||||
|
|
|
@ -1,31 +1,16 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
type tm {.importc: "struct tm", header: "<time.h>".} = object
|
||||
# import "build_info"
|
||||
# import "mbedtls_config"
|
||||
# import "config_psa"
|
||||
# import "check_config"
|
||||
import "platform_time"
|
||||
# {.compile: "./mbedtls/library/platform_util.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/platform_util.h
|
||||
|
||||
# const 'MBEDTLS_CHECK_RETURN' has unsupported value '__attribute__((__warn_unused_result__))'
|
||||
# const 'MBEDTLS_CHECK_RETURN_CRITICAL' has unsupported value 'MBEDTLS_CHECK_RETURN'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type tm {.importc: "struct tm", header: "<time.h>".} = object
|
||||
|
||||
proc mbedtls_platform_zeroize*(buf: pointer; len: uint) {.importc, cdecl.}
|
||||
proc mbedtls_platform_gmtime_r*(tt: ptr mbedtls_time_t; tm_buf: ptr tm): ptr tm {.
|
||||
importc, cdecl.}
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "md"
|
||||
|
||||
{.compile: "./mbedtls/library/poly1305.c".}
|
||||
# Generated @ 2023-05-11T11:19:12+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/poly1305.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA* = -0x00000057
|
||||
type
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-11T11:19:13+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/private_access.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
{.pop.}
|
|
@ -1,30 +1,11 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_types"
|
||||
import "crypto_values"
|
||||
import "crypto_sizes"
|
||||
import "crypto_struct"
|
||||
import "crypto_driver_contexts_primitives"
|
||||
import "crypto_driver_common"
|
||||
import "crypto_sizes"
|
||||
import "crypto_builtin_primitives"
|
||||
import "crypto_driver_contexts_composites"
|
||||
import "crypto_builtin_composites"
|
||||
import "crypto_driver_contexts_key_derivation"
|
||||
import "../pk"
|
||||
import "../ecp"
|
||||
import "../rsa"
|
||||
import "../ecdh"
|
||||
import "../cmac"
|
||||
import "../cipher"
|
||||
import "../ctr_drbg"
|
||||
import "../utils"
|
||||
|
||||
{.compile: "./mbedtls/library/psa_crypto.c".}
|
||||
{.compile: "./mbedtls/library/psa_crypto_hash.c".}
|
||||
{.compile: "./mbedtls/library/psa_crypto_slot_management.c".}
|
||||
|
@ -37,65 +18,22 @@ import "../ctr_drbg"
|
|||
{.compile: "./mbedtls/library/psa_crypto_ecp.c".}
|
||||
{.compile: "./mbedtls/library/psa_crypto_aead.c".}
|
||||
{.compile: "./mbedtls/library/psa_crypto_cipher.c".}
|
||||
# Generated @ 2023-05-12T13:12:42+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.pragma: impcryptoHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto.h".}
|
||||
{.pragma: impcrypto_compatHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_compat.h".}
|
||||
{.pragma: impcrypto_extraHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_extra.h".}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(psa_jpake_step)
|
||||
defineEnum(psa_jpake_state)
|
||||
defineEnum(psa_jpake_sequence)
|
||||
defineEnum(psa_crypto_driver_pake_step)
|
||||
|
||||
const
|
||||
PSA_CRYPTO_API_VERSION_MAJOR* = 1
|
||||
PSA_CRYPTO_API_VERSION_MINOR* = 0
|
||||
|
|
|
@ -1,27 +1,17 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_builtin_composites.h
|
||||
|
||||
# const 'MBEDTLS_PSA_HMAC_OPERATION_INIT' has unsupported value '{ 0, PSA_HASH_OPERATION_INIT, { 0 } }'
|
||||
# const 'MBEDTLS_PSA_MAC_OPERATION_INIT' has unsupported value '{ 0, { 0 } }'
|
||||
# const 'MBEDTLS_PSA_AEAD_OPERATION_INIT' has unsupported value '{ 0, 0, 0, 0, { 0 } }'
|
||||
# const 'MBEDTLS_PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT' has unsupported value '{ 0 }'
|
||||
# const 'MBEDTLS_VERIFY_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT' has unsupported value '{ 0 }'
|
||||
# const 'MBEDTLS_PSA_PAKE_OPERATION_INIT' has unsupported value '{ { 0 } }'
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.pragma: impcrypto_builtin_compositesHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_builtin_composites.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_PSA_BUILTIN_AEAD* = 1
|
||||
MBEDTLS_PSA_BUILTIN_PAKE* = 1
|
||||
|
|
|
@ -1,28 +1,12 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_driver_common"
|
||||
import "crypto_types"
|
||||
import "crypto_platform"
|
||||
import "crypto_values"
|
||||
import "crypto_sizes"
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_builtin_primitives.h
|
||||
|
||||
# const 'MBEDTLS_PSA_HASH_OPERATION_INIT' has unsupported value '{ 0, { 0 } }'
|
||||
# const 'MBEDTLS_PSA_CIPHER_OPERATION_INIT' has unsupported value '{ 0, 0, 0, { 0 } }'
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
{.pragma: impcrypto_builtin_primitivesHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_builtin_primitives.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_PSA_BUILTIN_CIPHER* = 1
|
||||
{.pop.}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_compat.h
|
||||
|
||||
# const 'PSA_KEY_HANDLE_INIT' has unsupported value 'MBEDTLS_SVC_KEY_ID_INIT'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
{.pragma: impcrypto_compatHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_compat.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
{.pop.}
|
|
@ -1,24 +1,11 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_config.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.pragma: impcrypto_configHdr,
|
||||
header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_config.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
PSA_WANT_ALG_CBC_NO_PADDING* = 1
|
||||
PSA_WANT_ALG_CBC_PKCS7* = 1
|
||||
|
|
|
@ -1,70 +1,14 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_types"
|
||||
import "crypto_platform"
|
||||
import "crypto_values"
|
||||
import "crypto_sizes"
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_driver_common.h
|
||||
import "../utils"
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.pragma: impcrypto_driver_commonHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_driver_common.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(psa_encrypt_or_decrypt_t)
|
||||
|
||||
const
|
||||
PSA_CRYPTO_DRIVER_DECRYPT* = (0).psa_encrypt_or_decrypt_t
|
||||
PSA_CRYPTO_DRIVER_ENCRYPT* = (PSA_CRYPTO_DRIVER_DECRYPT + 1).psa_encrypt_or_decrypt_t
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_driver_common"
|
||||
import "crypto_types"
|
||||
import "crypto_platform"
|
||||
import "crypto_values"
|
||||
import "crypto_sizes"
|
||||
import "crypto_builtin_composites"
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_driver_contexts_composites.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.pragma: impcrypto_driver_contexts_compositesHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_driver_contexts_composites.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
{.pop.}
|
|
@ -1,26 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_driver_common"
|
||||
import "crypto_types"
|
||||
import "crypto_platform"
|
||||
import "crypto_values"
|
||||
import "crypto_sizes"
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_driver_contexts_key_derivation.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.pragma: impcrypto_driver_contexts_key_derivationHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_driver_contexts_key_derivation.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
{.pop.}
|
|
@ -1,27 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_driver_common"
|
||||
import "crypto_types"
|
||||
import "crypto_platform"
|
||||
import "crypto_values"
|
||||
import "crypto_sizes"
|
||||
import "crypto_builtin_primitives"
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_driver_contexts_primitives.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.pragma: impcrypto_driver_contexts_primitivesHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_driver_contexts_primitives.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
{.pop.}
|
|
@ -1,23 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_extra.h
|
||||
|
||||
# const 'PSA_ALG_DSA_DETERMINISTIC_FLAG' has unsupported value 'PSA_ALG_ECDSA_DETERMINISTIC_FLAG'
|
||||
# const 'PSA_PAKE_CIPHER_SUITE_INIT' has unsupported value '{ PSA_ALG_NONE, 0, 0, 0, PSA_ALG_NONE }'
|
||||
# const 'PSA_PAKE_OPERATION_INIT' has unsupported value '{ 0, PSA_ALG_NONE, 0, PSA_PAKE_OPERATION_STAGE_SETUP, { 0 }, { { 0 } } }'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
{.pragma: impcrypto_extraHdr,
|
||||
header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_extra.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
{.pop.}
|
|
@ -1,22 +0,0 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-12T13:12:43+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_platform.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.pragma: impcrypto_platformHdr,
|
||||
header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_platform.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
{.pop.}
|
|
@ -1,73 +1,19 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_driver_common"
|
||||
import "crypto_types"
|
||||
import "crypto_platform"
|
||||
import "crypto_values"
|
||||
import "crypto_sizes"
|
||||
import "../utils"
|
||||
|
||||
{.compile: "./mbedtls/library/psa_crypto_se.c".}
|
||||
# Generated @ 2023-05-12T13:12:44+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_se_driver.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.pragma: impcrypto_se_driverHdr,
|
||||
header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_se_driver.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(psa_key_creation_method_t)
|
||||
|
||||
const
|
||||
PSA_KEY_CREATION_IMPORT* = (0).psa_key_creation_method_t
|
||||
PSA_KEY_CREATION_GENERATE* = (PSA_KEY_CREATION_IMPORT + 1).psa_key_creation_method_t
|
||||
|
|
|
@ -1,16 +1,3 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
# Generated @ 2023-05-12T13:12:44+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_sizes.h
|
||||
|
||||
# const 'PSA_MAC_MAX_SIZE' has unsupported value 'PSA_HASH_MAX_SIZE'
|
||||
# const 'PSA_VENDOR_ECDSA_SIGNATURE_MAX_SIZE' has unsupported value 'PSA_ECDSA_SIGNATURE_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS)'
|
||||
# const 'PSA_SIGNATURE_MAX_SIZE' has unsupported value '(PSA_BITS_TO_BYTES(PSA_VENDOR_RSA_MAX_KEY_BITS) > PSA_VENDOR_ECDSA_SIGNATURE_MAX_SIZE ? PSA_BITS_TO_BYTES(PSA_VENDOR_RSA_MAX_KEY_BITS) : PSA_VENDOR_ECDSA_SIGNATURE_MAX_SIZE)'
|
||||
|
@ -19,14 +6,15 @@
|
|||
# const 'PSA_EXPORT_KEY_PAIR_MAX_SIZE' has unsupported value '(PSA_KEY_EXPORT_RSA_KEY_PAIR_MAX_SIZE(PSA_VENDOR_RSA_MAX_KEY_BITS) > PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) ? PSA_KEY_EXPORT_RSA_KEY_PAIR_MAX_SIZE(PSA_VENDOR_RSA_MAX_KEY_BITS) : PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS))'
|
||||
# const 'PSA_EXPORT_PUBLIC_KEY_MAX_SIZE' has unsupported value '(PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_RSA_MAX_KEY_BITS) > PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) ? PSA_KEY_EXPORT_RSA_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_RSA_MAX_KEY_BITS) : PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS))'
|
||||
# const 'PSA_RAW_KEY_AGREEMENT_OUTPUT_MAX_SIZE' has unsupported value '(PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS))'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.pragma: impcrypto_sizesHdr,
|
||||
header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_sizes.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
PSA_HASH_MAX_SIZE* = 64
|
||||
PSA_HMAC_MAX_HASH_BLOCK_SIZE* = 128
|
||||
|
|
|
@ -1,26 +1,5 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_driver_contexts_primitives"
|
||||
import "crypto_driver_common"
|
||||
import "crypto_types"
|
||||
import "crypto_platform"
|
||||
import "crypto_values"
|
||||
import "crypto_sizes"
|
||||
import "crypto_builtin_primitives"
|
||||
import "crypto_driver_contexts_composites"
|
||||
import "crypto_builtin_composites"
|
||||
import "crypto_driver_contexts_key_derivation"
|
||||
{.compile: "./mbedtls/library/psa_crypto_client.c".}
|
||||
# Generated @ 2023-05-12T13:12:44+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_struct.h
|
||||
|
||||
# const 'PSA_HASH_OPERATION_INIT' has unsupported value '{ 0, { 0 } }'
|
||||
# const 'PSA_CIPHER_OPERATION_INIT' has unsupported value '{ 0, 0, 0, 0, { 0 } }'
|
||||
|
@ -33,14 +12,15 @@ import "crypto_driver_contexts_key_derivation"
|
|||
# const 'PSA_KEY_ATTRIBUTES_INIT' has unsupported value '{ PSA_CORE_KEY_ATTRIBUTES_INIT, NULL, 0 }'
|
||||
# const 'PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT' has unsupported value '{ 0, { 0 }, 0, 0 }'
|
||||
# const 'PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT' has unsupported value '{ 0, { 0 }, 0, 0 }'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.pragma: impcrypto_structHdr,
|
||||
header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_struct.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
PSA_MAX_KEY_BITS* = 0x0000FFF8
|
||||
MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER* = (
|
||||
|
|
|
@ -1,13 +1,3 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "crypto_platform"
|
||||
import "../md5"
|
||||
import "../ripemd160"
|
||||
import "../sha1"
|
||||
|
@ -18,59 +8,17 @@ import "../ccm"
|
|||
import "../gcm"
|
||||
import "../chachapoly"
|
||||
import "../ecjpake"
|
||||
# Generated @ 2023-05-12T13:12:44+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_types.h
|
||||
import "../utils"
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.pragma: impcrypto_builtin_key_derivationHdr, header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_builtin_key_derivation.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(psa_tls12_prf_key_derivation_state_t)
|
||||
|
||||
const
|
||||
PSA_TLS12_PRF_STATE_INIT* = (0).psa_tls12_prf_key_derivation_state_t
|
||||
PSA_TLS12_PRF_STATE_SEED_SET* = (PSA_TLS12_PRF_STATE_INIT + 1).psa_tls12_prf_key_derivation_state_t
|
||||
|
|
|
@ -1,16 +1,4 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
import "crypto_types"
|
||||
#
|
||||
# Generated @ 2023-05-12T13:12:44+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/psa/crypto_values.h
|
||||
|
||||
# const 'PSA_ERROR_GENERIC_ERROR' has unsupported value '((psa_status_t)-132)'
|
||||
# const 'PSA_ERROR_NOT_SUPPORTED' has unsupported value '((psa_status_t)-134)'
|
||||
|
@ -37,14 +25,15 @@ import "crypto_types"
|
|||
# const 'PSA_ALG_RSA_PKCS1V15_SIGN_RAW' has unsupported value 'PSA_ALG_RSA_PKCS1V15_SIGN_BASE'
|
||||
# const 'PSA_ALG_ECDSA_ANY' has unsupported value 'PSA_ALG_ECDSA_BASE'
|
||||
# const 'PSA_INTERRUPTIBLE_MAX_OPS_UNLIMITED' has unsupported value 'UINT32_MAX'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.pragma: impcrypto_valuesHdr,
|
||||
header: "/home/lchenut/minnim/webrtc/mbedtls/include/psa/crypto_values.h".}
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
PSA_SUCCESS* = (cast[psa_status_t](0))
|
||||
PSA_KEY_TYPE_NONE* = (cast[psa_key_type_t](0x00000000))
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "ctr_drbg"
|
||||
import "pkcs5"
|
||||
import "pkcs12"
|
||||
# TODO: Remove pkcs5 and pkcs12, they're not used in this file.
|
||||
import "psa/crypto_types"
|
||||
{.compile: "./mbedtls/library/psa_util.c".}
|
||||
# Generated @ 2023-05-11T11:19:13+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/psa_util.h
|
||||
|
||||
# proc 'mbedtls_psa_translate_cipher_type' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_psa_translate_cipher_mode' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
|
@ -24,12 +13,13 @@ import "psa/crypto_types"
|
|||
# const 'MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH' has unsupported value 'PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS)'
|
||||
# const 'MBEDTLS_PSA_MAX_EC_KEY_PAIR_LENGTH' has unsupported value 'PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS)'
|
||||
# const 'MBEDTLS_PSA_RANDOM_STATE' has unsupported value 'mbedtls_psa_random_state'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type
|
||||
mbedtls_f_rng_t* = proc (p_rng: pointer; output: ptr byte; output_size: uint): cint {.
|
||||
cdecl.}
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/ripemd160.c".}
|
||||
# Generated @ 2023-05-11T11:19:13+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ripemd160.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type
|
||||
mbedtls_ripemd160_context* {.bycopy.} = object
|
||||
private_total*: array[2, uint32]
|
||||
|
|
|
@ -1,29 +1,17 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "hash_info"
|
||||
import "bignum"
|
||||
import "md"
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/oid.c"}
|
||||
{.compile: "./mbedtls/library/rsa.c"}
|
||||
{.compile: "./mbedtls/library/rsa_alt_helpers.c"}
|
||||
# Generated @ 2023-05-11T11:19:13+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/rsa.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_RSA_BAD_INPUT_DATA* = -0x00004080
|
||||
MBEDTLS_ERR_RSA_INVALID_PADDING* = -0x00004100
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/sha1.c".}
|
||||
# Generated @ 2023-05-11T11:19:13+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/sha1.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_SHA1_BAD_INPUT_DATA* = -0x00000073
|
||||
type
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/sha256.c".}
|
||||
# Generated @ 2023-05-11T11:19:13+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/sha256.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_SHA256_BAD_INPUT_DATA* = -0x00000074
|
||||
type
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_time"
|
||||
|
||||
{.compile: "./mbedtls/library/sha512.c".}
|
||||
# Generated @ 2023-05-11T11:19:13+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/sha512.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_SHA512_BAD_INPUT_DATA* = -0x00000075
|
||||
type
|
||||
|
|
|
@ -1,52 +1,20 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "platform_util"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "ssl_ciphersuites"
|
||||
import "platform_time"
|
||||
import "private_access"
|
||||
import "bignum"
|
||||
import "ecp"
|
||||
import "ssl_ciphersuites"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecdsa"
|
||||
import "cipher"
|
||||
import "x509_crt"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "x509_crl"
|
||||
import "dhm"
|
||||
import "ecdh"
|
||||
import "md5"
|
||||
import "ripemd160"
|
||||
import "sha1"
|
||||
import "sha256"
|
||||
import "sha512"
|
||||
import "cmac"
|
||||
import "gcm"
|
||||
import "ccm"
|
||||
import "chachapoly"
|
||||
import "poly1305"
|
||||
import "chacha20"
|
||||
import "ecjpake"
|
||||
{.compile: "./mbedtls/library/ssl_ciphersuites.c".}
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/debug.c".}
|
||||
{.compile: "./mbedtls/library/ssl_debug_helpers_generated.c".}
|
||||
{.compile: "./mbedtls/library/ssl_msg.c".}
|
||||
{.compile: "./mbedtls/library/ssl_tls12_server.c".}
|
||||
{.compile: "./mbedtls/library/ssl_tls.c".}
|
||||
# Generated @ 2023-05-11T11:19:14+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ssl.h
|
||||
{.compile: "./mbedtls/library/ssl_client.c".}
|
||||
{.compile: "./mbedtls/library/ssl_tls12_client.c".}
|
||||
|
||||
# const 'MBEDTLS_PREMASTER_SIZE' has unsupported value 'sizeof(union mbedtls_ssl_premaster_secret)'
|
||||
# const 'MBEDTLS_TLS1_3_MD_MAX_SIZE' has unsupported value 'PSA_HASH_MAX_SIZE'
|
||||
|
@ -65,58 +33,18 @@ import "ecjpake"
|
|||
# proc 'mbedtls_ssl_conf_min_tls_version' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_ssl_get_version_number' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_ssl_is_handshake_over' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_ssl_states)
|
||||
defineEnum(mbedtls_ssl_protocol_version)
|
||||
defineEnum(mbedtls_tls_prf_types)
|
||||
defineEnum(mbedtls_ssl_key_export_type)
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS* = -0x00007000
|
||||
MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE* = -0x00007080
|
||||
|
|
|
@ -1,57 +1,14 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "ssl"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
import "ecp"
|
||||
import "ssl_ciphersuites"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecdsa"
|
||||
import "cipher"
|
||||
import "x509_crt"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "x509_crl"
|
||||
import "dhm"
|
||||
import "ecdh"
|
||||
import "md5"
|
||||
import "ripemd160"
|
||||
import "sha1"
|
||||
import "sha256"
|
||||
import "sha512"
|
||||
import "cmac"
|
||||
import "gcm"
|
||||
import "ccm"
|
||||
import "chachapoly"
|
||||
import "poly1305"
|
||||
import "chacha20"
|
||||
import "ecjpake"
|
||||
|
||||
{.compile: "./mbedtls/library/ssl_cache.c".}
|
||||
# Generated @ 2023-05-11T11:19:14+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ssl_cache.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT* = 86400
|
||||
MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES* = 50
|
||||
|
|
|
@ -1,30 +1,7 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "rsa"
|
||||
import "bignum"
|
||||
import "ecp"
|
||||
import "ecdsa"
|
||||
import "cipher"
|
||||
import "utils"
|
||||
|
||||
{.compile: "./mbedtls/library/ssl_ciphersuites.c".}
|
||||
# Generated @ 2023-05-11T11:19:14+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ssl_ciphersuites.h
|
||||
|
||||
# proc 'mbedtls_ssl_ciphersuite_get_name' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_ssl_ciphersuite_has_pfs' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
|
@ -35,55 +12,15 @@ import "cipher"
|
|||
# proc 'mbedtls_ssl_ciphersuite_uses_dhe' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_ssl_ciphersuite_uses_ecdhe' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# proc 'mbedtls_ssl_ciphersuite_uses_server_signature' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
import macros
|
||||
|
||||
macro defineEnum(typ: untyped): untyped =
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
||||
# Enum mapped to distinct cint
|
||||
result.add quote do:
|
||||
type `typ`* = distinct cint
|
||||
|
||||
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
|
||||
let
|
||||
ni = newIdentNode(i)
|
||||
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
|
||||
if i[0] == '>': # cannot borrow `>` and `>=` from templates
|
||||
let
|
||||
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
|
||||
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
|
||||
else:
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
|
||||
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
|
||||
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
|
||||
result.add quote do:
|
||||
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
|
||||
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
|
||||
|
||||
let
|
||||
divop = newIdentNode("/") # `/`()
|
||||
dlrop = newIdentNode("$") # `$`()
|
||||
notop = newIdentNode("not") # `not`()
|
||||
result.add quote do:
|
||||
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
|
||||
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
|
||||
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
|
||||
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
|
||||
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
|
||||
|
||||
proc `dlrop`*(x: `typ`): string {.borrow.}
|
||||
proc `notop`*(x: `typ`): `typ` {.borrow.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
defineEnum(mbedtls_key_exchange_type_t)
|
||||
|
||||
const
|
||||
MBEDTLS_TLS_RSA_WITH_NULL_MD5* = 0x00000001
|
||||
MBEDTLS_TLS_RSA_WITH_NULL_SHA* = 0x00000002
|
||||
|
|
|
@ -1,57 +1,14 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "ssl"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
import "ecp"
|
||||
import "ssl_ciphersuites"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecdsa"
|
||||
import "cipher"
|
||||
import "x509_crt"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "x509_crl"
|
||||
import "dhm"
|
||||
import "ecdh"
|
||||
import "md5"
|
||||
import "ripemd160"
|
||||
import "sha1"
|
||||
import "sha256"
|
||||
import "sha512"
|
||||
import "cmac"
|
||||
import "gcm"
|
||||
import "ccm"
|
||||
import "chachapoly"
|
||||
import "poly1305"
|
||||
import "chacha20"
|
||||
import "ecjpake"
|
||||
|
||||
{.compile: "./mbedtls/library/ssl_cookie.c".}
|
||||
# Generated @ 2023-05-11T11:19:14+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ssl_cookie.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_SSL_COOKIE_TIMEOUT* = 60
|
||||
type
|
||||
|
|
|
@ -1,57 +1,16 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "ssl"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
import "ecp"
|
||||
import "ssl_ciphersuites"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecdsa"
|
||||
import "cipher"
|
||||
import "x509_crt"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "x509_crl"
|
||||
import "dhm"
|
||||
import "ecdh"
|
||||
import "md5"
|
||||
import "ripemd160"
|
||||
import "sha1"
|
||||
import "sha256"
|
||||
import "sha512"
|
||||
import "cmac"
|
||||
import "gcm"
|
||||
import "ccm"
|
||||
import "chachapoly"
|
||||
import "poly1305"
|
||||
import "chacha20"
|
||||
import "ecjpake"
|
||||
|
||||
{.compile: "./mbedtls/library/ssl_ticket.c".}
|
||||
# Generated @ 2023-05-11T11:19:15+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/ssl_ticket.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_SSL_TICKET_MAX_KEY_BYTES* = 32
|
||||
MBEDTLS_SSL_TICKET_KEY_NAME_BYTES* = 4
|
||||
|
|
|
@ -1,27 +1,9 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
# Generated @ 2023-05-11T11:19:15+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/threading.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_ERR_THREADING_BAD_INPUT_DATA* = -0x0000001C
|
||||
MBEDTLS_ERR_THREADING_MUTEX_ERROR* = -0x0000001E
|
||||
|
|
|
@ -1,28 +1,11 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
{.compile: "./mbedtls/library/timing.c".}
|
||||
# Generated @ 2023-05-11T11:19:15+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/timing.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type
|
||||
mbedtls_timing_hr_time* {.bycopy.} = object
|
||||
private_opaque*: array[4, uint64]
|
||||
|
|
|
@ -1,28 +1,12 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
{.compile: "./mbedtls/library/version.c".}
|
||||
{.compile: "./mbedtls/library/version_features.c".}
|
||||
# Generated @ 2023-05-11T11:19:15+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/version.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
proc mbedtls_version_get_number*(): cuint {.importc, cdecl.}
|
||||
proc mbedtls_version_get_string*(string: cstring) {.importc, cdecl.}
|
||||
proc mbedtls_version_get_string_full*(string: cstring) {.importc, cdecl.}
|
||||
|
|
|
@ -1,37 +1,9 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "asn1"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecp"
|
||||
import "ecdsa"
|
||||
import "oid"
|
||||
import "hmac_drbg"
|
||||
import "asn1write"
|
||||
import "nist_kw"
|
||||
import "hash_info"
|
||||
{.compile: "./mbedtls/library/rsa_alt_helpers.c".}
|
||||
|
||||
{.compile: "./mbedtls/library/x509.c".}
|
||||
{.compile: "./mbedtls/library/x509_create.c".}
|
||||
# Generated @ 2023-05-11T11:19:15+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/x509.h
|
||||
|
||||
# const 'MBEDTLS_X509_EXT_AUTHORITY_KEY_IDENTIFIER' has unsupported value 'MBEDTLS_OID_X509_EXT_AUTHORITY_KEY_IDENTIFIER'
|
||||
# const 'MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER' has unsupported value 'MBEDTLS_OID_X509_EXT_SUBJECT_KEY_IDENTIFIER'
|
||||
|
@ -51,12 +23,13 @@ import "hash_info"
|
|||
# const 'MBEDTLS_X509_EXT_NS_CERT_TYPE' has unsupported value 'MBEDTLS_OID_X509_EXT_NS_CERT_TYPE'
|
||||
# proc 'mbedtls_x509_dn_get_next' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
# const 'MBEDTLS_X509_SAFE_SNPRINTF' has unsupported value 'do { if (ret < 0 || (size_t) ret >= n) return MBEDTLS_ERR_X509_BUFFER_TOO_SMALL; n -= (size_t) ret; p += (size_t) ret; } while (0)'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_X509_MAX_INTERMEDIATE_CA* = 8
|
||||
MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE* = -0x00002080
|
||||
|
|
|
@ -1,38 +1,15 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecp"
|
||||
import "ecdsa"
|
||||
|
||||
{.compile: "./mbedtls/library/x509_crl.c".}
|
||||
# Generated @ 2023-05-11T11:19:15+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/x509_crl.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type
|
||||
mbedtls_x509_crl_entry* {.bycopy.} = object
|
||||
raw*: mbedtls_x509_buf
|
||||
|
|
|
@ -1,43 +1,23 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecp"
|
||||
import "ecdsa"
|
||||
import "x509_crl"
|
||||
import "asn1"
|
||||
import "bignum"
|
||||
import "md"
|
||||
import "pk"
|
||||
|
||||
{.compile: "./mbedtls/library/x509_crt.c".}
|
||||
{.compile: "./mbedtls/library/x509write_crt.c".}
|
||||
# Generated @ 2023-05-11T11:19:15+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/x509_crt.h
|
||||
|
||||
# const 'MBEDTLS_X509_CRT_ERROR_INFO_LIST' has unsupported value 'X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_EXPIRED, "MBEDTLS_X509_BADCERT_EXPIRED", "The certificate validity has expired") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_REVOKED, "MBEDTLS_X509_BADCERT_REVOKED", "The certificate has been revoked (is on a CRL)") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_CN_MISMATCH, "MBEDTLS_X509_BADCERT_CN_MISMATCH", "The certificate Common Name (CN) does not match with the expected CN") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_NOT_TRUSTED, "MBEDTLS_X509_BADCERT_NOT_TRUSTED", "The certificate is not correctly signed by the trusted CA") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_NOT_TRUSTED, "MBEDTLS_X509_BADCRL_NOT_TRUSTED", "The CRL is not correctly signed by the trusted CA") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_EXPIRED, "MBEDTLS_X509_BADCRL_EXPIRED", "The CRL is expired") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_MISSING, "MBEDTLS_X509_BADCERT_MISSING", "Certificate was missing") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_SKIP_VERIFY, "MBEDTLS_X509_BADCERT_SKIP_VERIFY", "Certificate verification was skipped") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_OTHER, "MBEDTLS_X509_BADCERT_OTHER", "Other reason (can be used by verify callback)") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_FUTURE, "MBEDTLS_X509_BADCERT_FUTURE", "The certificate validity starts in the future") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_FUTURE, "MBEDTLS_X509_BADCRL_FUTURE", "The CRL is from the future") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_KEY_USAGE, "MBEDTLS_X509_BADCERT_KEY_USAGE", "Usage does not match the keyUsage extension") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_EXT_KEY_USAGE, "MBEDTLS_X509_BADCERT_EXT_KEY_USAGE", "Usage does not match the extendedKeyUsage extension") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_NS_CERT_TYPE, "MBEDTLS_X509_BADCERT_NS_CERT_TYPE", "Usage does not match the nsCertType extension") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_BAD_MD, "MBEDTLS_X509_BADCERT_BAD_MD", "The certificate is signed with an unacceptable hash.") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_BAD_PK, "MBEDTLS_X509_BADCERT_BAD_PK", "The certificate is signed with an unacceptable PK alg (eg RSA vs ECDSA).") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCERT_BAD_KEY, "MBEDTLS_X509_BADCERT_BAD_KEY", "The certificate is signed with an unacceptable key (eg bad curve, RSA too short).") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_BAD_MD, "MBEDTLS_X509_BADCRL_BAD_MD", "The CRL is signed with an unacceptable hash.") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_BAD_PK, "MBEDTLS_X509_BADCRL_BAD_PK", "The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA).") X509_CRT_ERROR_INFO(MBEDTLS_X509_BADCRL_BAD_KEY, "MBEDTLS_X509_BADCRL_BAD_KEY", "The CRL is signed with an unacceptable key (eg bad curve, RSA too short).")'
|
||||
# const 'MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE' has unsupported value '(MBEDTLS_X509_MAX_INTERMEDIATE_CA + 2)'
|
||||
# proc 'mbedtls_x509_crt_has_ext_type' skipped - static inline procs cannot work with '--noHeader | -H'
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
const
|
||||
MBEDTLS_X509_CRT_VERSION_1* = 0
|
||||
MBEDTLS_X509_CRT_VERSION_2* = 1
|
||||
|
|
|
@ -1,39 +1,17 @@
|
|||
#import strformat, os
|
||||
#
|
||||
## C include directory
|
||||
#const root = currentSourcePath.parentDir
|
||||
#const mbedtlsInclude = root/"mbedtls"/"include"
|
||||
#const mbedtlsLibrary = root/"mbedtls"/"library"
|
||||
#
|
||||
#{.passc: fmt"-I{mbedtlsInclude} -I{mbedtlsLibrary}".}
|
||||
#
|
||||
import "private_access"
|
||||
import "build_info"
|
||||
import "mbedtls_config"
|
||||
import "config_psa"
|
||||
import "check_config"
|
||||
import "x509"
|
||||
import "asn1"
|
||||
import "platform_util"
|
||||
import "platform_time"
|
||||
import "bignum"
|
||||
import "pk"
|
||||
import "md"
|
||||
import "rsa"
|
||||
import "ecp"
|
||||
import "ecdsa"
|
||||
|
||||
{.compile: "./mbedtls/library/x509_csr.c".}
|
||||
{.compile: "./mbedtls/library/x509write_csr.c".}
|
||||
# Generated @ 2023-05-11T11:19:15+02:00
|
||||
# Command line:
|
||||
# /home/lchenut/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --pnim --preprocess --nocomment --noHeader --replace=_pms_rsa=u_pms_rsa --replace=_pms_dhm=u_pms_dhm --replace=_pms_ecdh=u_pms_ecdh --replace=_pms_psk=u_pms_psk --replace=_pms_dhe_psk=u_pms_dhe_psk --replace=_pms_rsa_psk=u_pms_rsa_psk --replace=_pms_ecdhe_psk=u_pms_ecdhe_psk --replace=_pms_ecjpake=u_pms_ecjpake --replace=private_xm1=private_xm1_1 --replace=private_xm2=private_xm2_1 --includeDirs=./mbedtls/include --includeDirs=./mbedtls/library ./mbedtls/include/mbedtls/x509_csr.h
|
||||
|
||||
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
|
||||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.passc: "-I./mbedtls/include".}
|
||||
{.passc: "-I./mbedtls/library".}
|
||||
|
||||
type
|
||||
mbedtls_x509_csr* {.bycopy.} = object
|
||||
raw*: mbedtls_x509_buf
|
||||
|
|
Loading…
Reference in New Issue