Skip to content

Commit 6f54342

Browse files
committed
Merge package:crypto
2 parents 5876246 + 97bd0c3 commit 6f54342

36 files changed

+4939
-0
lines changed

pkgs/crypto/.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dependabot configuration file.
2+
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
3+
version: 2
4+
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
schedule:
9+
interval: monthly
10+
labels:
11+
- autosubmit
12+
groups:
13+
github-actions:
14+
patterns:
15+
- "*"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# A workflow to close issues where the author hasn't responded to a request for
2+
# more information; see https://github.com/actions/stale.
3+
4+
name: No Response
5+
6+
# Run as a daily cron.
7+
on:
8+
schedule:
9+
# Every day at 8am
10+
- cron: '0 8 * * *'
11+
12+
# All permissions not specified are set to 'none'.
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
17+
jobs:
18+
no-response:
19+
runs-on: ubuntu-latest
20+
if: ${{ github.repository_owner == 'dart-lang' }}
21+
steps:
22+
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e
23+
with:
24+
# Don't automatically mark inactive issues+PRs as stale.
25+
days-before-stale: -1
26+
# Close needs-info issues and PRs after 14 days of inactivity.
27+
days-before-close: 14
28+
stale-issue-label: "needs-info"
29+
close-issue-message: >
30+
Without additional information we're not able to resolve this issue.
31+
Feel free to add more info or respond to any questions above and we
32+
can reopen the case. Thanks for your contribution!
33+
stale-pr-label: "needs-info"
34+
close-pr-message: >
35+
Without additional information we're not able to resolve this PR.
36+
Feel free to add more info or respond to any questions above.
37+
Thanks for your contribution!
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# A CI configuration to auto-publish pub packages.
2+
3+
name: Publish
4+
5+
on:
6+
pull_request:
7+
branches: [ master ]
8+
push:
9+
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
10+
11+
jobs:
12+
publish:
13+
if: ${{ github.repository_owner == 'dart-lang' }}
14+
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
15+
permissions:
16+
id-token: write # Required for authentication using OIDC
17+
pull-requests: write # Required for writing the pull request note
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Dart CI
2+
3+
on:
4+
# Run on PRs and pushes to the default branch.
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
schedule:
10+
- cron: "0 0 * * 0"
11+
12+
env:
13+
PUB_ENVIRONMENT: bot.github
14+
15+
jobs:
16+
# Check code formatting and static analysis on a single OS (linux)
17+
# against Dart dev.
18+
analyze:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
sdk: [dev]
24+
steps:
25+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
26+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
27+
with:
28+
sdk: ${{ matrix.sdk }}
29+
- id: install
30+
name: Install dependencies
31+
run: dart pub get
32+
- name: Check formatting
33+
run: dart format --output=none --set-exit-if-changed .
34+
if: always() && steps.install.outcome == 'success'
35+
- name: Analyze code
36+
run: dart analyze --fatal-infos
37+
if: always() && steps.install.outcome == 'success'
38+
39+
# Run tests on a matrix consisting of two dimensions:
40+
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
41+
# 2. release channel: dev
42+
test:
43+
needs: analyze
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
# Add macos-latest and/or windows-latest if relevant for this package.
49+
os: [ubuntu-latest]
50+
sdk: [3.4, dev]
51+
steps:
52+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
53+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
54+
with:
55+
sdk: ${{ matrix.sdk }}
56+
- id: install
57+
name: Install dependencies
58+
run: dart pub get
59+
- name: Run VM tests
60+
run: dart test --platform vm
61+
if: always() && steps.install.outcome == 'success'
62+
- name: Run Chrome tests
63+
run: dart test --platform chrome
64+
if: always() && steps.install.outcome == 'success'
65+
- name: Run Chrome tests - wasm
66+
# TODO: investigate why we get hangs when concurrency is > 1
67+
run: dart test --platform chrome --compiler dart2wasm -j 1
68+
if: always() && steps.install.outcome == 'success'

pkgs/crypto/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.dart_tool
2+
.packages
3+
pubspec.lock

pkgs/crypto/.test_config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test_package": {
3+
"platforms": ["vm"]
4+
}
5+
}

pkgs/crypto/AUTHORS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.

pkgs/crypto/CHANGELOG.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
## 3.0.5
2+
3+
* Revert switch to enable fast "sinks" on Wasm because it breaks `dart2js` with
4+
server mode.
5+
6+
## 3.0.4
7+
8+
* Fix WebAssembly support.
9+
* Require Dart 3.4
10+
11+
## 3.0.3
12+
13+
* Require Dart 2.19.0.
14+
* Add topics to `pubspec.yaml`.
15+
16+
## 3.0.2
17+
18+
* Require Dart 2.14.0.
19+
* Fix bug calculating hashes for content larger than 512MB when compiled to JS.
20+
21+
## 3.0.1
22+
23+
* Fix doc links in README.
24+
25+
## 3.0.0
26+
27+
* Stable release for null safety.
28+
* Adds SHA-2 512/224 and SHA-2 512/256 from FIPS 180-4
29+
* Removes `newInstance` instance members on some classes
30+
and updates documentation.
31+
32+
## 2.1.5
33+
34+
* Improve example and package description to address package site maintenance
35+
suggestions.
36+
37+
## 2.1.4
38+
* BugFix: padding was incorrect for some SHA-512/328.
39+
40+
## 2.1.3
41+
* **Security vulnerability**: Fixed constant-time comparison in `Digest`.
42+
43+
## 2.1.2
44+
* Fix bug in SHA-2 384/512 blocksize.
45+
* Added HMAC-SHA-2 test vectors
46+
47+
## 2.1.1+1
48+
* Bump version number for publish mishap (spare file uploaded with `pub
49+
publish`).
50+
51+
## 2.1.1
52+
* Added a workaround for a bug in DDC (used in build_web_compilers 1.x).
53+
This bug is not present in DDK (used in build_web_compilers 2.x).
54+
55+
## 2.1.0
56+
* Added SHA384, and SHA512
57+
* Add Sha224 + Refactor
58+
* Support 32bit and 64bit operations for SHA384/51
59+
* Add conditional imports
60+
* De-listify 32bit allocations
61+
* Add sha monte tests for 224,256,384, and 512
62+
63+
## 2.0.5
64+
65+
* Changed the max message size instead to 0x3ffffffffffff, which is the largest
66+
portable value for both JS and the Dart VM.
67+
68+
## 2.0.4
69+
70+
* Made max message size a BigNum instead of an int so that dart2js can compile
71+
with crypto.
72+
73+
## 2.0.3
74+
75+
* Updated SDK version to 2.0.0-dev.17.0
76+
77+
## 2.0.2+1
78+
79+
* Fix SDK constraint.
80+
81+
## 2.0.2
82+
83+
* Prepare `HashSink` implementation for limiting integers to 64 bits in Dart
84+
language.
85+
86+
## 2.0.1
87+
88+
* Support `convert` 2.0.0.
89+
90+
## 2.0.0
91+
92+
**Note**: There are no APIs in 2.0.0 that weren't also in 0.9.2. Packages that
93+
would use 2.0.0 as a lower bound should use 0.9.2 instead—for example, `crypto:
94+
">=0.9.2 <3.0.0"`.
95+
96+
* `Hash` and `Hmac` no longer extend `ChunkedConverter`.
97+
98+
## 1.1.1
99+
100+
* Properly close sinks passed to `Hash.startChunkedConversion()` when
101+
`ByteConversionSink.close()` is called.
102+
103+
## 1.1.0
104+
105+
* `Hmac` and `Hash` now extend the new `ChunkedConverter` class from
106+
`dart:convert`.
107+
108+
* Fix all strong mode warnings.
109+
110+
## 1.0.0
111+
112+
* All APIs that were deprecated in 0.9.2 have been removed. No new APIs have
113+
been added. Packages that would use 1.0.0 as a lower bound should use 0.9.2
114+
instead—for example, `crypto: ">=0.9.2 <2.0.0"`.
115+
116+
## 0.9.2+1
117+
118+
* Avoid core library methods that don't work on dart2js.
119+
120+
## 0.9.2
121+
122+
* `Hash`, `MD5`, `SHA1`, and `SHA256` now implement `Converter`. They convert
123+
between `List<int>`s and the new `Digest` class, which represents a hash
124+
digest. The `Converter` APIs—`Hash.convert()` and
125+
`Hash.startChunkedConversion`—should be used in preference to the old APIs,
126+
which are now deprecated.
127+
128+
* `SHA1`, `SHA256`, and `HMAC` have been renamed to `Sha1`, `Sha256`, and
129+
`Hmac`, respectively. The old names still work, but are deprecated.
130+
131+
* Top-level `sha1`, `sha256`, and `md5` fields have been added to make it easier
132+
to use those hash algorithms without having to instantiate new instances.
133+
134+
* Hashing now works correctly for input sizes up to 2^64 bytes.
135+
136+
### Deprecations
137+
138+
* `Hash.add`, `Hash.close`, and `Hash.newInstance` are deprecated.
139+
`Hash.convert` should be used for hashing single values, and
140+
`Hash.startChunkedConversion` should be used for hashing streamed values.
141+
142+
* `SHA1` and `SHA256` are deprecated. Use the top-level `sha1` and `sha256`
143+
fields instead.
144+
145+
* While the `MD5` class is not deprecated, the `new MD5()` constructor is. Use
146+
the top-level `md5` field instead.
147+
148+
* `HMAC` is deprecated. Use `Hmac` instead.
149+
150+
* `Base64Codec`, `Base64Encoder`, `Base64Decoder`, `Base64EncoderSink`,
151+
`Base64DecoderSink`, and `BASE64` are deprecated. Use the Base64 APIs in
152+
`dart:convert` instead.
153+
154+
* `CryptoUtils` is deprecated. Use the Base64 APIs in `dart:convert` and the hex
155+
APIs in the `convert` package instead.
156+
157+
## 0.9.1
158+
159+
* Base64 convert returns an Uint8List
160+
* Base64 codec and encoder can now take an encodePaddingCharacter
161+
* Implement a Base64 codec similar to codecs in 'dart:convert'
162+
163+
## 0.9.0
164+
165+
* ChangeLog starts here.

pkgs/crypto/CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Want to contribute? Great! First, read this page (including the small print at
2+
the end).
3+
4+
### Before you contribute
5+
Before we can use your code, you must sign the
6+
[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual)
7+
(CLA), which you can do online. The CLA is necessary mainly because you own the
8+
copyright to your changes, even after your contribution becomes part of our
9+
codebase, so we need your permission to use and distribute your code. We also
10+
need to be sure of various other things—for instance that you'll tell us if you
11+
know that your code infringes on other people's patents. You don't have to sign
12+
the CLA until after you've submitted your code for review and a member has
13+
approved it, but you must do it before we can put your code into our codebase.
14+
15+
Before you start working on a larger contribution, you should get in touch with
16+
us first through the issue tracker with your idea so that we can help out and
17+
possibly guide you. Coordinating up front makes it much easier to avoid
18+
frustration later on.
19+
20+
### Code reviews
21+
All submissions, including submissions by project members, require review.
22+
23+
### File headers
24+
All files in the project must start with the following header.
25+
26+
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
27+
// for details. All rights reserved. Use of this source code is governed by a
28+
// BSD-style license that can be found in the LICENSE file.
29+
30+
### The small print
31+
Contributions made by corporations are covered by a different agreement than the
32+
one above, the
33+
[Software Grant and Corporate Contributor License Agreement](https://developers.google.com/open-source/cla/corporate).

pkgs/crypto/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2015, the Dart project authors.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)