Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 0.6.2-wip
* Fixed JS interop to enable WebAssembly.
* Upgrade `ffigen` and `hooks` versions.

# 0.6.1
* Added Dart native build hooks and native asset lookup for the bundled
Expand Down
54 changes: 29 additions & 25 deletions example/webcrypto_demo_flutter_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ void main() {
}

class MyApp extends StatefulWidget {
const MyApp({super.key});

@override
_MyAppState createState() => _MyAppState();
MyAppState createState() => MyAppState();
}

class _MyAppState extends State<MyApp> {
class MyAppState extends State<MyApp> {
String _output = '-';
final _input = TextEditingController();

Expand All @@ -37,29 +39,31 @@ class _MyAppState extends State<MyApp> {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('SHA-1 Hashing')),
body: Container(
padding: EdgeInsets.all(10),
child: Column(
children: [
Text(
'Compute SHA-1 hash of input below.\n\n'
'Click the button to refresh the computed output.'
'Output will be displayed in hexadecimal encoding.',
),
Text(
'input',
textScaleFactor: 1.2,
style: TextStyle(fontWeight: FontWeight.bold),
),
_textEntry(),
SizedBox(height: 50),
Text(
'output',
textScaleFactor: 1.2,
style: TextStyle(fontWeight: FontWeight.bold),
),
Text('$_output'),
],
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(10),
child: Column(
children: [
Text(
'Compute SHA-1 hash of input below.\n\n'
'Click the button to refresh the computed output.'
'Output will be displayed in hexadecimal encoding.',
),
Text(
'input',
textScaler: TextScaler.linear(1.2),
style: TextStyle(fontWeight: FontWeight.bold),
),
_textEntry(),
SizedBox(height: 20),
Text(
'output',
textScaler: TextScaler.linear(1.2),
style: TextStyle(fontWeight: FontWeight.bold),
),
Text(_output),
],
),
),
),
),
Expand Down
43 changes: 0 additions & 43 deletions lib/src/boringssl/bindings/ffigen.yaml

This file was deleted.

152 changes: 147 additions & 5 deletions lib/src/boringssl/bindings/generated_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,154 @@
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint
// ignore_for_file: type=lint, unused_import
@ffi.DefaultAsset('package:webcrypto/webcrypto.dart')
library;

import 'dart:ffi' as ffi;

/// Helper function to get the size of CBB structure for FFI allocation.
@ffi.Native<ffi.Size Function()>(
symbol: 'webcrypto_get_CBB_size',
assetId: 'package:webcrypto/webcrypto.dart',
)
@ffi.Native<ffi.Size Function()>()
external int webcrypto_get_CBB_size();

typedef __blkcnt64_t = ffi.Long;
typedef Dart__blkcnt64_t = int;
typedef __blkcnt_t = ffi.Long;
typedef Dart__blkcnt_t = int;
typedef __blksize_t = ffi.Long;
typedef Dart__blksize_t = int;
typedef __caddr_t = ffi.Pointer<ffi.Char>;
typedef __clock_t = ffi.Long;
typedef Dart__clock_t = int;
typedef __clockid_t = ffi.Int;
typedef Dart__clockid_t = int;
typedef __daddr_t = ffi.Int;
typedef Dart__daddr_t = int;
typedef __dev_t = ffi.UnsignedLong;
typedef Dart__dev_t = int;
typedef __fsblkcnt64_t = ffi.UnsignedLong;
typedef Dart__fsblkcnt64_t = int;
typedef __fsblkcnt_t = ffi.UnsignedLong;
typedef Dart__fsblkcnt_t = int;
typedef __fsfilcnt64_t = ffi.UnsignedLong;
typedef Dart__fsfilcnt64_t = int;
typedef __fsfilcnt_t = ffi.UnsignedLong;
typedef Dart__fsfilcnt_t = int;
typedef __fsword_t = ffi.Long;
typedef Dart__fsword_t = int;
typedef __gid_t = ffi.UnsignedInt;
typedef Dart__gid_t = int;
typedef __id_t = ffi.UnsignedInt;
typedef Dart__id_t = int;
typedef __ino64_t = ffi.UnsignedLong;
typedef Dart__ino64_t = int;
typedef __ino_t = ffi.UnsignedLong;
typedef Dart__ino_t = int;
typedef __int16_t = ffi.Short;
typedef Dart__int16_t = int;
typedef __int32_t = ffi.Int;
typedef Dart__int32_t = int;
typedef __int64_t = ffi.Long;
typedef Dart__int64_t = int;
typedef __int8_t = ffi.SignedChar;
typedef Dart__int8_t = int;
typedef __int_least16_t = __int16_t;
typedef __int_least32_t = __int32_t;
typedef __int_least64_t = __int64_t;
typedef __int_least8_t = __int8_t;
typedef __intmax_t = ffi.Long;
typedef Dart__intmax_t = int;
typedef __intptr_t = ffi.Long;
typedef Dart__intptr_t = int;
typedef __key_t = ffi.Int;
typedef Dart__key_t = int;
typedef __loff_t = __off64_t;
typedef __mode_t = ffi.UnsignedInt;
typedef Dart__mode_t = int;
typedef __nlink_t = ffi.UnsignedLong;
typedef Dart__nlink_t = int;
typedef __off64_t = ffi.Long;
typedef Dart__off64_t = int;
typedef __off_t = ffi.Long;
typedef Dart__off_t = int;
typedef __pid_t = ffi.Int;
typedef Dart__pid_t = int;
typedef __quad_t = ffi.Long;
typedef Dart__quad_t = int;
typedef __rlim64_t = ffi.UnsignedLong;
typedef Dart__rlim64_t = int;
typedef __rlim_t = ffi.UnsignedLong;
typedef Dart__rlim_t = int;
typedef __sig_atomic_t = ffi.Int;
typedef Dart__sig_atomic_t = int;
typedef __socklen_t = ffi.UnsignedInt;
typedef Dart__socklen_t = int;
typedef __ssize_t = ffi.Long;
typedef Dart__ssize_t = int;
typedef __suseconds64_t = ffi.Long;
typedef Dart__suseconds64_t = int;
typedef __suseconds_t = ffi.Long;
typedef Dart__suseconds_t = int;
typedef __syscall_slong_t = ffi.Long;
typedef Dart__syscall_slong_t = int;
typedef __syscall_ulong_t = ffi.UnsignedLong;
typedef Dart__syscall_ulong_t = int;
typedef __time_t = ffi.Long;
typedef Dart__time_t = int;
typedef __timer_t = ffi.Pointer<ffi.Void>;
typedef __u_char = ffi.UnsignedChar;
typedef Dart__u_char = int;
typedef __u_int = ffi.UnsignedInt;
typedef Dart__u_int = int;
typedef __u_long = ffi.UnsignedLong;
typedef Dart__u_long = int;
typedef __u_quad_t = ffi.UnsignedLong;
typedef Dart__u_quad_t = int;
typedef __u_short = ffi.UnsignedShort;
typedef Dart__u_short = int;
typedef __uid_t = ffi.UnsignedInt;
typedef Dart__uid_t = int;
typedef __uint16_t = ffi.UnsignedShort;
typedef Dart__uint16_t = int;
typedef __uint32_t = ffi.UnsignedInt;
typedef Dart__uint32_t = int;
typedef __uint64_t = ffi.UnsignedLong;
typedef Dart__uint64_t = int;
typedef __uint8_t = ffi.UnsignedChar;
typedef Dart__uint8_t = int;
typedef __uint_least16_t = __uint16_t;
typedef __uint_least32_t = __uint32_t;
typedef __uint_least64_t = __uint64_t;
typedef __uint_least8_t = __uint8_t;
typedef __uintmax_t = ffi.UnsignedLong;
typedef Dart__uintmax_t = int;
typedef __useconds_t = ffi.UnsignedInt;
typedef Dart__useconds_t = int;
typedef int_fast16_t = ffi.Long;
typedef Dartint_fast16_t = int;
typedef int_fast32_t = ffi.Long;
typedef Dartint_fast32_t = int;
typedef int_fast64_t = ffi.Long;
typedef Dartint_fast64_t = int;
typedef int_fast8_t = ffi.SignedChar;
typedef Dartint_fast8_t = int;
typedef int_least16_t = __int_least16_t;
typedef int_least32_t = __int_least32_t;
typedef int_least64_t = __int_least64_t;
typedef int_least8_t = __int_least8_t;
typedef intmax_t = __intmax_t;
typedef ptrdiff_t = ffi.Long;
typedef Dartptrdiff_t = int;
typedef uint_fast16_t = ffi.UnsignedLong;
typedef Dartuint_fast16_t = int;
typedef uint_fast32_t = ffi.UnsignedLong;
typedef Dartuint_fast32_t = int;
typedef uint_fast64_t = ffi.UnsignedLong;
typedef Dartuint_fast64_t = int;
typedef uint_fast8_t = ffi.UnsignedChar;
typedef Dartuint_fast8_t = int;
typedef uint_least16_t = __uint_least16_t;
typedef uint_least32_t = __uint_least32_t;
typedef uint_least64_t = __uint_least64_t;
typedef uint_least8_t = __uint_least8_t;
typedef uintmax_t = __uintmax_t;
Loading
Loading