@ohos-ports/crypto 0.0.0-stage → 0.3.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +60 -2
  3. package/dist/bech32.d.ts +53 -0
  4. package/dist/bech32.js +187 -0
  5. package/dist/blake2b.d.ts +7 -0
  6. package/dist/blake2b.js +213 -0
  7. package/dist/bls12_318.d.ts +48 -0
  8. package/dist/bls12_318.js +268 -0
  9. package/dist/ed25519.d.ts +55 -0
  10. package/dist/ed25519.js +721 -0
  11. package/dist/hasGlobalWebCrypto.d.ts +1 -0
  12. package/dist/hasGlobalWebCrypto.js +21 -0
  13. package/dist/hmacSHA512.d.ts +6 -0
  14. package/dist/hmacSHA512.js +14 -0
  15. package/dist/index.d.ts +14 -0
  16. package/dist/index.js +30 -0
  17. package/dist/keccak.d.ts +4 -0
  18. package/dist/keccak.js +43 -0
  19. package/dist/kes/constants.d.ts +2 -0
  20. package/dist/kes/constants.js +5 -0
  21. package/dist/kes/index.d.ts +0 -0
  22. package/dist/kes/index.js +0 -0
  23. package/dist/kes/macro/sum_kes.d.ts +15 -0
  24. package/dist/kes/macro/sum_kes.js +9 -0
  25. package/dist/kes/singleKes.d.ts +0 -0
  26. package/dist/kes/singleKes.js +0 -0
  27. package/dist/noble/_assert.d.ts +23 -0
  28. package/dist/noble/_assert.js +55 -0
  29. package/dist/noble/_md.d.ts +29 -0
  30. package/dist/noble/_md.js +170 -0
  31. package/dist/noble/_shortw_utils.d.ts +61 -0
  32. package/dist/noble/_shortw_utils.js +63 -0
  33. package/dist/noble/_u64.d.ts +28 -0
  34. package/dist/noble/_u64.js +116 -0
  35. package/dist/noble/abstract/bls.d.ts +119 -0
  36. package/dist/noble/abstract/bls.js +334 -0
  37. package/dist/noble/abstract/curve.d.ts +83 -0
  38. package/dist/noble/abstract/curve.js +319 -0
  39. package/dist/noble/abstract/edwards.d.ts +85 -0
  40. package/dist/noble/abstract/edwards.js +508 -0
  41. package/dist/noble/abstract/hash-to-curve.d.ts +57 -0
  42. package/dist/noble/abstract/hash-to-curve.js +220 -0
  43. package/dist/noble/abstract/modular.d.ts +122 -0
  44. package/dist/noble/abstract/modular.js +455 -0
  45. package/dist/noble/abstract/montgomery.d.ts +28 -0
  46. package/dist/noble/abstract/montgomery.js +172 -0
  47. package/dist/noble/abstract/utils.d.ts +106 -0
  48. package/dist/noble/abstract/utils.js +442 -0
  49. package/dist/noble/bls12_381.d.ts +95 -0
  50. package/dist/noble/bls12_381.js +1434 -0
  51. package/dist/noble/crypto.d.ts +1 -0
  52. package/dist/noble/crypto.js +4 -0
  53. package/dist/noble/curves/curve.d.ts +69 -0
  54. package/dist/noble/curves/curve.js +167 -0
  55. package/dist/noble/curves/modular.d.ts +122 -0
  56. package/dist/noble/curves/modular.js +442 -0
  57. package/dist/noble/curves/utils.d.ts +93 -0
  58. package/dist/noble/curves/utils.js +385 -0
  59. package/dist/noble/curves/weierstrass.d.ts +240 -0
  60. package/dist/noble/curves/weierstrass.js +1178 -0
  61. package/dist/noble/ed25519.d.ts +100 -0
  62. package/dist/noble/ed25519.js +494 -0
  63. package/dist/noble/hmac.d.ts +25 -0
  64. package/dist/noble/hmac.js +101 -0
  65. package/dist/noble/index.d.ts +2 -0
  66. package/dist/noble/index.js +20 -0
  67. package/dist/noble/keccak.d.ts +58 -0
  68. package/dist/noble/keccak.js +289 -0
  69. package/dist/noble/ripemd_160.d.ts +20 -0
  70. package/dist/noble/ripemd_160.js +147 -0
  71. package/dist/noble/secp256k1.d.ts +98 -0
  72. package/dist/noble/secp256k1.js +309 -0
  73. package/dist/noble/sha256.d.ts +34 -0
  74. package/dist/noble/sha256.js +146 -0
  75. package/dist/noble/sha512.d.ts +66 -0
  76. package/dist/noble/sha512.js +301 -0
  77. package/dist/noble/utils.d.ts +90 -0
  78. package/dist/noble/utils.js +278 -0
  79. package/dist/ripemd_160.d.ts +1 -0
  80. package/dist/ripemd_160.js +23 -0
  81. package/dist/rust_vrf_reimpl/curves.d.ts +162 -0
  82. package/dist/rust_vrf_reimpl/curves.js +4225 -0
  83. package/dist/rust_vrf_reimpl/vrf03.d.ts +60 -0
  84. package/dist/rust_vrf_reimpl/vrf03.js +373 -0
  85. package/dist/rust_vrf_reimpl/vrf10.d.ts +73 -0
  86. package/dist/rust_vrf_reimpl/vrf10.js +468 -0
  87. package/dist/rust_vrf_reimpl/vrf10_batch.d.ts +53 -0
  88. package/dist/rust_vrf_reimpl/vrf10_batch.js +245 -0
  89. package/dist/secp256k1.d.ts +4 -0
  90. package/dist/secp256k1.js +33 -0
  91. package/dist/sha2_256.d.ts +16 -0
  92. package/dist/sha2_256.js +403 -0
  93. package/dist/sha2_512.d.ts +16 -0
  94. package/dist/sha2_512.js +256 -0
  95. package/dist/sha3.d.ts +17 -0
  96. package/dist/sha3.js +181 -0
  97. package/dist/types.d.ts +26 -0
  98. package/dist/types.js +120 -0
  99. package/dist/utils/assert.d.ts +3 -0
  100. package/dist/utils/assert.js +55 -0
  101. package/dist/utils/base32.d.ts +5 -0
  102. package/dist/utils/base32.js +52 -0
  103. package/dist/utils/bigintToBuffer.d.ts +1 -0
  104. package/dist/utils/bigintToBuffer.js +27 -0
  105. package/dist/utils/bytesToHex.d.ts +2 -0
  106. package/dist/utils/bytesToHex.js +15 -0
  107. package/dist/utils/getRandomValues.d.ts +4 -0
  108. package/dist/utils/getRandomValues.js +12 -0
  109. package/dist/utils/hexToBytes.d.ts +2 -0
  110. package/dist/utils/hexToBytes.js +14 -0
  111. package/dist/utils/index.d.ts +3 -0
  112. package/dist/utils/index.js +19 -0
  113. package/dist/utils/positiveMod.d.ts +1 -0
  114. package/dist/utils/positiveMod.js +11 -0
  115. package/dist/utils/promisifySync.d.ts +0 -0
  116. package/dist/utils/promisifySync.js +0 -0
  117. package/dist/utils/rotr32.d.ts +2 -0
  118. package/dist/utils/rotr32.js +7 -0
  119. package/dist/vrf.d.ts +74 -0
  120. package/dist/vrf.js +286 -0
  121. package/package.json +49 -4
