Skip to content

Commit

Permalink
Merge branch 'main' into merge-convert-package
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem authored Oct 16, 2024
2 parents 3303cce + 17d1b2c commit cbf9a16
Show file tree
Hide file tree
Showing 53 changed files with 8,385 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Configuration for .github/workflows/pull_request_label.yaml.

"package-args":
"package:args":
- changed-files:
- any-glob-to-any-file: 'pkgs/args/**'

"package:convert":
- changed-files:
- any-glob-to-any-file: 'pkgs/convert/**'

"package:crypto":
- changed-files:
- any-glob-to-any-file: 'pkgs/crypto/**'

"package:fixnum":
- changed-files:
- any-glob-to-any-file: 'pkgs/fixnum/**'
77 changes: 77 additions & 0 deletions .github/workflows/crypto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: package:crypto

on:
# Run CI on pushes to the main branch, and on PRs against main.
push:
branches: [ main ]
paths:
- '.github/workflows/crypto.yaml'
- 'pkgs/crypto/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/crypto.yaml'
- 'pkgs/crypto/**'
schedule:
- cron: "0 0 * * 0"
env:
PUB_ENVIRONMENT: bot.github

defaults:
run:
working-directory: pkgs/crypto/

jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

# Run tests on a matrix consisting of two dimensions:
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
# 2. release channel: dev
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [3.4, dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Run VM tests
run: dart test --platform vm
if: always() && steps.install.outcome == 'success'
- name: Run Chrome tests
run: dart test --platform chrome
if: always() && steps.install.outcome == 'success'
- name: Run Chrome tests - wasm
# TODO: investigate why we get hangs when concurrency is > 1
run: dart test --platform chrome --compiler dart2wasm -j 1
if: always() && steps.install.outcome == 'success'
73 changes: 73 additions & 0 deletions .github/workflows/fixnum.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: package:fixnum

on:
# Run CI on pushes to the main branch, and on PRs against main.
push:
branches: [ main ]
paths:
- '.github/workflows/fixnum.yaml'
- 'pkgs/fixnum/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/fixnum.yaml'
- 'pkgs/fixnum/**'
schedule:
- cron: "0 0 * * 0"
env:
PUB_ENVIRONMENT: bot.github

defaults:
run:
working-directory: pkgs/fixnum/

jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [3.1.0, dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

# Run tests on a matrix consisting of two dimensions:
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
# 2. release channel: dev
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [3.1.0, dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Run VM tests
run: dart test --platform vm
if: always() && steps.install.outcome == 'success'
- name: Run Chrome tests
run: dart test --platform chrome
if: always() && steps.install.outcome == 'success'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This repository is home to various Dart packages under the [dart.dev](https://pu
|---|---|---|
| [args](pkgs/args/) | Library for defining parsers for parsing raw command-line arguments into a set of options and values. | [![pub package](https://img.shields.io/pub/v/args.svg)](https://pub.dev/packages/args) |
| [convert](pkgs/convert/) | Utilities for converting between data representations. | [![pub package](https://img.shields.io/pub/v/convert.svg)](https://pub.dev/packages/convert) |
| [crypto](pkgs/crypto/) | Implementations of SHA, MD5, and HMAC cryptographic functions. | [![pub package](https://img.shields.io/pub/v/crypto.svg)](https://pub.dev/packages/crypto) |
| [fixnum](pkgs/fixnum/) | Library for 32- and 64-bit signed fixed-width integers. | [![pub package](https://img.shields.io/pub/v/fixnum.svg)](https://pub.dev/packages/fixnum) |

## Publishing automation

Expand Down
4 changes: 4 additions & 0 deletions pkgs/args/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.6.1-wip

* Fix the reporitory URL in `pubspec.yaml`.

## 2.6.0

* Added source argument when throwing a `ArgParserException`.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/args/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: args
version: 2.6.0
version: 2.6.1-wip
description: >-
Library for defining parsers for parsing raw command-line arguments into a set
of options and values using GNU and POSIX style options.
repository: https://github.com/dart-lang/core/main/pkgs/args
repository: https://github.com/dart-lang/core/tree/main/pkgs/args

topics:
- cli
Expand Down
3 changes: 3 additions & 0 deletions pkgs/crypto/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.dart_tool
.packages
pubspec.lock
5 changes: 5 additions & 0 deletions pkgs/crypto/.test_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test_package": {
"platforms": ["vm"]
}
}
6 changes: 6 additions & 0 deletions pkgs/crypto/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Below is a list of people and organizations that have contributed
# to the project. Names should be added to the list like so:
#
# Name/Organization <email address>

Google Inc.
169 changes: 169 additions & 0 deletions pkgs/crypto/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
## 3.0.6

* Move to `dart-lang/core` monorepo.

## 3.0.5

* Revert switch to enable fast "sinks" on Wasm because it breaks `dart2js` with
server mode.

## 3.0.4

* Fix WebAssembly support.
* Require Dart 3.4

## 3.0.3

* Require Dart 2.19.0.
* Add topics to `pubspec.yaml`.

## 3.0.2

* Require Dart 2.14.0.
* Fix bug calculating hashes for content larger than 512MB when compiled to JS.

## 3.0.1

* Fix doc links in README.

## 3.0.0

* Stable release for null safety.
* Adds SHA-2 512/224 and SHA-2 512/256 from FIPS 180-4
* Removes `newInstance` instance members on some classes
and updates documentation.

## 2.1.5

* Improve example and package description to address package site maintenance
suggestions.

## 2.1.4
* BugFix: padding was incorrect for some SHA-512/328.

## 2.1.3
* **Security vulnerability**: Fixed constant-time comparison in `Digest`.

## 2.1.2
* Fix bug in SHA-2 384/512 blocksize.
* Added HMAC-SHA-2 test vectors

## 2.1.1+1
* Bump version number for publish mishap (spare file uploaded with `pub
publish`).

## 2.1.1
* Added a workaround for a bug in DDC (used in build_web_compilers 1.x).
This bug is not present in DDK (used in build_web_compilers 2.x).

## 2.1.0
* Added SHA384, and SHA512
* Add Sha224 + Refactor
* Support 32bit and 64bit operations for SHA384/51
* Add conditional imports
* De-listify 32bit allocations
* Add sha monte tests for 224,256,384, and 512

## 2.0.5

* Changed the max message size instead to 0x3ffffffffffff, which is the largest
portable value for both JS and the Dart VM.

## 2.0.4

* Made max message size a BigNum instead of an int so that dart2js can compile
with crypto.

## 2.0.3

* Updated SDK version to 2.0.0-dev.17.0

## 2.0.2+1

* Fix SDK constraint.

## 2.0.2

* Prepare `HashSink` implementation for limiting integers to 64 bits in Dart
language.

## 2.0.1

* Support `convert` 2.0.0.

## 2.0.0

**Note**: There are no APIs in 2.0.0 that weren't also in 0.9.2. Packages that
would use 2.0.0 as a lower bound should use 0.9.2 instead—for example, `crypto:
">=0.9.2 <3.0.0"`.

* `Hash` and `Hmac` no longer extend `ChunkedConverter`.

## 1.1.1

* Properly close sinks passed to `Hash.startChunkedConversion()` when
`ByteConversionSink.close()` is called.

## 1.1.0

* `Hmac` and `Hash` now extend the new `ChunkedConverter` class from
`dart:convert`.

* Fix all strong mode warnings.

## 1.0.0

* All APIs that were deprecated in 0.9.2 have been removed. No new APIs have
been added. Packages that would use 1.0.0 as a lower bound should use 0.9.2
instead—for example, `crypto: ">=0.9.2 <2.0.0"`.

## 0.9.2+1

* Avoid core library methods that don't work on dart2js.

## 0.9.2

* `Hash`, `MD5`, `SHA1`, and `SHA256` now implement `Converter`. They convert
between `List<int>`s and the new `Digest` class, which represents a hash
digest. The `Converter` APIs—`Hash.convert()` and
`Hash.startChunkedConversion`—should be used in preference to the old APIs,
which are now deprecated.

* `SHA1`, `SHA256`, and `HMAC` have been renamed to `Sha1`, `Sha256`, and
`Hmac`, respectively. The old names still work, but are deprecated.

* Top-level `sha1`, `sha256`, and `md5` fields have been added to make it easier
to use those hash algorithms without having to instantiate new instances.

* Hashing now works correctly for input sizes up to 2^64 bytes.

### Deprecations

* `Hash.add`, `Hash.close`, and `Hash.newInstance` are deprecated.
`Hash.convert` should be used for hashing single values, and
`Hash.startChunkedConversion` should be used for hashing streamed values.

* `SHA1` and `SHA256` are deprecated. Use the top-level `sha1` and `sha256`
fields instead.

* While the `MD5` class is not deprecated, the `new MD5()` constructor is. Use
the top-level `md5` field instead.

* `HMAC` is deprecated. Use `Hmac` instead.

* `Base64Codec`, `Base64Encoder`, `Base64Decoder`, `Base64EncoderSink`,
`Base64DecoderSink`, and `BASE64` are deprecated. Use the Base64 APIs in
`dart:convert` instead.

* `CryptoUtils` is deprecated. Use the Base64 APIs in `dart:convert` and the hex
APIs in the `convert` package instead.

## 0.9.1

* Base64 convert returns an Uint8List
* Base64 codec and encoder can now take an encodePaddingCharacter
* Implement a Base64 codec similar to codecs in 'dart:convert'

## 0.9.0

* ChangeLog starts here.
Loading

0 comments on commit cbf9a16

Please sign in to comment.