Port libsparkcrypto

This commit is contained in:
Alexander Senier 2019-02-25 11:03:48 +01:00 committed by Christian Helmuth
parent 127e5a2726
commit 4c8d787918
6 changed files with 422 additions and 0 deletions

View File

@ -0,0 +1,6 @@
LSC_DIR := $(call select_from_ports,libsparkcrypto)/libsparkcrypto/src
INC_DIR += \
$(LSC_DIR)/ada/generic \
$(LSC_DIR)/shared/little_endian \
$(LSC_DIR)/ada/nullio \
$(LSC_DIR)/shared/generic

View File

@ -0,0 +1,80 @@
include $(call select_from_repositories,lib/import/import-libsparkcrypto.mk)
SRC_ADS = \
lsc.ads \
lsc-internal-debug.ads \
lsc-internal.ads \
lsc-internal-aes-tables.ads \
lsc-internal-convert.ads \
lsc-internal-debug.ads \
lsc-internal-math_int.ads \
lsc-internal-sha256-tables.ads \
lsc-internal-sha512-tables.ads \
lsc-types.ads \
lsc-internal-aes-print.ads \
lsc-internal-ripemd160-print.ads \
SRC_ADB = \
lsc-internal-types.adb \
lsc-internal-io.adb \
lsc-internal-aes.adb \
lsc-internal-aes-cbc.adb \
lsc-internal-bignum.adb \
lsc-internal-byteorder32.adb \
lsc-internal-byteorder64.adb \
lsc-internal-byteswap32.adb \
lsc-internal-byteswap64.adb \
lsc-internal-ec.adb \
lsc-internal-ec_signature.adb \
lsc-internal-hmac_ripemd160.adb \
lsc-internal-hmac_sha1.adb \
lsc-internal-hmac_sha256.adb \
lsc-internal-hmac_sha384.adb \
lsc-internal-hmac_sha512.adb \
lsc-internal-ops32.adb \
lsc-internal-ops64.adb \
lsc-internal-pad32.adb \
lsc-internal-pad64.adb \
lsc-internal-ripemd160.adb \
lsc-internal-sha1.adb \
lsc-internal-sha256.adb \
lsc-internal-sha512.adb \
SRC_ADB += \
lsc-aes.adb \
lsc-aes-cbc.adb \
lsc-aes_generic.adb \
lsc-aes_generic-cbc.adb \
lsc-internal-convert_hash.adb \
lsc-internal-convert_hmac.adb \
lsc-ops_generic.adb \
lsc-ripemd160.adb \
lsc-ripemd160_generic.adb \
lsc-ripemd160-hmac.adb \
lsc-ripemd160-hmac_generic.adb \
lsc-sha1.adb \
lsc-sha1_generic.adb \
lsc-sha1-hmac.adb \
lsc-sha1-hmac_generic.adb \
lsc-sha2.adb \
lsc-sha2_generic.adb \
lsc-sha2-hmac.adb \
lsc-sha2-hmac_generic.adb \
# Normally, we use the minimal 'spark' runtime. The unit tests, however, use the
# fat 'ada' runtime and we must not mix the two. Hence, make the runtime
# configurable from outside.
LSC_RUNTIME ?= spark
LIBS += $(LSC_RUNTIME)
vpath lsc-internal-io.adb $(LSC_DIR)/ada/nullio
vpath lsc-internal-byteorder32.adb $(LSC_DIR)/shared/little_endian
vpath lsc-internal-byteorder64.adb $(LSC_DIR)/shared/little_endian
vpath lsc-internal-types.adb $(LSC_DIR)/ada/generic
vpath %.adb $(LSC_DIR)/shared/generic
vpath %.ads $(LSC_DIR)/shared/generic
SHARED_LIB = yes
CUSTOM_ADA_OPT += -gnatec=$(LSC_DIR)/../build/pragmas.adc -fPIC

View File

@ -0,0 +1,2 @@
LSC_RUNTIME := spark
include $(call select_from_repositories,lib/mk/libsparkcrypto.inc)

View File

@ -0,0 +1,326 @@
lsc__aes__cbc__decrypt T
lsc__aes__cbc_E D 2
lsc__aes__cbc__encrypt T
lsc__aes__dec_key T
lsc__aes__decrypt T
lsc__aes_E D 2
lsc__aes__enc_key T
lsc__aes__encrypt T
lsc__aes_generic__cbc_E D 2
lsc__aes_generic__dec_key_typeIP T
lsc__aes_generic_E D 2
lsc__aes_generic__enc_key_typeIP T
lsc__aes_generic__key_bytes T
lsc__aes_generic__keylen_typeN R 4
lsc__aes_generic__keylen_typeS R 16
lsc__aes__l128 R 1
lsc__aes__l192 R 1
lsc__aes__l256 R 1
lsc_E D 2
lsc__internal__aes__aes_dec_contextIP T
lsc__internal__aes__aes_enc_contextIP T
lsc__internal__aes__cbc__decrypt T
lsc__internal__aes__cbc_E D 2
lsc__internal__aes__cbc__encrypt T
lsc__internal__aes__create_aes128_dec_context T
lsc__internal__aes__create_aes128_enc_context T
lsc__internal__aes__create_aes192_dec_context T
lsc__internal__aes__create_aes192_enc_context T
lsc__internal__aes__create_aes256_dec_context T
lsc__internal__aes__create_aes256_enc_context T
lsc__internal__aes__decrypt T
lsc__internal__aes_E D 2
lsc__internal__aes__encrypt T
lsc__internal__aes__key_typeIP T
lsc__internal__aes__message_typeIP T
lsc__internal__aes__nb R 1
lsc__internal__aes__null_aes128_key R 16
lsc__internal__aes__null_aes192_key R 24
lsc__internal__aes__null_aes256_key R 32
lsc__internal__aes__null_block R 16
lsc__internal__aes__null_schedule R 240
lsc__internal__aes__print_E D 2
lsc__internal__aes__tables_E D 2
lsc__internal__aes__tables__rcon R 120
lsc__internal__aes__tables__si R 256
lsc__internal__aes__tables__s R 256
lsc__internal__aes__tables__t1 R 1024
lsc__internal__aes__tables__t2 R 1024
lsc__internal__aes__tables__t3 R 1024
lsc__internal__aes__tables__t4 R 1024
lsc__internal__aes__tables__t5 R 1024
lsc__internal__aes__tables__t6 R 1024
lsc__internal__aes__tables__t7 R 1024
lsc__internal__aes__tables__t8 R 1024
lsc__internal__aes__tables__Trcon_typeBIP T
lsc__internal__aes__tables__Tsbox_typeBIP T
lsc__internal__aes__tables__Ttable_typeBIP T
lsc__internal__aes__tables__u1 R 1024
lsc__internal__aes__tables__u2 R 1024
lsc__internal__aes__tables__u3 R 1024
lsc__internal__aes__tables__u4 R 1024
lsc__internal__bignum__add_inplace T
lsc__internal__bignum__add T
lsc__internal__bignum__big_intIP T
lsc__internal__bignum__copy T
lsc__internal__bignum__double_inplace T
lsc__internal__bignum_E D 2
lsc__internal__bignum__equal T
lsc__internal__bignum__initialize T
lsc__internal__bignum__is_zero T
lsc__internal__bignum__less T
lsc__internal__bignum__mod_add_inplace T
lsc__internal__bignum__mod_add T
lsc__internal__bignum__mod_sub_inplace T
lsc__internal__bignum__mod_sub T
lsc__internal__bignum__mont_exp T
lsc__internal__bignum__mont_exp_window T
lsc__internal__bignum__mont_mult T
lsc__internal__bignum__native_to_be T
lsc__internal__bignum__shr_inplace T
lsc__internal__bignum__size_square_mod T
lsc__internal__bignum__sub_inplace T
lsc__internal__bignum__sub T
lsc__internal__bignum__word_inverse T
lsc__internal__byteorder32__be_to_native T
lsc__internal__byteorder32_E D 2
lsc__internal__byteorder32__le_to_native T
lsc__internal__byteorder32__native_to_be T
lsc__internal__byteorder32__native_to_le T
lsc__internal__byteorder64__be_to_native T
lsc__internal__byteorder64_E D 2
lsc__internal__byteorder64__le_to_native T
lsc__internal__byteorder64__native_to_be T
lsc__internal__byteorder64__native_to_le T
lsc__internal__byteswap32_E D 2
lsc__internal__byteswap32__swap T
lsc__internal__byteswap64_E D 2
lsc__internal__byteswap64__swap T
lsc__internal__convert_E D 2
lsc__internal__convert_hash_E D 2
lsc__internal__convert_hmac_E D 2
lsc__internal__debug_E D 2
lsc__internal__ec__A3s B 80
lsc__internal__ec_E D 2
lsc__internal__ec___elabs T
lsc__internal__ec__invert T
lsc__internal__ec__J4s D 4
lsc__internal__ec__make_affine T
lsc__internal__ec__on_curve T
lsc__internal__ec__one B 80
lsc__internal__ec__point_add T
lsc__internal__ec__point_double T
lsc__internal__ec__point_mult T
lsc__internal__ec_signature_E D 2
lsc__internal__ec_signature__signature_typeN R 4
lsc__internal__ec_signature__signature_typeS R 16
lsc__internal__ec_signature__sign T
lsc__internal__ec_signature__verify T
lsc__internal__ec__two_point_mult T
lsc__internal__ec__uncompress_point T
lsc__internal_E D 2
lsc__internal__hmac_ripemd160__authenticate T
lsc__internal__hmac_ripemd160__context_finalize_outer T
lsc__internal__hmac_ripemd160__context_finalize T
lsc__internal__hmac_ripemd160__context_init T
lsc__internal__hmac_ripemd160__context_typeIP T
lsc__internal__hmac_ripemd160__context_update T
lsc__internal__hmac_ripemd160_E D 2
lsc__internal__hmac_ripemd160__get_auth T
lsc__internal__hmac_ripemd160__ipad R 64
lsc__internal__hmac_ripemd160__opad R 64
lsc__internal__hmac_sha1__authenticate T
lsc__internal__hmac_sha1__context_finalize_outer T
lsc__internal__hmac_sha1__context_finalize T
lsc__internal__hmac_sha1__context_init T
lsc__internal__hmac_sha1__context_typeIP T
lsc__internal__hmac_sha1__context_update T
lsc__internal__hmac_sha1_E D 2
lsc__internal__hmac_sha1__get_auth T
lsc__internal__hmac_sha1__ipad R 64
lsc__internal__hmac_sha1__opad R 64
lsc__internal__hmac_sha256__authenticate T
lsc__internal__hmac_sha256__context_finalize T
lsc__internal__hmac_sha256__context_init T
lsc__internal__hmac_sha256__context_typeIP T
lsc__internal__hmac_sha256__context_update T
lsc__internal__hmac_sha256_E D 2
lsc__internal__hmac_sha256__get_auth T
lsc__internal__hmac_sha256__get_prf T
lsc__internal__hmac_sha256__pseudorandom T
lsc__internal__hmac_sha384__authenticate T
lsc__internal__hmac_sha384__context_finalize T
lsc__internal__hmac_sha384__context_init T
lsc__internal__hmac_sha384__context_typeIP T
lsc__internal__hmac_sha384__context_update T
lsc__internal__hmac_sha384_E D 2
lsc__internal__hmac_sha384__get_auth T
lsc__internal__hmac_sha384__get_prf T
lsc__internal__hmac_sha384__null_auth R 24
lsc__internal__hmac_sha384__pseudorandom T
lsc__internal__hmac_sha512__authenticate T
lsc__internal__hmac_sha512__context_finalize T
lsc__internal__hmac_sha512__context_init T
lsc__internal__hmac_sha512__context_typeIP T
lsc__internal__hmac_sha512__context_update T
lsc__internal__hmac_sha512_E D 2
lsc__internal__hmac_sha512__get_auth T
lsc__internal__hmac_sha512__get_prf T
lsc__internal__hmac_sha512__null_auth R 32
lsc__internal__hmac_sha512__pseudorandom T
lsc__internal__io_E D 2
lsc__internal__io__end_of_stream T
lsc__internal__io__new_line T
lsc__internal__io__print_byte T
lsc__internal__io__print_index T
lsc__internal__io__print_natural T
lsc__internal__io__print_word32_array T
lsc__internal__io__print_word32 T
lsc__internal__io__print_word64_array T
lsc__internal__io__print_word64 T
lsc__internal__io__put_line T
lsc__internal__io__put T
lsc__internal__io__read_byte T
lsc__internal__math_int_E D 2
lsc__internal__ops32__block_copy T
lsc__internal__ops32__block_xor T
lsc__internal__ops32__byte0 T
lsc__internal__ops32__byte1 T
lsc__internal__ops32__byte2 T
lsc__internal__ops32__byte3 T
lsc__internal__ops32__bytes_to_word T
lsc__internal__ops32__bytex T
lsc__internal__ops32_E D 2
lsc__internal__ops32__xor2 T
lsc__internal__ops32__xor3 T
lsc__internal__ops32__xor4 T
lsc__internal__ops32__xor5 T
lsc__internal__ops64__block_copy T
lsc__internal__ops64__block_xor T
lsc__internal__ops64__bytes_to_word T
lsc__internal__ops64_E D 2
lsc__internal__ops64__xor2 T
lsc__internal__pad32__block_terminate T
lsc__internal__pad32_E D 2
lsc__internal__pad64__block_terminate T
lsc__internal__pad64_E D 2
lsc__internal__ripemd160__context_finalize T
lsc__internal__ripemd160__context_init T
lsc__internal__ripemd160__context_typeIP T
lsc__internal__ripemd160__context_update T
lsc__internal__ripemd160__data_lengthIP T
lsc__internal__ripemd160_E D 2
lsc__internal__ripemd160__get_hash T
lsc__internal__ripemd160__hash_context T
lsc__internal__ripemd160__hash T
lsc__internal__ripemd160__message_typeIP T
lsc__internal__ripemd160__null_block R 64
lsc__internal__ripemd160__null_hash R 20
lsc__internal__ripemd160__print_E D 2
lsc__internal__sha1__add T
lsc__internal__sha1__ch T
lsc__internal__sha1__context_finalize T
lsc__internal__sha1__context_init T
lsc__internal__sha1__context_typeIP T
lsc__internal__sha1__context_update T
lsc__internal__sha1__data_lengthIP T
lsc__internal__sha1_E D 2
lsc__internal__sha1__get_hash T
lsc__internal__sha1__hash_context T
lsc__internal__sha1__hash T
lsc__internal__sha1__init_data_length T
lsc__internal__sha1__k1 R 4
lsc__internal__sha1__k2 R 4
lsc__internal__sha1__k3 R 4
lsc__internal__sha1__k4 R 4
lsc__internal__sha1__maj T
lsc__internal__sha1__message_typeIP T
lsc__internal__sha1__null_block R 64
lsc__internal__sha1__null_hash R 20
lsc__internal__sha1__null_schedule R 320
lsc__internal__sha256__add T
lsc__internal__sha256__cap_sigma_0_256 T
lsc__internal__sha256__cap_sigma_1_256 T
lsc__internal__sha256__ch T
lsc__internal__sha256__context_finalize T
lsc__internal__sha256__context_typeIP T
lsc__internal__sha256__context_update_internal T
lsc__internal__sha256__context_update T
lsc__internal__sha256__data_lengthIP T
lsc__internal__sha256_E D 2
lsc__internal__sha256__hash_context T
lsc__internal__sha256__hash T
lsc__internal__sha256__init_data_length T
lsc__internal__sha256__maj T
lsc__internal__sha256__message_typeIP T
lsc__internal__sha256__null_block R 64
lsc__internal__sha256__null_schedule R 256
lsc__internal__sha256__sha256_context_init T
lsc__internal__sha256__sha256_get_hash T
lsc__internal__sha256__sha256_null_hash R 32
lsc__internal__sha256__sigma_0_256 T
lsc__internal__sha256__sigma_1_256 T
lsc__internal__sha256__tables_E D 2
lsc__internal__sha256__tables__k R 256
lsc__internal__sha512__add T
lsc__internal__sha512__cap_sigma_0_512 T
lsc__internal__sha512__cap_sigma_1_512 T
lsc__internal__sha512__ch T
lsc__internal__sha512__context_finalize T
lsc__internal__sha512__context_typeIP T
lsc__internal__sha512__context_update_internal T
lsc__internal__sha512__context_update T
lsc__internal__sha512__data_lengthIP T
lsc__internal__sha512_E D 2
lsc__internal__sha512__hash_context T
lsc__internal__sha512__init_data_length T
lsc__internal__sha512__maj T
lsc__internal__sha512__message_typeIP T
lsc__internal__sha512__null_block R 128
lsc__internal__sha512__null_schedule R 640
lsc__internal__sha512__null_sha384_hash R 48
lsc__internal__sha512__null_sha512_hash R 64
lsc__internal__sha512__sha384_context_init T
lsc__internal__sha512__sha384_get_hash T
lsc__internal__sha512__sha384_hash T
lsc__internal__sha512__sha512_context_init T
lsc__internal__sha512__sha512_get_hash T
lsc__internal__sha512__sha512_hash T
lsc__internal__sha512__sigma_0_512 T
lsc__internal__sha512__sigma_1_512 T
lsc__internal__sha512__tables_E D 2
lsc__internal__sha512__tables__k R 640
lsc__internal__types__byte_array32_to_word32 T
lsc__internal__types__byte_array64_to_word64 T
lsc__internal__types_E D 2
lsc__internal__types__Tbyte_array32_typeBIP T
lsc__internal__types__Tbyte_array64_typeBIP T
lsc__internal__types__word32_array_typeIP T
lsc__internal__types__word32_to_byte_array32 T
lsc__internal__types__word64_array_typeIP T
lsc__internal__types__word64_to_byte_array64 T
lsc__ops_generic_E D 2
lsc__ripemd160_E D 2
lsc__ripemd160_generic_E D 2
lsc__ripemd160__hash T
lsc__ripemd160__hmac_E D 2
lsc__ripemd160__hmac_generic_E D 2
lsc__ripemd160__hmac__hmac T
lsc__sha1_E D 2
lsc__sha1_generic_E D 2
lsc__sha1__hash T
lsc__sha1__hmac_E D 2
lsc__sha1__hmac_generic_E D 2
lsc__sha1__hmac__hmac T
lsc__sha2_E D 2
lsc__sha2_generic_E D 2
lsc__sha2__hash_sha256 T
lsc__sha2__hash_sha384 T
lsc__sha2__hash_sha512 T
lsc__sha2__hmac_E D 2
lsc__sha2__hmac_generic_E D 2
lsc__sha2__hmac__hmac_sha256 T
lsc__sha2__hmac__hmac_sha384 T
lsc__sha2__hmac__hmac_sha512 T
lsc__types__bytesIP T
lsc__types_E D 2

View File

@ -0,0 +1 @@
d479dc027fefb628996e6b58e864ed91437c955c

View File

@ -0,0 +1,7 @@
LICENSE := BSD
VERSION := git
DOWNLOADS := libsparkcrypto.git
URL(libsparkcrypto) := https://github.com/Componolit/libsparkcrypto.git
DIR(libsparkcrypto) := libsparkcrypto
REV(libsparkcrypto) := ceb57ace3df2b27a7a2f2617c9c4089c4e44e555