@@ -0,0 +1,245 @@
1
+ "use strict";
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.vrf10_batch_ed25519_sha512_ell2_verify_proof = exports.vrf10_batch_ed25519_sha512_ell2_generate_proof = exports.vrf10_batch_ed25519_sha512_ell2_proof_to_hash = void 0;
20
+ var uint8array_utils_1 = require("@harmoniclabs/uint8array-utils");
21
+ var sha2_512_1 = require("../sha2_512.js");
22
+ var curves_1 = require("./curves.js");
23
+ var vrf10_1 = require("./vrf10.js");
24
+ /**
25
+ 4.4. RSA-FDH-VRF Ciphersuites
26
+
27
+ This document defines RSA-FDH-VRF-SHA256 as follows:
28
+
29
+ suite_string = 0x01.
30
+ The hash function Hash is SHA-256 as specified in [RFC6234], with hLen = 32.
31
+ MGF_salt = I2OSP(k, 4) || I2OSP(n, k).
32
+
33
+ This document defines RSA-FDH-VRF-SHA384 as follows:
34
+
35
+ suite_string = 0x02.
36
+ The hash function Hash is SHA-384 as specified in [RFC6234], with hLen = 48.
37
+ MGF_salt = I2OSP(k, 4) || I2OSP(n, k).
38
+
39
+ This document defines RSA-FDH-VRF-SHA512 as follows:
40
+
41
+ suite_string = 0x10.
42
+ The hash function Hash is SHA-512 as specified in [RFC6234], with hLen = 64.
43
+ MGF_salt = I2OSP(k, 4) || I2OSP(n, k).
44
+
45
+ */
46
+ var SUITE = 0x04;
47
+ /*
48
+ /// Temporary SUITE identifier, as TAI uses 0x03
49
+ pub const SUITE_TEMP: &[u8] = &[0x03];
50
+ */
51
+ var SUITE_TEMP = 0x03;
52
+ var ONE = 0x01;
53
+ var TWO = 0x02;
54
+ var THREE = 0x03;
55
+ function vrf10_batch_ed25519_sha512_ell2_proof_to_hash(proof) {
56
+ var compressed_gamma_cofac = proof.gamma.mul_by_cofactor().compress();
57
+ var input = new Uint8Array(3 + compressed_gamma_cofac.length);
58
+ input[0] = SUITE_TEMP;
59
+ input[1] = THREE;
60
+ input.set(compressed_gamma_cofac, 2);
61
+ input[2 + compressed_gamma_cofac.length] = 0;
62
+ return (0, sha2_512_1.sha2_512_sync)(input);
63
+ }
64
+ exports.vrf10_batch_ed25519_sha512_ell2_proof_to_hash = vrf10_batch_ed25519_sha512_ell2_proof_to_hash;
65
+ function vrf10_batch_ed25519_sha512_ell2_generate_proof(secret_key, public_key, alpha_string) {
66
+ var _a = __read((0, vrf10_1.extend_secret_key)(secret_key), 2), secret_scalar = _a[0], secret_extension = _a[1];
67
+ var h = (0, vrf10_1.vrf10_ed25519_sha512_ell2_hash_to_curve)(public_key, alpha_string);
68
+ var compressed_h = h.compress();
69
+ var gamma = h.scalarMul(secret_scalar);
70
+ var compressed_gamma = gamma.compress();
71
+ var k = (0, vrf10_1.vrf10_ed25519_sha512_ell2_nonce_generation)(secret_extension, compressed_h);
72
+ var announcement_base = curves_1.ED25519_BASEPOINT_POINT.scalarMul(k);
73
+ var compressed_announcement_base = announcement_base.compress();
74
+ var announcement_h = h.scalarMul(k);
75
+ var compressed_announcement_h = announcement_h.compress();
76
+ // Self::compute_challenge(&compressed_h, &gamma, &announcement_base, &announcement_h);
77
+ var challenge = (0, vrf10_1.vrf10_ed25519_sha512_ell2_compute_challenge)(compressed_h, compressed_gamma, compressed_announcement_base, compressed_announcement_h);
78
+ var response = (0, curves_1.add_scalars)(k, (0, curves_1.mul_scalars)(challenge, secret_scalar));
79
+ return {
80
+ gamma: gamma,
81
+ u_point: announcement_base,
82
+ v_point: announcement_h,
83
+ response: response
84
+ };
85
+ }
86
+ exports.vrf10_batch_ed25519_sha512_ell2_generate_proof = vrf10_batch_ed25519_sha512_ell2_generate_proof;
87
+ function vrf10_batch_ed25519_sha512_ell2_verify_proof(public_key, alpha_string, proof) {
88
+ var h = (0, vrf10_1.vrf10_ed25519_sha512_ell2_hash_to_curve)(public_key, alpha_string);
89
+ var compressed_h = h.compress();
90
+ var decompressed_pk = (0, curves_1.decompressCompressedEdwardsY)(public_key); // pointFromBytes( public_key );
91
+ if (!decompressed_pk || decompressed_pk.is_small_order())
92
+ return false;
93
+ var gamma = proof.gamma;
94
+ var compressed_gamma = gamma.compress();
95
+ var compressed_announcement_base = proof.u_point.compress();
96
+ var compressed_announcement_h = proof.v_point.compress();
97
+ // Scalar
98
+ var proof_challenge = (0, vrf10_1.vrf10_ed25519_sha512_ell2_compute_challenge)(compressed_h, compressed_gamma, compressed_announcement_base, compressed_announcement_h);
99
+ var U = curves_1.EdwardsPoint.vartime_double_scalar_mul_basepoint((0, curves_1.negate_scalar)(proof_challenge), decompressed_pk, proof.response);
100
+ /*
101
+ let V = EdwardsPoint::vartime_multiscalar_mul(
102
+ iter::once(self.response).chain(iter::once(self.challenge.neg())),
103
+ iter::once(h).chain(iter::once(self.gamma)),
104
+ );
105
+ */
106
+ var V = curves_1.EdwardsPoint.vartime_multiscalar_mul([proof.response, (0, curves_1.negate_scalar)(proof_challenge)], [h, gamma]);
107
+ // const computed_challenge = vrf10_ed25519_sha512_ell2_compute_challenge(
108
+ // compressed_h,
109
+ // proof.gamma.compress(),
110
+ // U.compress(),
111
+ // V.compress()
112
+ // );
113
+ return ((0, uint8array_utils_1.uint8ArrayEq)(U.compress(), compressed_announcement_base) &&
114
+ (0, uint8array_utils_1.uint8ArrayEq)(V.compress(), compressed_announcement_h));
115
+ }
116
+ exports.vrf10_batch_ed25519_sha512_ell2_verify_proof = vrf10_batch_ed25519_sha512_ell2_verify_proof;
117
+ /*
118
+ /// `proof_to_hash` function, following the 10 specification. This computes the output of the VRF
119
+ /// function. In particular, this function computes
120
+ /// SHA512(SUITE || THREE || Gamma || ZERO)
121
+ fn proof_to_hash(&self) -> [u8; OUTPUT_SIZE] {
122
+ let mut output = [0u8; OUTPUT_SIZE];
123
+ let gamma_cofac = self.gamma.mul_by_cofactor();
124
+ let mut hash = Sha512::new();
125
+ hash.update(SUITE_TEMP);
126
+ hash.update(THREE);
127
+ hash.update(gamma_cofac.compress().as_bytes());
128
+ hash.update(ZERO);
129
+
130
+ output.copy_from_slice(hash.finalize().as_slice());
131
+ output
132
+ }
133
+ */
134
+ function vrf10_proof_to_hash(proof) {
135
+ var compressed_gamma_cofac = proof.gamma.mul_by_cofactor().compress();
136
+ var hashInput = new Uint8Array(3 + compressed_gamma_cofac.length);
137
+ hashInput[0] = SUITE_TEMP;
138
+ hashInput[1] = 0x03;
139
+ hashInput.set(compressed_gamma_cofac, 2);
140
+ hashInput[2 + compressed_gamma_cofac.length] = 0;
141
+ return (0, sha2_512_1.sha2_512_sync)(hashInput);
142
+ }
143
+ /*
144
+ function vrfProofToBytesProof( proof: IVrfBatchProof10 )
145
+ {
146
+ return {
147
+ gamma: bigpointToUint8Array( proof.gamma ),
148
+ challange: encodeInt( proof.challange ),
149
+ response: encodeInt( proof.response ),
150
+ }
151
+ }
152
+ //*/
153
+ function edwards_hash_from_bytes(bytes) {
154
+ var hash = (0, sha2_512_1.sha2_512_sync)(bytes);
155
+ var res = hash.slice(0, 32);
156
+ /*
157
+ //////////////////////////////////////////////////////////////////////////////////////
158
+ //// We need to be compatible with the third version of the VRF standard, which ////
159
+ //// always unsets the sign bit. Given the visibility of the functions used to ////
160
+ //// compute the ristretto mapping, we need to fork the original repo, to unset ////
161
+ //// bit in this function. This fork should never be used, unless one needs to be ////
162
+ //// compatible with the version 3 of the VRF standard. ////
163
+ //// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-10#section-5.4.1.2 ////
164
+ //// The goal is to be always a single commit ahead of version 3.2.0, and this ////
165
+ //// single commit only changes the following line, and a disclaimer in the ////
166
+ //// README. ////
167
+ //////////////////////////////////////////////////////////////////////////////////////
168
+ let sign_bit = 0;
169
+
170
+ let fe = FieldElement::from_bytes(&res);
171
+
172
+ let M1 = crate::montgomery::elligator_encode(&fe);
173
+ let E1_opt = M1.to_edwards(sign_bit);
174
+
175
+ E1_opt
176
+ .expect("Montgomery conversion to Edwards point in Elligator failed")
177
+ .mul_by_cofactor()
178
+ */
179
+ var sign_bit = 0;
180
+ var fe = curves_1.FieldElem51.fromBytes(res);
181
+ var M1 = curves_1.FieldElem51.elligator_encode(fe);
182
+ var E1_opt = M1.to_edwards(sign_bit);
183
+ if (!E1_opt) {
184
+ throw new Error("Montgomery conversion to Edwards point in Elligator failed");
185
+ }
186
+ return E1_opt.mul_by_cofactor();
187
+ }
188
+ /*
189
+ // Construct a `Scalar` from the low 255 bits of a 256-bit integer.
190
+ ///
191
+ /// This function is intended for applications like X25519 which
192
+ /// require specific bit-patterns when performing scalar
193
+ /// multiplication.
194
+ pub const fn from_bits(bytes: [u8; 32]) -> Scalar {
195
+ let mut s = Scalar{bytes};
196
+ // Ensure that s < 2^255 by masking the high bit
197
+ s.bytes[31] &= 0b0111_1111;
198
+
199
+ s
200
+ }
201
+ */
202
+ function scalar_from_bits_inplace(bytes) {
203
+ bytes[31] &= 127;
204
+ }
205
+ /**
206
+ * https://datatracker.ietf.org/doc/html/rfc9381#section-5.1
207
+ *
208
+ * test cases:
209
+ * https://datatracker.ietf.org/doc/html/rfc9381#name-ecvrf-edwards25519-sha512-e
210
+ * https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-10#appendix-A.4
211
+ *
212
+ * /// Generate a new VRF proof following the 10 standard. It proceeds as follows:
213
+ * /// - Extend the secret key, into a `secret_scalar` and the `secret_extension`
214
+ * /// - Evaluate `hash_to_curve` over PK || alpha_string to get `H`
215
+ * /// - Compute `Gamma = secret_scalar * H`
216
+ * /// - Generate a proof of discrete logarithm equality between `PK` and `Gamma` with
217
+ * /// bases `generator` and `H` respectively.
218
+ *
219
+ * /
220
+ function vrf_ed25519_sha512_ell2_prove(sk: Uint8Array, alpha: Uint8Array): IVrfBatchProof10
221
+ {
222
+ /// - Extend the secret key, into a `secret_scalar` and the `secret_extension`
223
+ const [ scalar, extension ] = getExtendEd25519PrivateKeyComponents_sync( sk );
224
+ // 1. Use SK to derive the VRF secret scalar x and the VRF public key Y = x*B
225
+ /// - Evaluate `hash_to_curve` over PK || alpha_string to get `H`
226
+ const pk = new Uint8Array( deriveEd25519PublicKey_sync( sk ) );
227
+ const H = vrf_ed25519_sha512_ell2_hash_to_curve( pk, alpha );
228
+
229
+ const H_point = pointFromBytes( H );
230
+ const gamma = scalarMul( H_point, scalar );
231
+ const compressed_gamma = bigpointToUint8Array( gamma );
232
+ const k = vrf_ed25519_sha512_ell2_nonce_generation( extension, H );
233
+ const announcement_1 = bigpointToUint8Array( scalarMultBase( k ) );
234
+ const announcement_2 = bigpointToUint8Array( scalarMul( H_point, k ) );
235
+ const challange = scalarFromBytes(
236
+ vrf_ed25519_sha512_ell2_challenge_generation( H, compressed_gamma, announcement_1, announcement_2 )
237
+ );
238
+ const response = k + challange * scalar;
239
+ return {
240
+ gamma,
241
+ challange,
242
+ response
243
+ };
244
+ }
245
+ //*/
@@ -0,0 +1,4 @@
1
+ export declare function verifyEcdsaSecp256k1Signature(vk: Uint8Array, // 33 bytes
2
+ messageHash: Uint8Array, // 32 bytes
3
+ signature: Uint8Array): boolean;
4
+ export declare function verifySchnorrSecp256k1Signature(pubKey: Uint8Array, messageHash: Uint8Array, signature: Uint8Array): boolean;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verifySchnorrSecp256k1Signature = exports.verifyEcdsaSecp256k1Signature = void 0;
4
+ var secp256k1_1 = require("./noble/secp256k1.js");
5
+ function verifyEcdsaSecp256k1Signature(vk, // 33 bytes
6
+ messageHash, // 32 bytes
7
+ signature) {
8
+ if (!(vk instanceof Uint8Array &&
9
+ messageHash instanceof Uint8Array &&
10
+ signature instanceof Uint8Array &&
11
+ vk.length === 33 &&
12
+ messageHash.length === 32 &&
13
+ signature.length === 64))
14
+ throw new TypeError("invalid arguments passed to 'verifyEcdsaSecp256k1Signature'");
15
+ var vkHead = vk[0];
16
+ if (!(vkHead === 0x02 ||
17
+ vkHead === 0x03))
18
+ throw new Error("plutus-machine only supports compressed public keys for 'verifyEcdsaSecp256k1Signature'");
19
+ return (0, secp256k1_1.verifySecp256k1)(signature, messageHash, vk);
20
+ }
21
+ exports.verifyEcdsaSecp256k1Signature = verifyEcdsaSecp256k1Signature;
22
+ function verifySchnorrSecp256k1Signature(pubKey, messageHash, signature) {
23
+ if (!(pubKey instanceof Uint8Array &&
24
+ messageHash instanceof Uint8Array &&
25
+ signature instanceof Uint8Array &&
26
+ pubKey.length === 32 &&
27
+ signature.length === 64))
28
+ throw new TypeError("invalid arguments passed to 'verifyEcdsaSecp256k1Signature'");
29
+ // signature 64
30
+ // pubKey 32
31
+ return (0, secp256k1_1.verifySchnorr)(signature, messageHash, pubKey);
32
+ }
33
+ exports.verifySchnorrSecp256k1Signature = verifySchnorrSecp256k1Signature;
@@ -0,0 +1,16 @@
1
+ import { byte } from "./types.js";
2
+ declare function nativeSha2_256(data: Uint8Array | ArrayBuffer): Promise<Uint8Array>;
3
+ /**
4
+ * getulates sha2-256 (32bytes) hash of a list of uint8 numbers.
5
+ * Result is also a list of uint8 number.
6
+ * @example
7
+ * bytesToHex(sha2_256([0x61, 0x62, 0x63])) => "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"
8
+ * @example
9
+ * sha2_256(textToBytes("Hello, World!")) => [223, 253, 96, 33, 187, 43, 213, 176, 175, 103, 98, 144, 128, 158, 195, 165, 49, 145, 221, 129, 199, 247, 10, 75, 40, 104, 138, 54, 33, 130, 152, 111]
10
+ * @param {uint5[]} bytes - list of uint8 numbers
11
+ * @returns {number[]} - list of uint8 numbers
12
+ */
13
+ export declare function sha2_256_sync(_bytes: byte[] | Uint8Array | ArrayBuffer): Uint8Array;
14
+ export declare const sha2_256: typeof nativeSha2_256;
15
+ export declare const hasNativeSha2_256: boolean;
16
+ export {};