From f283ba1938216b9f4c10594ee79166da392cf5e7 Mon Sep 17 00:00:00 2001 From: Skycoder42 Date: Tue, 6 Jun 2023 05:25:11 +0000 Subject: [PATCH] update sodium dependencies --- .github/workflows/sodium_cd.yaml | 1 + packages/sodium/CHANGELOG.md | 11 +- packages/sodium/analysis_options.yaml | 3 +- .../lib/src/ffi/api/helpers/keygen_mixin.dart | 3 +- .../lib/src/ffi/bindings/libsodium.ffi.dart | 1075 +---------------- .../src/ffi/bindings/sodium_allocator.dart | 3 - .../src/ffi/bindings/sodium_finalizer.dart | 2 +- .../lib/src/ffi/bindings/sodium_pointer.dart | 6 - packages/sodium/pubspec.yaml | 72 +- .../integration/cases/aead_test_case.dart | 4 +- .../integration/cases/auth_test_case.dart | 2 +- .../test/integration/cases/box_test_case.dart | 4 +- .../cases/generic_hash_test_case.dart | 2 +- .../test/integration/cases/kdf_test_case.dart | 2 +- .../test/integration/cases/kx_test_case.dart | 2 +- .../integration/cases/pwhash_test_case.dart | 2 +- .../cases/randombytes_test_case.dart | 2 +- .../cases/scalarmult_test_case.dart | 2 +- .../cases/secret_box_test_case.dart | 4 +- .../cases/secret_stream_test_case.dart | 4 +- .../cases/short_hash_test_case.dart | 2 +- .../integration/cases/sign_test_case.dart | 4 +- .../integration/cases/sodium_test_case.dart | 4 +- .../sodium/test/integration/js_sumo_test.dart | 2 +- packages/sodium/test/integration/js_test.dart | 2 +- .../test/integration/js_test_common.dart | 2 +- .../sodium/test/integration/test_runner.dart | 2 +- packages/sodium/test/integration/vm_test.dart | 2 +- .../sodium/test/unit/api/coverage_test.dart | 2 +- .../ffi/bindings/sodium_pointer_test.dart | 25 - .../sodium/test/unit/ffi/coverage_test.dart | 2 +- .../test/unit/ffi/keygen_test_helpers.dart | 3 +- .../test/unit/ffi/pointer_test_helpers.dart | 4 - .../sodium/test/unit/js/coverage_test.dart | 2 +- pubspec.yaml | 7 + 35 files changed, 118 insertions(+), 1153 deletions(-) create mode 100644 pubspec.yaml diff --git a/.github/workflows/sodium_cd.yaml b/.github/workflows/sodium_cd.yaml index d27af509..b0c276e3 100644 --- a/.github/workflows/sodium_cd.yaml +++ b/.github/workflows/sodium_cd.yaml @@ -10,6 +10,7 @@ jobs: name: Publish uses: Skycoder42/dart_test_tools/.github/workflows/publish.yml@main with: + environment: pub-deploy tagPrefix: sodium-v workingDirectory: packages/sodium buildRunner: true diff --git a/packages/sodium/CHANGELOG.md b/packages/sodium/CHANGELOG.md index 11f0cbc3..ef7bd896 100644 --- a/packages/sodium/CHANGELOG.md +++ b/packages/sodium/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.1.1] - 2023-06-06 +### Changed +- Update dependencies +- Update min dart SDK to 3.0.0 + +### Removed +- Remove non libsodium definitions from generated ffi code + ## [2.1.0] - 2023-03-08 ### Added - `SodiumInit.init2` and `SodiumSumoInit.init2` - these methods replace the now deprecated `.init` methods (#24) @@ -130,6 +138,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial stable release +[2.1.1]: https://github.com/Skycoder42/libsodium_dart_bindings/compare/sodium-v2.1.0...sodium-v2.1.1 [2.1.0]: https://github.com/Skycoder42/libsodium_dart_bindings/compare/sodium%2Fv2.0.1...sodium-v2.1.0 [2.0.1]: https://github.com/Skycoder42/libsodium_dart_bindings/compare/sodium%2Fv2.0.0...sodium%2Fv2.0.1 [2.0.0]: https://github.com/Skycoder42/libsodium_dart_bindings/compare/sodium%2Fv1.2.5...sodium%2Fv2.0.0 @@ -145,4 +154,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.1.2]: https://github.com/Skycoder42/libsodium_dart_bindings/compare/sodium%2Fv1.1.1...sodium%2Fv1.1.2 [1.1.1]: https://github.com/Skycoder42/libsodium_dart_bindings/compare/sodium%2Fv1.1.0...sodium%2Fv1.1.1 [1.1.0]: https://github.com/Skycoder42/libsodium_dart_bindings/compare/sodium%2Fv1.0.0...sodium%2Fv1.1.0 -[1.0.0]: https://github.com/Skycoder42/libsodium_dart_bindings/releases/tag/sodium%2Fv1.0.0 +[1.0.0]: https://github.com/Skycoder42/libsodium_dart_bindings/releases/tag/sodium%2Fv1.0.0 \ No newline at end of file diff --git a/packages/sodium/analysis_options.yaml b/packages/sodium/analysis_options.yaml index fd162240..300f673f 100644 --- a/packages/sodium/analysis_options.yaml +++ b/packages/sodium/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:dart_test_tools/analysis_options_package.yaml +include: package:dart_test_tools/package.yaml analyzer: exclude: @@ -10,3 +10,4 @@ linter: rules: comment_references: false avoid_catches_without_on_clauses: false + type_literal_in_constant_pattern: false diff --git a/packages/sodium/lib/src/ffi/api/helpers/keygen_mixin.dart b/packages/sodium/lib/src/ffi/api/helpers/keygen_mixin.dart index 12f5a956..54a7ffd3 100644 --- a/packages/sodium/lib/src/ffi/api/helpers/keygen_mixin.dart +++ b/packages/sodium/lib/src/ffi/api/helpers/keygen_mixin.dart @@ -81,8 +81,7 @@ mixin KeygenMixin { Pointer pk, Pointer sk, Pointer seed, - ) - implementation, + ) implementation, }) { SecureKeyFFI? secretKey; SodiumPointer? publicKeyPtr; diff --git a/packages/sodium/lib/src/ffi/bindings/libsodium.ffi.dart b/packages/sodium/lib/src/ffi/bindings/libsodium.ffi.dart index 99e4d642..34147f02 100644 --- a/packages/sodium/lib/src/ffi/bindings/libsodium.ffi.dart +++ b/packages/sodium/lib/src/ffi/bindings/libsodium.ffi.dart @@ -1,7 +1,9 @@ // AUTO GENERATED FILE, DO NOT EDIT. // // Generated by `package:ffigen`. +// ignore_for_file: type=lint import 'dart:ffi' as ffi; + import 'package:meta/meta.dart'; /// Bindings of libsodium @@ -4472,27 +4474,6 @@ class LibSodiumFFI { ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer> _stdin = - _lookup>('stdin'); - - ffi.Pointer get stdin => _stdin.value; - - set stdin(ffi.Pointer value) => _stdin.value = value; - - late final ffi.Pointer> _stdout = - _lookup>('stdout'); - - ffi.Pointer get stdout => _stdout.value; - - set stdout(ffi.Pointer value) => _stdout.value = value; - - late final ffi.Pointer> _stderr = - _lookup>('stderr'); - - ffi.Pointer get stderr => _stderr.value; - - set stderr(ffi.Pointer value) => _stderr.value = value; - int crypto_onetimeauth_poly1305_statebytes() { return _crypto_onetimeauth_poly1305_statebytes(); } @@ -10991,308 +10972,14 @@ class LibSodiumFFI { .asFunction)>(); } -class max_align_t extends ffi.Opaque {} - -class __fsid_t extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array __val; -} - -class crypto_aead_aes256gcm_state_ extends ffi.Struct { +final class crypto_aead_aes256gcm_state_ extends ffi.Struct { @ffi.Array.multi([512]) external ffi.Array opaque; } typedef crypto_aead_aes256gcm_state = crypto_aead_aes256gcm_state_; -class div_t extends ffi.Struct { - @ffi.Int() - external int quot; - - @ffi.Int() - external int rem; -} - -class ldiv_t extends ffi.Struct { - @ffi.Long() - external int quot; - - @ffi.Long() - external int rem; -} - -class lldiv_t extends ffi.Struct { - @ffi.LongLong() - external int quot; - - @ffi.LongLong() - external int rem; -} - -class __sigset_t extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array __val; -} - -class timeval extends ffi.Struct { - @__time_t() - external int tv_sec; - - @__suseconds_t() - external int tv_usec; -} - -typedef __time_t = ffi.Long; -typedef __suseconds_t = ffi.Long; - -class timespec extends ffi.Struct { - @__time_t() - external int tv_sec; - - @__syscall_slong_t() - external int tv_nsec; -} - -typedef __syscall_slong_t = ffi.Long; - -class fd_set extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array<__fd_mask> __fds_bits; -} - -typedef __fd_mask = ffi.Long; - -class __atomic_wide_counter extends ffi.Union { - @ffi.UnsignedLongLong() - external int __value64; - - external UnnamedStruct1 __value32; -} - -class UnnamedStruct1 extends ffi.Struct { - @ffi.UnsignedInt() - external int __low; - - @ffi.UnsignedInt() - external int __high; -} - -class __pthread_internal_list extends ffi.Struct { - external ffi.Pointer<__pthread_internal_list> __prev; - - external ffi.Pointer<__pthread_internal_list> __next; -} - -class __pthread_internal_slist extends ffi.Struct { - external ffi.Pointer<__pthread_internal_slist> __next; -} - -class __pthread_mutex_s extends ffi.Struct { - @ffi.Int() - external int __lock; - - @ffi.UnsignedInt() - external int __count; - - @ffi.Int() - external int __owner; - - @ffi.UnsignedInt() - external int __nusers; - - @ffi.Int() - external int __kind; - - @ffi.Short() - external int __spins; - - @ffi.Short() - external int __elision; - - external __pthread_list_t __list; -} - -typedef __pthread_list_t = __pthread_internal_list; - -class __pthread_rwlock_arch_t extends ffi.Struct { - @ffi.UnsignedInt() - external int __readers; - - @ffi.UnsignedInt() - external int __writers; - - @ffi.UnsignedInt() - external int __wrphase_futex; - - @ffi.UnsignedInt() - external int __writers_futex; - - @ffi.UnsignedInt() - external int __pad3; - - @ffi.UnsignedInt() - external int __pad4; - - @ffi.Int() - external int __cur_writer; - - @ffi.Int() - external int __shared; - - @ffi.SignedChar() - external int __rwelision; - - @ffi.Array.multi([7]) - external ffi.Array __pad1; - - @ffi.UnsignedLong() - external int __pad2; - - @ffi.UnsignedInt() - external int __flags; -} - -class __pthread_cond_s extends ffi.Struct { - external __atomic_wide_counter __wseq; - - external __atomic_wide_counter __g1_start; - - @ffi.Array.multi([2]) - external ffi.Array __g_refs; - - @ffi.Array.multi([2]) - external ffi.Array __g_size; - - @ffi.UnsignedInt() - external int __g1_orig_size; - - @ffi.UnsignedInt() - external int __wrefs; - - @ffi.Array.multi([2]) - external ffi.Array __g_signals; -} - -class __once_flag extends ffi.Struct { - @ffi.Int() - external int __data; -} - -class pthread_mutexattr_t extends ffi.Union { - @ffi.Array.multi([4]) - external ffi.Array __size; - - @ffi.Int() - external int __align; -} - -class pthread_condattr_t extends ffi.Union { - @ffi.Array.multi([4]) - external ffi.Array __size; - - @ffi.Int() - external int __align; -} - -class pthread_attr_t extends ffi.Union { - @ffi.Array.multi([56]) - external ffi.Array __size; - - @ffi.Long() - external int __align; -} - -class pthread_mutex_t extends ffi.Union { - external __pthread_mutex_s __data; - - @ffi.Array.multi([40]) - external ffi.Array __size; - - @ffi.Long() - external int __align; -} - -class pthread_cond_t extends ffi.Union { - external __pthread_cond_s __data; - - @ffi.Array.multi([48]) - external ffi.Array __size; - - @ffi.LongLong() - external int __align; -} - -class pthread_rwlock_t extends ffi.Union { - external __pthread_rwlock_arch_t __data; - - @ffi.Array.multi([56]) - external ffi.Array __size; - - @ffi.Long() - external int __align; -} - -class pthread_rwlockattr_t extends ffi.Union { - @ffi.Array.multi([8]) - external ffi.Array __size; - - @ffi.Long() - external int __align; -} - -class pthread_barrier_t extends ffi.Union { - @ffi.Array.multi([32]) - external ffi.Array __size; - - @ffi.Long() - external int __align; -} - -class pthread_barrierattr_t extends ffi.Union { - @ffi.Array.multi([4]) - external ffi.Array __size; - - @ffi.Int() - external int __align; -} - -class random_data extends ffi.Struct { - external ffi.Pointer fptr; - - external ffi.Pointer rptr; - - external ffi.Pointer state; - - @ffi.Int() - external int rand_type; - - @ffi.Int() - external int rand_deg; - - @ffi.Int() - external int rand_sep; - - external ffi.Pointer end_ptr; -} - -class drand48_data extends ffi.Struct { - @ffi.Array.multi([3]) - external ffi.Array __x; - - @ffi.Array.multi([3]) - external ffi.Array __old_x; - - @ffi.UnsignedShort() - external int __c; - - @ffi.UnsignedShort() - external int __init; - - @ffi.UnsignedLongLong() - external int __a; -} - -class crypto_hash_sha512_state extends ffi.Struct { +final class crypto_hash_sha512_state extends ffi.Struct { @ffi.Array.multi([8]) external ffi.Array state; @@ -11303,7 +10990,7 @@ class crypto_hash_sha512_state extends ffi.Struct { external ffi.Array buf; } -class crypto_auth_hmacsha512_state extends ffi.Struct { +final class crypto_auth_hmacsha512_state extends ffi.Struct { external crypto_hash_sha512_state ictx; external crypto_hash_sha512_state octx; @@ -11311,7 +10998,7 @@ class crypto_auth_hmacsha512_state extends ffi.Struct { typedef crypto_auth_hmacsha512256_state = crypto_auth_hmacsha512_state; -class crypto_hash_sha256_state extends ffi.Struct { +final class crypto_hash_sha256_state extends ffi.Struct { @ffi.Array.multi([8]) external ffi.Array state; @@ -11322,141 +11009,27 @@ class crypto_hash_sha256_state extends ffi.Struct { external ffi.Array buf; } -class crypto_auth_hmacsha256_state extends ffi.Struct { +final class crypto_auth_hmacsha256_state extends ffi.Struct { external crypto_hash_sha256_state ictx; external crypto_hash_sha256_state octx; } -class crypto_generichash_blake2b_state extends ffi.Struct { +final class crypto_generichash_blake2b_state extends ffi.Struct { @ffi.Array.multi([384]) external ffi.Array opaque; } typedef crypto_generichash_state = crypto_generichash_blake2b_state; -class __mbstate_t extends ffi.Struct { - @ffi.Int() - external int __count; - - external UnnamedUnion1 __value; -} - -class UnnamedUnion1 extends ffi.Union { - @ffi.UnsignedInt() - external int __wch; - - @ffi.Array.multi([4]) - external ffi.Array __wchb; -} - -class _G_fpos_t extends ffi.Struct { - @__off_t() - external int __pos; - - external __mbstate_t __state; -} - -typedef __off_t = ffi.Long; - -class _G_fpos64_t extends ffi.Struct { - @__off64_t() - external int __pos; - - external __mbstate_t __state; -} - -typedef __off64_t = ffi.Long; - -class _IO_FILE extends ffi.Struct { - @ffi.Int() - external int _flags; - - external ffi.Pointer _IO_read_ptr; - - external ffi.Pointer _IO_read_end; - - external ffi.Pointer _IO_read_base; - - external ffi.Pointer _IO_write_base; - - external ffi.Pointer _IO_write_ptr; - - external ffi.Pointer _IO_write_end; - - external ffi.Pointer _IO_buf_base; - - external ffi.Pointer _IO_buf_end; - - external ffi.Pointer _IO_save_base; - - external ffi.Pointer _IO_backup_base; - - external ffi.Pointer _IO_save_end; - - external ffi.Pointer<_IO_marker> _markers; - - external ffi.Pointer<_IO_FILE> _chain; - - @ffi.Int() - external int _fileno; - - @ffi.Int() - external int _flags2; - - @__off_t() - external int _old_offset; - - @ffi.UnsignedShort() - external int _cur_column; - - @ffi.SignedChar() - external int _vtable_offset; - - @ffi.Array.multi([1]) - external ffi.Array _shortbuf; - - external ffi.Pointer<_IO_lock_t> _lock; - - @__off64_t() - external int _offset; - - external ffi.Pointer<_IO_codecvt> _codecvt; - - external ffi.Pointer<_IO_wide_data> _wide_data; - - external ffi.Pointer<_IO_FILE> _freeres_list; - - external ffi.Pointer _freeres_buf; - - @ffi.Size() - external int __pad5; - - @ffi.Int() - external int _mode; - - @ffi.Array.multi([20]) - external ffi.Array _unused2; -} - -class _IO_marker extends ffi.Opaque {} - -typedef _IO_lock_t = ffi.Void; - -class _IO_codecvt extends ffi.Opaque {} - -class _IO_wide_data extends ffi.Opaque {} - -typedef FILE = _IO_FILE; - -class crypto_onetimeauth_poly1305_state extends ffi.Struct { +final class crypto_onetimeauth_poly1305_state extends ffi.Struct { @ffi.Array.multi([256]) external ffi.Array opaque; } typedef crypto_onetimeauth_state = crypto_onetimeauth_poly1305_state; -class crypto_secretstream_xchacha20poly1305_state extends ffi.Struct { +final class crypto_secretstream_xchacha20poly1305_state extends ffi.Struct { @ffi.Array.multi([32]) external ffi.Array k; @@ -11467,13 +11040,13 @@ class crypto_secretstream_xchacha20poly1305_state extends ffi.Struct { external ffi.Array _pad; } -class crypto_sign_ed25519ph_state extends ffi.Struct { +final class crypto_sign_ed25519ph_state extends ffi.Struct { external crypto_hash_sha512_state hs; } typedef crypto_sign_state = crypto_sign_ed25519ph_state; -class randombytes_implementation extends ffi.Struct { +final class randombytes_implementation extends ffi.Struct { external ffi.Pointer Function()>> implementation_name; @@ -11481,428 +11054,16 @@ class randombytes_implementation extends ffi.Struct { external ffi.Pointer> stir; - external ffi.Pointer> - uniform; + external ffi.Pointer< + ffi.NativeFunction> uniform; external ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Size)>> buf; + ffi.Void Function(ffi.Pointer buf, ffi.Size size)>> buf; external ffi.Pointer> close; } -const int NULL = 0; - -const int _STDINT_H = 1; - -const int _FEATURES_H = 1; - -const int _DEFAULT_SOURCE = 1; - -const int __GLIBC_USE_ISOC2X = 1; - -const int __USE_ISOC11 = 1; - -const int __USE_ISOC99 = 1; - -const int __USE_ISOC95 = 1; - -const int _POSIX_SOURCE = 1; - -const int _POSIX_C_SOURCE = 200809; - -const int __USE_POSIX = 1; - -const int __USE_POSIX2 = 1; - -const int __USE_POSIX199309 = 1; - -const int __USE_POSIX199506 = 1; - -const int __USE_XOPEN2K = 1; - -const int __USE_XOPEN2K8 = 1; - -const int _ATFILE_SOURCE = 1; - -const int __WORDSIZE = 64; - -const int __WORDSIZE_TIME64_COMPAT32 = 1; - -const int __SYSCALL_WORDSIZE = 64; - -const int __TIMESIZE = 64; - -const int __USE_MISC = 1; - -const int __USE_ATFILE = 1; - -const int __USE_FORTIFY_LEVEL = 0; - -const int __GLIBC_USE_DEPRECATED_GETS = 0; - -const int __GLIBC_USE_DEPRECATED_SCANF = 0; - -const int _STDC_PREDEF_H = 1; - -const int __STDC_IEC_559__ = 1; - -const int __STDC_IEC_60559_BFP__ = 201404; - -const int __STDC_IEC_559_COMPLEX__ = 1; - -const int __STDC_IEC_60559_COMPLEX__ = 201404; - -const int __STDC_ISO_10646__ = 201706; - -const int __GNU_LIBRARY__ = 6; - -const int __GLIBC__ = 2; - -const int __GLIBC_MINOR__ = 37; - -const int _SYS_CDEFS_H = 1; - -const int __THROW = 1; - -const int __THROWNL = 1; - -const int __glibc_c99_flexarr_available = 1; - -const int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = 0; - -const int __HAVE_GENERIC_SELECTION = 0; - -const int __GLIBC_USE_LIB_EXT2 = 1; - -const int __GLIBC_USE_IEC_60559_BFP_EXT = 1; - -const int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = 1; - -const int __GLIBC_USE_IEC_60559_EXT = 1; - -const int __GLIBC_USE_IEC_60559_FUNCS_EXT = 1; - -const int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = 1; - -const int __GLIBC_USE_IEC_60559_TYPES_EXT = 1; - -const int _BITS_TYPES_H = 1; - -const int _BITS_TYPESIZES_H = 1; - -const int __OFF_T_MATCHES_OFF64_T = 1; - -const int __INO_T_MATCHES_INO64_T = 1; - -const int __RLIM_T_MATCHES_RLIM64_T = 1; - -const int __STATFS_MATCHES_STATFS64 = 1; - -const int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = 1; - -const int __FD_SETSIZE = 1024; - -const int _BITS_TIME64_H = 1; - -const int _BITS_WCHAR_H = 1; - -const int __WCHAR_MAX = 2147483647; - -const int __WCHAR_MIN = -2147483648; - -const int _BITS_STDINT_INTN_H = 1; - -const int _BITS_STDINT_UINTN_H = 1; - -const int INT8_MIN = -128; - -const int INT16_MIN = -32768; - -const int INT32_MIN = -2147483648; - -const int INT64_MIN = -9223372036854775808; - -const int INT8_MAX = 127; - -const int INT16_MAX = 32767; - -const int INT32_MAX = 2147483647; - -const int INT64_MAX = 9223372036854775807; - -const int UINT8_MAX = 255; - -const int UINT16_MAX = 65535; - -const int UINT32_MAX = 4294967295; - -const int UINT64_MAX = -1; - -const int INT_LEAST8_MIN = -128; - -const int INT_LEAST16_MIN = -32768; - -const int INT_LEAST32_MIN = -2147483648; - -const int INT_LEAST64_MIN = -9223372036854775808; - -const int INT_LEAST8_MAX = 127; - -const int INT_LEAST16_MAX = 32767; - -const int INT_LEAST32_MAX = 2147483647; - -const int INT_LEAST64_MAX = 9223372036854775807; - -const int UINT_LEAST8_MAX = 255; - -const int UINT_LEAST16_MAX = 65535; - -const int UINT_LEAST32_MAX = 4294967295; - -const int UINT_LEAST64_MAX = -1; - -const int INT_FAST8_MIN = -128; - -const int INT_FAST16_MIN = -9223372036854775808; - -const int INT_FAST32_MIN = -9223372036854775808; - -const int INT_FAST64_MIN = -9223372036854775808; - -const int INT_FAST8_MAX = 127; - -const int INT_FAST16_MAX = 9223372036854775807; - -const int INT_FAST32_MAX = 9223372036854775807; - -const int INT_FAST64_MAX = 9223372036854775807; - -const int UINT_FAST8_MAX = 255; - -const int UINT_FAST16_MAX = -1; - -const int UINT_FAST32_MAX = -1; - -const int UINT_FAST64_MAX = -1; - -const int INTPTR_MIN = -9223372036854775808; - -const int INTPTR_MAX = 9223372036854775807; - -const int UINTPTR_MAX = -1; - -const int INTMAX_MIN = -9223372036854775808; - -const int INTMAX_MAX = 9223372036854775807; - -const int UINTMAX_MAX = -1; - -const int PTRDIFF_MIN = -9223372036854775808; - -const int PTRDIFF_MAX = 9223372036854775807; - -const int SIG_ATOMIC_MIN = -2147483648; - -const int SIG_ATOMIC_MAX = 2147483647; - -const int SIZE_MAX = -1; - -const int WCHAR_MIN = -2147483648; - -const int WCHAR_MAX = 2147483647; - -const int WINT_MIN = 0; - -const int WINT_MAX = 4294967295; - -const int _LIBC_LIMITS_H_ = 1; - -const int MB_LEN_MAX = 16; - -const int LLONG_MIN = -9223372036854775808; - -const int LLONG_MAX = 9223372036854775807; - -const int ULLONG_MAX = -1; - -const int _BITS_POSIX1_LIM_H = 1; - -const int _POSIX_AIO_LISTIO_MAX = 2; - -const int _POSIX_AIO_MAX = 1; - -const int _POSIX_ARG_MAX = 4096; - -const int _POSIX_CHILD_MAX = 25; - -const int _POSIX_DELAYTIMER_MAX = 32; - -const int _POSIX_HOST_NAME_MAX = 255; - -const int _POSIX_LINK_MAX = 8; - -const int _POSIX_LOGIN_NAME_MAX = 9; - -const int _POSIX_MAX_CANON = 255; - -const int _POSIX_MAX_INPUT = 255; - -const int _POSIX_MQ_OPEN_MAX = 8; - -const int _POSIX_MQ_PRIO_MAX = 32; - -const int _POSIX_NAME_MAX = 14; - -const int _POSIX_NGROUPS_MAX = 8; - -const int _POSIX_OPEN_MAX = 20; - -const int _POSIX_PATH_MAX = 256; - -const int _POSIX_PIPE_BUF = 512; - -const int _POSIX_RE_DUP_MAX = 255; - -const int _POSIX_RTSIG_MAX = 8; - -const int _POSIX_SEM_NSEMS_MAX = 256; - -const int _POSIX_SEM_VALUE_MAX = 32767; - -const int _POSIX_SIGQUEUE_MAX = 32; - -const int _POSIX_SSIZE_MAX = 32767; - -const int _POSIX_STREAM_MAX = 8; - -const int _POSIX_SYMLINK_MAX = 255; - -const int _POSIX_SYMLOOP_MAX = 8; - -const int _POSIX_TIMER_MAX = 32; - -const int _POSIX_TTY_NAME_MAX = 9; - -const int _POSIX_TZNAME_MAX = 6; - -const int _POSIX_CLOCKRES_MIN = 20000000; - -const int NGROUPS_MAX = 65536; - -const int MAX_CANON = 255; - -const int MAX_INPUT = 255; - -const int NAME_MAX = 255; - -const int PATH_MAX = 4096; - -const int PIPE_BUF = 4096; - -const int XATTR_NAME_MAX = 255; - -const int XATTR_SIZE_MAX = 65536; - -const int XATTR_LIST_MAX = 65536; - -const int RTSIG_MAX = 32; - -const int _POSIX_THREAD_KEYS_MAX = 128; - -const int PTHREAD_KEYS_MAX = 1024; - -const int _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4; - -const int PTHREAD_DESTRUCTOR_ITERATIONS = 4; - -const int _POSIX_THREAD_THREADS_MAX = 64; - -const int AIO_PRIO_DELTA_MAX = 20; - -const int DELAYTIMER_MAX = 2147483647; - -const int TTY_NAME_MAX = 32; - -const int LOGIN_NAME_MAX = 256; - -const int HOST_NAME_MAX = 64; - -const int MQ_PRIO_MAX = 32768; - -const int SEM_VALUE_MAX = 2147483647; - -const int SSIZE_MAX = 9223372036854775807; - -const int _BITS_POSIX2_LIM_H = 1; - -const int _POSIX2_BC_BASE_MAX = 99; - -const int _POSIX2_BC_DIM_MAX = 2048; - -const int _POSIX2_BC_SCALE_MAX = 99; - -const int _POSIX2_BC_STRING_MAX = 1000; - -const int _POSIX2_COLL_WEIGHTS_MAX = 2; - -const int _POSIX2_EXPR_NEST_MAX = 32; - -const int _POSIX2_LINE_MAX = 2048; - -const int _POSIX2_RE_DUP_MAX = 255; - -const int _POSIX2_CHARCLASS_NAME_MAX = 14; - -const int BC_BASE_MAX = 99; - -const int BC_DIM_MAX = 2048; - -const int BC_SCALE_MAX = 99; - -const int BC_STRING_MAX = 1000; - -const int COLL_WEIGHTS_MAX = 255; - -const int EXPR_NEST_MAX = 32; - -const int LINE_MAX = 2048; - -const int CHARCLASS_NAME_MAX = 2048; - -const int RE_DUP_MAX = 32767; - -const int SCHAR_MAX = 127; - -const int SHRT_MAX = 32767; - -const int INT_MAX = 2147483647; - -const int LONG_MAX = 9223372036854775807; - -const int SCHAR_MIN = -128; - -const int SHRT_MIN = -32768; - -const int INT_MIN = -2147483648; - -const int LONG_MIN = -9223372036854775808; - -const int UCHAR_MAX = 255; - -const int USHRT_MAX = 65535; - -const int UINT_MAX = 4294967295; - -const int ULONG_MAX = -1; - -const int CHAR_BIT = 8; - -const int CHAR_MIN = -128; - -const int CHAR_MAX = 127; - const int SODIUM_SIZE_MAX = -1; const String SODIUM_VERSION_STRING = '1.0.18'; @@ -11971,160 +11132,6 @@ const int crypto_aead_xchacha20poly1305_IETF_ABYTES = 16; const int crypto_aead_xchacha20poly1305_IETF_MESSAGEBYTES_MAX = -17; -const int _STDLIB_H = 1; - -const int WNOHANG = 1; - -const int WUNTRACED = 2; - -const int WSTOPPED = 2; - -const int WEXITED = 4; - -const int WCONTINUED = 8; - -const int WNOWAIT = 16777216; - -const int __WNOTHREAD = 536870912; - -const int __WALL = 1073741824; - -const int __WCLONE = 2147483648; - -const int __W_CONTINUED = 65535; - -const int __WCOREFLAG = 128; - -const int __HAVE_FLOAT128 = 0; - -const int __HAVE_DISTINCT_FLOAT128 = 0; - -const int __HAVE_FLOAT64X = 1; - -const int __HAVE_FLOAT64X_LONG_DOUBLE = 1; - -const int __HAVE_FLOAT16 = 0; - -const int __HAVE_FLOAT32 = 1; - -const int __HAVE_FLOAT64 = 1; - -const int __HAVE_FLOAT32X = 1; - -const int __HAVE_FLOAT128X = 0; - -const int __HAVE_DISTINCT_FLOAT16 = 0; - -const int __HAVE_DISTINCT_FLOAT32 = 0; - -const int __HAVE_DISTINCT_FLOAT64 = 0; - -const int __HAVE_DISTINCT_FLOAT32X = 0; - -const int __HAVE_DISTINCT_FLOAT64X = 0; - -const int __HAVE_DISTINCT_FLOAT128X = 0; - -const int __HAVE_FLOAT128_UNLIKE_LDBL = 0; - -const int __HAVE_FLOATN_NOT_TYPEDEF = 0; - -const int __ldiv_t_defined = 1; - -const int __lldiv_t_defined = 1; - -const int RAND_MAX = 2147483647; - -const int EXIT_FAILURE = 1; - -const int EXIT_SUCCESS = 0; - -const int _SYS_TYPES_H = 1; - -const int __clock_t_defined = 1; - -const int __clockid_t_defined = 1; - -const int __time_t_defined = 1; - -const int __timer_t_defined = 1; - -const int __BIT_TYPES_DEFINED__ = 1; - -const int _ENDIAN_H = 1; - -const int _BITS_ENDIAN_H = 1; - -const int __LITTLE_ENDIAN = 1234; - -const int __BIG_ENDIAN = 4321; - -const int __PDP_ENDIAN = 3412; - -const int _BITS_ENDIANNESS_H = 1; - -const int __BYTE_ORDER = 1234; - -const int __FLOAT_WORD_ORDER = 1234; - -const int LITTLE_ENDIAN = 1234; - -const int BIG_ENDIAN = 4321; - -const int PDP_ENDIAN = 3412; - -const int BYTE_ORDER = 1234; - -const int _BITS_BYTESWAP_H = 1; - -const int _BITS_UINTN_IDENTITY_H = 1; - -const int _SYS_SELECT_H = 1; - -const int __sigset_t_defined = 1; - -const int _SIGSET_NWORDS = 16; - -const int __timeval_defined = 1; - -const int _STRUCT_TIMESPEC = 1; - -const int FD_SETSIZE = 1024; - -const int _BITS_PTHREADTYPES_COMMON_H = 1; - -const int _THREAD_SHARED_TYPES_H = 1; - -const int _BITS_PTHREADTYPES_ARCH_H = 1; - -const int __SIZEOF_PTHREAD_MUTEX_T = 40; - -const int __SIZEOF_PTHREAD_ATTR_T = 56; - -const int __SIZEOF_PTHREAD_RWLOCK_T = 56; - -const int __SIZEOF_PTHREAD_BARRIER_T = 32; - -const int __SIZEOF_PTHREAD_MUTEXATTR_T = 4; - -const int __SIZEOF_PTHREAD_COND_T = 48; - -const int __SIZEOF_PTHREAD_CONDATTR_T = 4; - -const int __SIZEOF_PTHREAD_RWLOCKATTR_T = 8; - -const int __SIZEOF_PTHREAD_BARRIERATTR_T = 4; - -const int _THREAD_MUTEX_INTERNAL_H = 1; - -const int __PTHREAD_MUTEX_HAVE_PREV = 1; - -const int __PTHREAD_RWLOCK_ELISION_EXTRA = 0; - -const int __have_pthread_attr_t = 1; - -const int _ALLOCA_H = 1; - const int crypto_hash_sha512_BYTES = 64; const int crypto_auth_hmacsha512_BYTES = 64; @@ -12295,58 +11302,6 @@ const int crypto_kx_SESSIONKEYBYTES = 32; const String crypto_kx_PRIMITIVE = 'x25519blake2b'; -const int _STDIO_H = 1; - -const int __GNUC_VA_LIST = 1; - -const int _____fpos_t_defined = 1; - -const int ____mbstate_t_defined = 1; - -const int _____fpos64_t_defined = 1; - -const int ____FILE_defined = 1; - -const int __FILE_defined = 1; - -const int __struct_FILE_defined = 1; - -const int _IO_EOF_SEEN = 16; - -const int _IO_ERR_SEEN = 32; - -const int _IO_USER_LOCK = 32768; - -const int _IOFBF = 0; - -const int _IOLBF = 1; - -const int _IONBF = 2; - -const int BUFSIZ = 8192; - -const int EOF = -1; - -const int SEEK_SET = 0; - -const int SEEK_CUR = 1; - -const int SEEK_END = 2; - -const String P_tmpdir = '/tmp'; - -const int _BITS_STDIO_LIM_H = 1; - -const int L_tmpnam = 20; - -const int TMP_MAX = 238328; - -const int FILENAME_MAX = 4096; - -const int L_ctermid = 9; - -const int FOPEN_MAX = 16; - const int crypto_onetimeauth_poly1305_BYTES = 16; const int crypto_onetimeauth_poly1305_KEYBYTES = 32; diff --git a/packages/sodium/lib/src/ffi/bindings/sodium_allocator.dart b/packages/sodium/lib/src/ffi/bindings/sodium_allocator.dart index c65338bf..c0d3bbfd 100644 --- a/packages/sodium/lib/src/ffi/bindings/sodium_allocator.dart +++ b/packages/sodium/lib/src/ffi/bindings/sodium_allocator.dart @@ -66,13 +66,10 @@ class SodiumAllocator implements Allocator { switch (memoryProtection) { case MemoryProtection.noAccess: result = sodium.sodium_mprotect_noaccess(pointer.cast()); - break; case MemoryProtection.readOnly: result = sodium.sodium_mprotect_readonly(pointer.cast()); - break; case MemoryProtection.readWrite: result = sodium.sodium_mprotect_readwrite(pointer.cast()); - break; } return result == 0; } diff --git a/packages/sodium/lib/src/ffi/bindings/sodium_finalizer.dart b/packages/sodium/lib/src/ffi/bindings/sodium_finalizer.dart index f9880011..b2ca39e7 100644 --- a/packages/sodium/lib/src/ffi/bindings/sodium_finalizer.dart +++ b/packages/sodium/lib/src/ffi/bindings/sodium_finalizer.dart @@ -4,7 +4,7 @@ import 'dart:ffi'; import 'package:meta/meta.dart'; -import '../../../sodium.ffi.dart'; +import 'libsodium.ffi.dart'; /// @nodoc @internal diff --git a/packages/sodium/lib/src/ffi/bindings/sodium_pointer.dart b/packages/sodium/lib/src/ffi/bindings/sodium_pointer.dart index d23cbef3..3f5b5c5e 100644 --- a/packages/sodium/lib/src/ffi/bindings/sodium_pointer.dart +++ b/packages/sodium/lib/src/ffi/bindings/sodium_pointer.dart @@ -190,13 +190,10 @@ class SodiumPointer implements Finalizable { switch (memoryProtection) { case MemoryProtection.noAccess: result = sodium.sodium_mprotect_noaccess(ptr.cast()); - break; case MemoryProtection.readOnly: result = sodium.sodium_mprotect_readonly(ptr.cast()); - break; case MemoryProtection.readWrite: result = sodium.sodium_mprotect_readwrite(ptr.cast()); - break; } SodiumException.checkSucceededInt(result); @@ -285,7 +282,6 @@ class SodiumPointer implements Finalizable { } else if (elementSize <= sizeOf()) { return ptr.cast().asTypedList(count) as List; } - break; case _Signage.unsigned: if (elementSize <= sizeOf()) { return ptr.cast().asTypedList(count) as List; @@ -296,14 +292,12 @@ class SodiumPointer implements Finalizable { } else if (elementSize <= sizeOf()) { return ptr.cast().asTypedList(count) as List; } - break; case _Signage.float: if (elementSize <= sizeOf()) { return ptr.cast().asTypedList(count) as List; } else if (elementSize <= sizeOf()) { return ptr.cast().asTypedList(count) as List; } - break; } // coverage:ignore-start diff --git a/packages/sodium/pubspec.yaml b/packages/sodium/pubspec.yaml index 6384555c..60d6a74e 100644 --- a/packages/sodium/pubspec.yaml +++ b/packages/sodium/pubspec.yaml @@ -1,30 +1,31 @@ name: sodium description: Dart bindings for libsodium, for the Dart-VM and for the Web -version: 2.1.0 +version: 2.1.1 homepage: https://github.com/Skycoder42/libsodium_dart_bindings environment: - sdk: ">=2.19.0 <3.0.0" + sdk: ^3.0.0 dependencies: - ffi: ^2.0.1 + ffi: ^2.0.2 freezed_annotation: ^2.2.0 - js: ^0.6.5 - meta: ^1.8.0 + js: ^0.6.7 + meta: ^1.9.1 dev_dependencies: - args: ^2.4.0 - build_runner: ^2.3.3 - cider: ^0.1.4 - collection: ^1.17.1 + args: ^2.4.2 + build_runner: ^2.4.4 + cider: ^0.1.5 + collection: ^1.17.2 coverage: ^1.6.3 - dart_pre_commit: ^4.1.0 - dart_test_tools: ^4.8.0 - ffigen: ^7.2.7 - freezed: ^2.3.2 + custom_lint: ^0.4.0 + dart_pre_commit: ^5.1.0+1 + dart_test_tools: ^5.1.1 + ffigen: ^8.0.2 + freezed: ^2.3.5 mocktail: ^0.3.0 path: ^1.8.3 - test: ^1.23.1 + test: ^1.24.3 tuple: ^2.0.1 ffigen: @@ -36,18 +37,49 @@ ffigen: - "/usr/include/sodium.h" compiler-opts: - "-I/usr/lib/clang/15.0.7/include/" + macros: + include: + - SODIUM_.* + - CRYPTO_.* + - RANDOMBYTES_.* + - sodium_.* + - crypto_.* + - randombytes_.* + globals: + include: + - SODIUM_.* + - CRYPTO_.* + - RANDOMBYTES_.* + - sodium_.* + - crypto_.* + - randombytes_.* + enums: + include: + - SODIUM_.* + - CRYPTO_.* + - RANDOMBYTES_.* + - sodium_.* + - crypto_.* + - randombytes_.* + unnamed-enums: + exclude: + - .* + structs: + include: + - sodium.* + - crypto.* + - randombytes.* + unions: + include: + - sodium.* + - crypto.* + - randombytes.* functions: include: - sodium.* - crypto.* - randombytes.* -dart_pre_commit: - pull-up-dependencies: - allowed: - - js - - meta - cider: link_template: tag: https://github.com/Skycoder42/libsodium_dart_bindings/releases/tag/sodium-v%tag% diff --git a/packages/sodium/test/integration/cases/aead_test_case.dart b/packages/sodium/test/integration/cases/aead_test_case.dart index 054bb445..0218d3c7 100644 --- a/packages/sodium/test/integration/cases/aead_test_case.dart +++ b/packages/sodium/test/integration/cases/aead_test_case.dart @@ -1,12 +1,12 @@ import 'dart:typed_data'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.dart'; import '../test_case.dart'; class AeadTestCase extends TestCase { - AeadTestCase(super.runner); + AeadTestCase(super._runner); @override String get name => 'aead'; diff --git a/packages/sodium/test/integration/cases/auth_test_case.dart b/packages/sodium/test/integration/cases/auth_test_case.dart index 6ce6dc58..ff9297e7 100644 --- a/packages/sodium/test/integration/cases/auth_test_case.dart +++ b/packages/sodium/test/integration/cases/auth_test_case.dart @@ -3,7 +3,7 @@ import 'dart:typed_data'; import '../test_case.dart'; class AuthTestCase extends TestCase { - AuthTestCase(super.runner); + AuthTestCase(super._runner); @override String get name => 'auth'; diff --git a/packages/sodium/test/integration/cases/box_test_case.dart b/packages/sodium/test/integration/cases/box_test_case.dart index 70c20aca..75d789c4 100644 --- a/packages/sodium/test/integration/cases/box_test_case.dart +++ b/packages/sodium/test/integration/cases/box_test_case.dart @@ -1,12 +1,12 @@ import 'dart:typed_data'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.dart'; import '../test_case.dart'; class BoxTestCase extends TestCase { - BoxTestCase(super.runner); + BoxTestCase(super._runner); @override String get name => 'box'; diff --git a/packages/sodium/test/integration/cases/generic_hash_test_case.dart b/packages/sodium/test/integration/cases/generic_hash_test_case.dart index 534522a9..9c546532 100644 --- a/packages/sodium/test/integration/cases/generic_hash_test_case.dart +++ b/packages/sodium/test/integration/cases/generic_hash_test_case.dart @@ -3,7 +3,7 @@ import 'dart:typed_data'; import '../test_case.dart'; class GenericHashTestCase extends TestCase { - GenericHashTestCase(super.runner); + GenericHashTestCase(super._runner); @override String get name => 'generichash'; diff --git a/packages/sodium/test/integration/cases/kdf_test_case.dart b/packages/sodium/test/integration/cases/kdf_test_case.dart index e02af798..aaa40c95 100644 --- a/packages/sodium/test/integration/cases/kdf_test_case.dart +++ b/packages/sodium/test/integration/cases/kdf_test_case.dart @@ -1,7 +1,7 @@ import '../test_case.dart'; class KdfTestCase extends TestCase { - KdfTestCase(super.runner); + KdfTestCase(super._runner); @override String get name => 'kdf'; diff --git a/packages/sodium/test/integration/cases/kx_test_case.dart b/packages/sodium/test/integration/cases/kx_test_case.dart index 27cd76cc..399f1841 100644 --- a/packages/sodium/test/integration/cases/kx_test_case.dart +++ b/packages/sodium/test/integration/cases/kx_test_case.dart @@ -1,7 +1,7 @@ import '../test_case.dart'; class KxTestCase extends TestCase { - KxTestCase(super.runner); + KxTestCase(super._runner); @override String get name => 'kx'; diff --git a/packages/sodium/test/integration/cases/pwhash_test_case.dart b/packages/sodium/test/integration/cases/pwhash_test_case.dart index 2250249a..66b4b155 100644 --- a/packages/sodium/test/integration/cases/pwhash_test_case.dart +++ b/packages/sodium/test/integration/cases/pwhash_test_case.dart @@ -5,7 +5,7 @@ import '../test_case.dart'; class PwhashTestCase extends TestCase { final bool is32Bit; - PwhashTestCase(super.runner, {this.is32Bit = false}); + PwhashTestCase(super._runner, {this.is32Bit = false}); @override String get name => 'pwhash'; diff --git a/packages/sodium/test/integration/cases/randombytes_test_case.dart b/packages/sodium/test/integration/cases/randombytes_test_case.dart index 803966d3..f1620d2c 100644 --- a/packages/sodium/test/integration/cases/randombytes_test_case.dart +++ b/packages/sodium/test/integration/cases/randombytes_test_case.dart @@ -3,7 +3,7 @@ import 'dart:typed_data'; import '../test_case.dart'; class RandombytesTestCase extends TestCase { - RandombytesTestCase(super.runner); + RandombytesTestCase(super._runner); @override String get name => 'randombytes'; diff --git a/packages/sodium/test/integration/cases/scalarmult_test_case.dart b/packages/sodium/test/integration/cases/scalarmult_test_case.dart index cc9586c7..0d05e87e 100644 --- a/packages/sodium/test/integration/cases/scalarmult_test_case.dart +++ b/packages/sodium/test/integration/cases/scalarmult_test_case.dart @@ -1,7 +1,7 @@ import '../test_case.dart'; class ScalarMultTestCase extends TestCase { - ScalarMultTestCase(super.runner); + ScalarMultTestCase(super._runner); @override String get name => 'scalarmult'; diff --git a/packages/sodium/test/integration/cases/secret_box_test_case.dart b/packages/sodium/test/integration/cases/secret_box_test_case.dart index 3e9fb75c..9174b0a2 100644 --- a/packages/sodium/test/integration/cases/secret_box_test_case.dart +++ b/packages/sodium/test/integration/cases/secret_box_test_case.dart @@ -1,12 +1,12 @@ import 'dart:typed_data'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.dart'; import '../test_case.dart'; class SecretBoxTestCase extends TestCase { - SecretBoxTestCase(super.runner); + SecretBoxTestCase(super._runner); @override String get name => 'secretbox'; diff --git a/packages/sodium/test/integration/cases/secret_stream_test_case.dart b/packages/sodium/test/integration/cases/secret_stream_test_case.dart index 3683af6c..81f50a1a 100644 --- a/packages/sodium/test/integration/cases/secret_stream_test_case.dart +++ b/packages/sodium/test/integration/cases/secret_stream_test_case.dart @@ -1,13 +1,13 @@ import 'dart:async'; import 'dart:typed_data'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.dart'; import '../test_case.dart'; class SecretStreamTestCase extends TestCase { - SecretStreamTestCase(super.runner); + SecretStreamTestCase(super._runner); @override String get name => 'secretstream'; diff --git a/packages/sodium/test/integration/cases/short_hash_test_case.dart b/packages/sodium/test/integration/cases/short_hash_test_case.dart index 861e6c01..80e7059f 100644 --- a/packages/sodium/test/integration/cases/short_hash_test_case.dart +++ b/packages/sodium/test/integration/cases/short_hash_test_case.dart @@ -3,7 +3,7 @@ import 'dart:typed_data'; import '../test_case.dart'; class ShortHashTestCase extends TestCase { - ShortHashTestCase(super.runner); + ShortHashTestCase(super._runner); @override String get name => 'shorthash'; diff --git a/packages/sodium/test/integration/cases/sign_test_case.dart b/packages/sodium/test/integration/cases/sign_test_case.dart index 4dea9ff2..fc926807 100644 --- a/packages/sodium/test/integration/cases/sign_test_case.dart +++ b/packages/sodium/test/integration/cases/sign_test_case.dart @@ -1,12 +1,12 @@ import 'dart:typed_data'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.dart'; import '../test_case.dart'; class SignTestCase extends TestCase { - SignTestCase(super.runner); + SignTestCase(super._runner); @override String get name => 'sign'; diff --git a/packages/sodium/test/integration/cases/sodium_test_case.dart b/packages/sodium/test/integration/cases/sodium_test_case.dart index a9483c68..084fc185 100644 --- a/packages/sodium/test/integration/cases/sodium_test_case.dart +++ b/packages/sodium/test/integration/cases/sodium_test_case.dart @@ -1,13 +1,13 @@ import 'dart:typed_data'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.dart'; import 'package:tuple/tuple.dart'; import '../test_case.dart'; class SodiumTestCase extends TestCase { - SodiumTestCase(super.runner); + SodiumTestCase(super._runner); @override String get name => 'sodium'; diff --git a/packages/sodium/test/integration/js_sumo_test.dart b/packages/sodium/test/integration/js_sumo_test.dart index 33a1e796..f443a771 100644 --- a/packages/sodium/test/integration/js_sumo_test.dart +++ b/packages/sodium/test/integration/js_sumo_test.dart @@ -1,7 +1,7 @@ @TestOn('js') library js_sumo_test; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium_sumo.dart'; import 'package:test/test.dart'; diff --git a/packages/sodium/test/integration/js_test.dart b/packages/sodium/test/integration/js_test.dart index 3705f1e5..f8738013 100644 --- a/packages/sodium/test/integration/js_test.dart +++ b/packages/sodium/test/integration/js_test.dart @@ -1,7 +1,7 @@ @TestOn('js') library js_test; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.dart'; import 'package:test/test.dart'; diff --git a/packages/sodium/test/integration/js_test_common.dart b/packages/sodium/test/integration/js_test_common.dart index 90c7d424..99b0fdc1 100644 --- a/packages/sodium/test/integration/js_test_common.dart +++ b/packages/sodium/test/integration/js_test_common.dart @@ -7,7 +7,7 @@ import 'dart:html'; import 'package:js/js.dart'; import 'package:js/js_util.dart'; import 'package:meta/meta.dart'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.js.dart'; @JS() diff --git a/packages/sodium/test/integration/test_runner.dart b/packages/sodium/test/integration/test_runner.dart index 2bc028c2..f5e94ed9 100644 --- a/packages/sodium/test/integration/test_runner.dart +++ b/packages/sodium/test/integration/test_runner.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'package:meta/meta.dart'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium_sumo.dart'; import 'package:test/test.dart' as t; diff --git a/packages/sodium/test/integration/vm_test.dart b/packages/sodium/test/integration/vm_test.dart index 5433817a..e707fe02 100644 --- a/packages/sodium/test/integration/vm_test.dart +++ b/packages/sodium/test/integration/vm_test.dart @@ -5,7 +5,7 @@ import 'dart:async'; import 'dart:ffi'; import 'dart:io'; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium_sumo.dart'; import 'package:test/test.dart'; diff --git a/packages/sodium/test/unit/api/coverage_test.dart b/packages/sodium/test/unit/api/coverage_test.dart index dfc27637..26f43e8d 100644 --- a/packages/sodium/test/unit/api/coverage_test.dart +++ b/packages/sodium/test/unit/api/coverage_test.dart @@ -1,4 +1,4 @@ -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.dart'; import 'package:test/test.dart'; diff --git a/packages/sodium/test/unit/ffi/bindings/sodium_pointer_test.dart b/packages/sodium/test/unit/ffi/bindings/sodium_pointer_test.dart index afd2cd30..21547944 100644 --- a/packages/sodium/test/unit/ffi/bindings/sodium_pointer_test.dart +++ b/packages/sodium/test/unit/ffi/bindings/sodium_pointer_test.dart @@ -1163,88 +1163,63 @@ extension _TestHelper on Pointer { switch (T) { case Int8: Int8Pointer(this as Pointer)[index] = value as int; - break; case Int16: Int16Pointer(this as Pointer)[index] = value as int; - break; case Int32: Int32Pointer(this as Pointer)[index] = value as int; - break; case Int64: Int64Pointer(this as Pointer)[index] = value as int; - break; case Uint8: Uint8Pointer(this as Pointer)[index] = value as int; - break; case Uint16: Uint16Pointer(this as Pointer)[index] = value as int; - break; case Uint32: Uint32Pointer(this as Pointer)[index] = value as int; - break; case Uint64: Uint64Pointer(this as Pointer)[index] = value as int; - break; case Float: FloatPointer(this as Pointer)[index] = value as double; - break; case Double: DoublePointer(this as Pointer)[index] = value as double; - break; case Char: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case Short: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case Int: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case Long: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case LongLong: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case UnsignedChar: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case UnsignedShort: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case UnsignedInt: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case UnsignedLong: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case UnsignedLongLong: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case SignedChar: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case IntPtr: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case UintPtr: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case Size: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; case WChar: AbiSpecificIntegerPointer(this as Pointer)[index] = value as int; - break; default: throw UnsupportedError( 'Cannot create a SodiumPointer for $T. T must be a primitive type', diff --git a/packages/sodium/test/unit/ffi/coverage_test.dart b/packages/sodium/test/unit/ffi/coverage_test.dart index 59d19805..fb1fd611 100644 --- a/packages/sodium/test/unit/ffi/coverage_test.dart +++ b/packages/sodium/test/unit/ffi/coverage_test.dart @@ -1,7 +1,7 @@ @TestOn('dart-vm') library coverage_test; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.ffi.dart'; import 'package:test/test.dart'; diff --git a/packages/sodium/test/unit/ffi/keygen_test_helpers.dart b/packages/sodium/test/unit/ffi/keygen_test_helpers.dart index 3d1d2865..75c0307e 100644 --- a/packages/sodium/test/unit/ffi/keygen_test_helpers.dart +++ b/packages/sodium/test/unit/ffi/keygen_test_helpers.dart @@ -150,8 +150,7 @@ void testSeedKeypair({ Pointer pk, Pointer sk, Pointer seed, - ) - seedKeypairNative, + ) seedKeypairNative, }) => group('seedKeypair', () { const seedLen = 33; diff --git a/packages/sodium/test/unit/ffi/pointer_test_helpers.dart b/packages/sodium/test/unit/ffi/pointer_test_helpers.dart index 65c63911..407a788d 100644 --- a/packages/sodium/test/unit/ffi/pointer_test_helpers.dart +++ b/packages/sodium/test/unit/ffi/pointer_test_helpers.dart @@ -90,17 +90,13 @@ class HasRawDataMatcher extends Matcher { switch (sizeHint) { case 8: ptrList = ptrBuffer.asUint64List(); - break; case 4: ptrList = ptrBuffer.asUint32List(); - break; case 2: ptrList = ptrBuffer.asUint16List(); - break; case 1: case null: ptrList = ptrBuffer.asUint8List(); - break; default: matchState[_stateKey] = 'invalid sizeHint $sizeHint'; return false; diff --git a/packages/sodium/test/unit/js/coverage_test.dart b/packages/sodium/test/unit/js/coverage_test.dart index c3ab44ad..0522b44f 100644 --- a/packages/sodium/test/unit/js/coverage_test.dart +++ b/packages/sodium/test/unit/js/coverage_test.dart @@ -1,7 +1,7 @@ @TestOn('js') library coverage_test; -// ignore: test_library_import +// ignore: no_self_package_imports import 'package:sodium/sodium.js.dart'; import 'package:test/test.dart'; diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 00000000..28539f4a --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,7 @@ +name: libsodium_dart_bindings_melos + +environment: + sdk: "^3.0.0" + +dependencies: + melos: