@@ -1756,6 +1756,7 @@ export default class Point extends BasePoint {
17561756 x: BigNumber | null ;
17571757 y: BigNumber | null ;
17581758 inf: boolean ;
1759+ static _assertOnCurve(p : Point ): Point
17591760 static fromDER(bytes : number []): Point
17601761 static fromString(str : string ): Point
17611762 static fromX(x : BigNumber | number | number [] | string , odd : boolean ): Point
@@ -5031,9 +5032,9 @@ encoding, and changing it would render previously encrypted data
50315032undecryptable by newer versions of the library .
50325033
50335034` ` ` ts
5034- export function AESGCM(plainText: number[] , initializationVector: number[] , key: number[] ): {
5035- result: number[] ;
5036- authenticationTag: number[] ;
5035+ export function AESGCM(plainText: Bytes , initializationVector: Bytes , key: Bytes ): {
5036+ result: Bytes ;
5037+ authenticationTag: Bytes ;
50375038}
50385039` ` `
50395040
@@ -5043,7 +5044,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
50435044### Function : AESGCMDecrypt
50445045
50455046` ` ` ts
5046- export function AESGCMDecrypt(cipherText: number[] , initializationVector: number[] , authenticationTag: number[] , key: number[] ): number[] | null
5047+ export function AESGCMDecrypt(cipherText: Bytes , initializationVector: Bytes , authenticationTag: Bytes , key: Bytes ): Bytes | null
50475048` ` `
50485049
50495050Links : [API ](#api ), [Interfaces ](#interfaces ), [Classes ](#classes ), [Functions ](#functions ), [Types ](#types ), [Enums ](#enums ), [Variables ](#variables )
@@ -5070,7 +5071,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
50705071### Function : ghash
50715072
50725073` ` ` ts
5073- export function ghash(input: number[] , hashSubKey: number[] ): number[]
5074+ export function ghash(input: Bytes , hashSubKey: Bytes ): Bytes
50745075` ` `
50755076
50765077Links : [API ](#api ), [Interfaces ](#interfaces ), [Classes ](#classes ), [Functions ](#functions ), [Types ](#types ), [Enums ](#enums ), [Variables ](#variables )
@@ -5491,20 +5492,20 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
54915492
54925493` ` ` ts
54935494biModPow = (base : bigint , exp : bigint ): bigint => {
5494- let result = BI_ONE ;
5495+ let result = 1 n ;
54955496 base = biMod (base );
5496- let e = exp ;
5497- while (e > BI_ZERO ) {
5498- if ((e & BI_ONE ) === BI_ONE )
5497+ while (exp > 0n ) {
5498+ if ((exp & 1n ) !== 0n ) {
54995499 result = biModMul (result , base );
5500+ }
55005501 base = biModMul (base , base );
5501- e >>= BI_ONE ;
5502+ exp >>= 1 n ;
55025503 }
55035504 return result ;
55045505}
55055506` ` `
55065507
5507- See also: [BI_ONE](./primitives.md#variable-bi_one), [BI_ZERO](./primitives.md#variable-bi_zero), [ biMod](./primitives.md#variable-bimod), [biModMul](./primitives.md#variable-bimodmul)
5508+ See also: [biMod](./primitives.md#variable-bimod), [biModMul](./primitives.md#variable-bimodmul)
55085509
55095510Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)
55105511
@@ -5525,7 +5526,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
55255526` ` ` ts
55265527biModSqrt = (a : bigint ): bigint | null => {
55275528 const r = biModPow (a , P_PLUS1_DIV4 );
5528- return biModMul (r , r ) === biMod (a ) ? r : null ;
5529+ if (biModMul (r , r ) !== biMod (a )) {
5530+ return null ;
5531+ }
5532+ return r ;
55295533}
55305534` ` `
55315535
@@ -5579,11 +5583,11 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
55795583### Variable: exclusiveOR
55805584
55815585` ` ` ts
5582- exclusiveOR = function (block0 : number [] , block1 : number [] ): number [] {
5586+ exclusiveOR = function (block0 : Bytes , block1 : Bytes ): Bytes {
55835587 const len = block0 .length ;
5584- const result = new Array (len );
5588+ const result = new Uint8Array (len );
55855589 for (let i = 0 ; i < len ; i ++ ) {
5586- result [i ] = block0 [i ] ^ block1 [i ];
5590+ result [i ] = block0 [i ] ^ ( block1 [i ] ?? 0 ) ;
55875591 }
55885592 return result ;
55895593}
@@ -5730,15 +5734,11 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
57305734### Variable: incrementLeastSignificantThirtyTwoBits
57315735
57325736` ` ` ts
5733- incrementLeastSignificantThirtyTwoBits = function (block : number []): number [] {
5734- let i;
5737+ incrementLeastSignificantThirtyTwoBits = function (block : Bytes ): Bytes {
57355738 const result = block .slice ();
5736- for (i = 15 ; i !== 11 ; i -- ) {
5737- result [i ] = result [i ] + 1 ;
5738- if (result [i ] === 256 ) {
5739- result [i ] = 0 ;
5740- }
5741- else {
5739+ for (let i = 15 ; i !== 11 ; i -- ) {
5740+ result [i ] = (result [i ] + 1 ) & 255 ;
5741+ if (result [i ] !== 0 ) {
57425742 break ;
57435743 }
57445744 }
@@ -5910,7 +5910,7 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
59105910### Variable: multiply
59115911
59125912` ` ` ts
5913- multiply = function (block0 : number [] , block1 : number [] ): number [] {
5913+ multiply = function (block0 : Bytes , block1 : Bytes ): Bytes {
59145914 const v = block1 .slice ();
59155915 const z = createZeroBlock (16 );
59165916 for (let i = 0 ; i < 16 ; i ++ ) {
@@ -5939,11 +5939,10 @@ Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](
59395939### Variable: rightShift
59405940
59415941` ` ` ts
5942- rightShift = function (block : number []): number [] {
5943- let i: number ;
5942+ rightShift = function (block : Bytes ): Bytes {
59445943 let carry = 0 ;
59455944 let oldCarry = 0 ;
5946- for (i = 0 ; i < block .length ; i ++ ) {
5945+ for (let i = 0 ; i < block .length ; i ++ ) {
59475946 oldCarry = carry ;
59485947 carry = block [i ] & 1 ;
59495948 block [i ] = block [i ] >> 1 ;
0 commit comments