From 7b57a931ef880a76e9cb77501e1034b4be9313f9 Mon Sep 17 00:00:00 2001 From: Ugljesa Jovanovic Date: Sat, 20 Jul 2019 18:59:37 +0200 Subject: [PATCH] A bit of cleanup and README update --- CHANGELOG.md | 2 +- README.md | 66 +- crypto-core/node_modules/crypto-core.js | 585 ++++++------------ crypto-core/node_modules/crypto-core.js.map | 2 +- crypto-core/node_modules/crypto-core.meta.js | 2 +- .../kotlin/crypto/blake2b/blake2b.kjsm | Bin 2040 -> 1892 bytes .../com/ionspin/kotlin/crypto/crypto.kjsm | Bin 586 -> 665 bytes .../com/ionspin/kotlin/crypto/sha/sha.kjsm | Bin 1626 -> 1491 bytes .../com/ionspin/kotlin/crypto/Config.kt | 26 + .../ionspin/kotlin/crypto/blake2b/Blake2b.kt | 33 +- .../com/ionspin/kotlin/crypto/sha/Sha256.kt | 311 +++++----- .../com/ionspin/kotlin/crypto/sha/Sha512.kt | 411 +++++++----- .../com/ionspin/kotlin/crypto/ReadmeTest.kt | 100 +++ .../kotlin/crypto/blake2b/Blake2BTest.kt | 21 - .../crypto/blake2b/Blake2bInstanceTest.kt | 4 - .../ionspin/kotlin/crypto/sha/Sha256Test.kt | 7 +- .../ionspin/kotlin/crypto/sha/Sha512Test.kt | 17 +- 17 files changed, 821 insertions(+), 766 deletions(-) create mode 100644 crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/Config.kt create mode 100644 crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/ReadmeTest.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index fc3749e..0d5abb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,6 @@ -#### Initial release/BigInteger - 0.0.1 - 20.7.2019 +#### Initial release - 0.0.1 - 20.7.2019 - Implemented Blake2b and SHA256/512 diff --git a/README.md b/README.md index 3686324..64ef26a 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,23 @@ This is an extremely early release, currently only consisting of Blake2b and SHA **The API will move fast and break often until v1.0** -Tenative plan is to add 25519 curve based signing and key exchange next. +Make SHA hashes "updateable" like Blake2b + +After that tenative plan is to add 25519 curve based signing and key exchange next. ## Should I use this in production? No, it's untested and unproven. +## Supported + +## Hashing functions +* Blake2b +* SHA512 +* SHA256 + +More to come. + ## Integration #### Gradle @@ -34,7 +45,58 @@ implementation("com.ionspin.kotlin:crypto:0.0.1-SNAPSHOT") ## Usage -To be continued... +### Blake2b + +You can use Blake 2b in two modes + +#### Using a `Blake2b` object +You need to deliver the complete data that is to be hashed in one go + +```kotlin +val input = "abc" +val result = Blake2b.digest(input) +``` + +Result is returned as a `Array` + +#### Using a `Blake2b` instance +You can create an instance and feed the data by using `update(input : Array)` call. Once all data is supplied, +you should call `digest()` or `digestString()` convinence method that converts the `Array` into hexadecimal string. + +If you want to use Blake2b with a key, you should supply it when creating the `Blake2b` instance. + +```kotlin +val test = "abc" +val key = "key" +val blake2b = Blake2b(key) +blake2b.update(test) +val result = blake2b.digest() +``` + +After digest is called, the instance is reset and can be reused (Keep in mind key stays the same for the particular instance). +### SHA2 (SHA256 and SHA512) + +You need to deliver the complete data that is to be hashed in one go. You can either provide the `Array` as input +or `String`. Result is always returned as `Array` (At least in verision 0.0.1) + +```kotlin +val input = "abc" +val result = Sha256.digest(input) +``` + +```kotlin +val input ="abc" +val result = Sha512.digest(message = input.encodeToByteArray().map { it.toUByte() }.toTypedArray()) +``` + +Result is returned as a `Array` + + + + + + + \ No newline at end of file diff --git a/crypto-core/node_modules/crypto-core.js b/crypto-core/node_modules/crypto-core.js index f2c2c74..a2b41e2 100644 --- a/crypto-core/node_modules/crypto-core.js +++ b/crypto-core/node_modules/crypto-core.js @@ -1,6 +1,7 @@ -(function (_, Kotlin, $module$bignum, $module$kotlinx_coroutines_core) { +(function (_, Kotlin, $module$bignum) { 'use strict'; var $$importsForInline$$ = _.$$importsForInline$$ || (_.$$importsForInline$$ = {}); + var Kind_OBJECT = Kotlin.Kind.OBJECT; var Kind_INTERFACE = Kotlin.Kind.INTERFACE; var chunked = Kotlin.kotlin.collections.chunked_ba2ldo$; var joinToString = Kotlin.kotlin.collections.joinToString_fmv235$; @@ -13,7 +14,6 @@ var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_ww73n8$; var UInt_init = Kotlin.kotlin.UInt; var ULong_init = Kotlin.kotlin.ULong; - var Unit = Kotlin.kotlin.Unit; var encodeToByteArray = Kotlin.kotlin.text.encodeToByteArray_pdl1vz$; var toList = Kotlin.kotlin.collections.toList_7wnvza$; var UByte = Kotlin.kotlin.UByte; @@ -21,14 +21,7 @@ var toList_0 = Kotlin.kotlin.collections.toList_us0mfu$; var IllegalStateException_init = Kotlin.kotlin.IllegalStateException_init_pdl1vj$; var until = Kotlin.kotlin.ranges.until_dqglrj$; - var Kind_OBJECT = Kotlin.Kind.OBJECT; var RuntimeException_init = Kotlin.kotlin.RuntimeException_init_pdl1vj$; - var COROUTINE_SUSPENDED = Kotlin.kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED; - var CoroutineImpl = Kotlin.kotlin.coroutines.CoroutineImpl; - var launch = $module$kotlinx_coroutines_core.kotlinx.coroutines.launch_s496o7$; - var Job = $module$kotlinx_coroutines_core.kotlinx.coroutines.Job_5dx9e$; - var coroutines = $module$kotlinx_coroutines_core.kotlinx.coroutines; - var CoroutineScope = $module$kotlinx_coroutines_core.kotlinx.coroutines.CoroutineScope_1fupul$; var BigInteger = $module$bignum.com.ionspin.kotlin.bignum.integer.BigInteger; var Kind_CLASS = Kotlin.Kind.CLASS; var Array_0 = Array; @@ -41,9 +34,22 @@ var addAll = Kotlin.kotlin.collections.addAll_ipc267$; var emptyList = Kotlin.kotlin.collections.emptyList_287e2$; var slice = Kotlin.kotlin.collections.slice_l0m14x$; - var Result = Kotlin.kotlin.Result; - var intercepted = Kotlin.kotlin.coroutines.intrinsics.intercepted_f9mg25$; - var SafeContinuation_init = Kotlin.kotlin.coroutines.SafeContinuation_init_wj8d80$; + function Config() { + Config_instance = this; + this.DEBUG = false; + } + Config.$metadata$ = { + kind: Kind_OBJECT, + simpleName: 'Config', + interfaces: [] + }; + var Config_instance = null; + function Config_getInstance() { + if (Config_instance === null) { + new Config(); + } + return Config_instance; + } function Hash() { } Hash.$metadata$ = { @@ -169,13 +175,6 @@ return copyToArray(it); }; }); - function suspendCoroutine$lambda(closure$block) { - return function (c) { - var safe = SafeContinuation_init(intercepted(c)); - closure$block(safe); - return safe.getOrThrow(); - }; - } function Blake2b(key, hashLength) { Blake2b$Companion_getInstance(); if (key === void 0) @@ -184,8 +183,6 @@ hashLength = 64; this.key = key; this.hashLength = hashLength; - this.job = Job(); - this.scope = CoroutineScope(coroutines.Dispatchers.Default.plus_1fupul$(this.job)); this.h = Blake2b$Companion_getInstance().iv_0.slice(); this.counter = BigInteger.Companion.ZERO; this.bufferCounter = 0; @@ -232,26 +229,9 @@ this.R3 = 16; this.R4 = 63; } - function Blake2b$Companion$mixRound$lambda$lambda(it) { - return it.toUpperCase(); - } Blake2b$Companion.prototype.mixRound_r29y2p$ = function (input, message, round) { var v = input; var selectedSigma = this.sigma_0[round % 10]; - var $receiver = v; - var destination = ArrayList_init($receiver.length); - var tmp$; - for (tmp$ = 0; tmp$ !== $receiver.length; ++tmp$) { - var item = $receiver[tmp$]; - destination.add_11rb$(toString_0(item, 16)); - } - var printout = chunked(destination, 3); - var tmp$_0; - tmp$_0 = printout.iterator(); - while (tmp$_0.hasNext()) { - var element = tmp$_0.next(); - println(joinToString(element, ' ', void 0, void 0, void 0, void 0, Blake2b$Companion$mixRound$lambda$lambda)); - } v = this.mix_0(v, 0, 4, 8, 12, message[selectedSigma[0]], message[selectedSigma[1]]); v = this.mix_0(v, 1, 5, 9, 13, message[selectedSigma[2]], message[selectedSigma[3]]); v = this.mix_0(v, 2, 6, 10, 14, message[selectedSigma[4]], message[selectedSigma[5]]); @@ -330,21 +310,22 @@ accumulator = acc; } var m = accumulator; - println('m'); - var destination = ArrayList_init(m.length); - var tmp$_3; - for (tmp$_3 = 0; tmp$_3 !== m.length; ++tmp$_3) { - var item = m[tmp$_3]; - destination.add_11rb$(toString_0(item, 16)); + if (Config_getInstance().DEBUG) { + var destination = ArrayList_init(m.length); + var tmp$_3; + for (tmp$_3 = 0; tmp$_3 !== m.length; ++tmp$_3) { + var item = m[tmp$_3]; + destination.add_11rb$(toString_0(item, 16)); + } + var printout = chunked(destination, 4); + var tmp$_4; + tmp$_4 = printout.iterator(); + while (tmp$_4.hasNext()) { + var element_0 = tmp$_4.next(); + println(joinToString(element_0, ' ', void 0, void 0, void 0, void 0, Blake2b$Companion$compress$lambda$lambda)); + } + println('Offset ' + offsetCounter); } - var printout = chunked(destination, 4); - var tmp$_4; - tmp$_4 = printout.iterator(); - while (tmp$_4.hasNext()) { - var element_0 = tmp$_4.next(); - println(joinToString(element_0, ' ', void 0, void 0, void 0, void 0, Blake2b$Companion$compress$lambda$lambda)); - } - println('Offset ' + offsetCounter); var $this_0 = v[12]; var other_0 = offsetCounter.ulongValue_6taknv$(); v[12] = new ULong_init($this_0.data.xor(other_0.data)); @@ -553,7 +534,7 @@ } return Blake2b$Companion_instance; } - Blake2b.prototype.updateBlocking_ummv9a$ = function (array) { + Blake2b.prototype.update_ummv9a$ = function (array) { if (array.length === 0) { throw RuntimeException_init('Updating with empty array is not allowed. If you need empty hash, just call digest without updating'); } @@ -613,7 +594,7 @@ } } }; - Blake2b.prototype.updateBlocking_61zpoe$ = function (input) { + Blake2b.prototype.update_61zpoe$ = function (input) { var $receiver = encodeToByteArray(input); var destination = ArrayList_init($receiver.length); var tmp$; @@ -621,7 +602,7 @@ var item = $receiver[tmp$]; destination.add_11rb$(new UByte(item)); } - this.updateBlocking_ummv9a$(copyToArray(destination)); + this.update_ummv9a$(copyToArray(destination)); }; Blake2b.prototype.appendToBuffer_0 = function (array, start) { arrayCopy(array, this.buffer, start, 0, array.length); @@ -630,183 +611,12 @@ Blake2b.prototype.consumeBlock_0 = function (block) { this.h = Blake2b$Companion_getInstance().compress_c1cv33$(this.h, block, this.counter, false); }; - function Coroutine$Blake2b$update$lambda$lambda(closure$array_0, this$Blake2b_0, closure$it_0, $receiver_0, controller, continuation_0) { - CoroutineImpl.call(this, continuation_0); - this.$controller = controller; - this.exceptionState_0 = 1; - this.local$closure$array = closure$array_0; - this.local$this$Blake2b = this$Blake2b_0; - this.local$closure$it = closure$it_0; - } - Coroutine$Blake2b$update$lambda$lambda.$metadata$ = { - kind: Kotlin.Kind.CLASS, - simpleName: null, - interfaces: [CoroutineImpl] - }; - Coroutine$Blake2b$update$lambda$lambda.prototype = Object.create(CoroutineImpl.prototype); - Coroutine$Blake2b$update$lambda$lambda.prototype.constructor = Coroutine$Blake2b$update$lambda$lambda; - Coroutine$Blake2b$update$lambda$lambda.prototype.doResume = function () { - do - try { - switch (this.state_0) { - case 0: - this.local$this$Blake2b.updateBlocking_ummv9a$(this.local$closure$array); - this.local$closure$it.resumeWith_tl1gpc$(new Result(Unit)); - return Unit; - case 1: - throw this.exception_0; - default:this.state_0 = 1; - throw new Error('State Machine Unreachable execution'); - } - } - catch (e) { - if (this.state_0 === 1) { - this.exceptionState_0 = this.state_0; - throw e; - } - else { - this.state_0 = this.exceptionState_0; - this.exception_0 = e; - } - } - while (true); - }; - function Blake2b$update$lambda$lambda(closure$array_0, this$Blake2b_0, closure$it_0) { - return function ($receiver_0, continuation_0, suspended) { - var instance = new Coroutine$Blake2b$update$lambda$lambda(closure$array_0, this$Blake2b_0, closure$it_0, $receiver_0, this, continuation_0); - if (suspended) - return instance; - else - return instance.doResume(null); - }; - } - function Blake2b$update$lambda(this$Blake2b, closure$array) { - return function (it) { - launch(this$Blake2b.scope, this$Blake2b.job, void 0, Blake2b$update$lambda$lambda(closure$array, this$Blake2b, it)); - return Unit; - }; - } - function Coroutine$update_ummv9a$($this, array_0, continuation_0) { - CoroutineImpl.call(this, continuation_0); - this.exceptionState_0 = 1; - this.$this = $this; - this.local$array = array_0; - } - Coroutine$update_ummv9a$.$metadata$ = { - kind: Kotlin.Kind.CLASS, - simpleName: null, - interfaces: [CoroutineImpl] - }; - Coroutine$update_ummv9a$.prototype = Object.create(CoroutineImpl.prototype); - Coroutine$update_ummv9a$.prototype.constructor = Coroutine$update_ummv9a$; - Coroutine$update_ummv9a$.prototype.doResume = function () { - do - try { - switch (this.state_0) { - case 0: - this.state_0 = 2; - this.result_0 = suspendCoroutine$lambda(Blake2b$update$lambda(this.$this, this.local$array))(this); - if (this.result_0 === COROUTINE_SUSPENDED) - return COROUTINE_SUSPENDED; - continue; - case 1: - throw this.exception_0; - case 2: - this.result_0; - return this.result_0; - default:this.state_0 = 1; - throw new Error('State Machine Unreachable execution'); - } - } - catch (e) { - if (this.state_0 === 1) { - this.exceptionState_0 = this.state_0; - throw e; - } - else { - this.state_0 = this.exceptionState_0; - this.exception_0 = e; - } - } - while (true); - }; - Blake2b.prototype.update_ummv9a$ = function (array_0, continuation_0, suspended) { - var instance = new Coroutine$update_ummv9a$(this, array_0, continuation_0); - if (suspended) - return instance; - else - return instance.doResume(null); - }; - function Coroutine$update_61zpoe$($this, input_0, continuation_0) { - CoroutineImpl.call(this, continuation_0); - this.exceptionState_0 = 1; - this.$this = $this; - this.local$input = input_0; - } - Coroutine$update_61zpoe$.$metadata$ = { - kind: Kotlin.Kind.CLASS, - simpleName: null, - interfaces: [CoroutineImpl] - }; - Coroutine$update_61zpoe$.prototype = Object.create(CoroutineImpl.prototype); - Coroutine$update_61zpoe$.prototype.constructor = Coroutine$update_61zpoe$; - Coroutine$update_61zpoe$.prototype.doResume = function () { - do - try { - switch (this.state_0) { - case 0: - var $receiver = encodeToByteArray(this.local$input); - var destination = ArrayList_init($receiver.length); - var tmp$; - for (tmp$ = 0; tmp$ !== $receiver.length; ++tmp$) { - var item = $receiver[tmp$]; - destination.add_11rb$(new UByte(item)); - } - - this.state_0 = 2; - this.result_0 = this.$this.update_ummv9a$(copyToArray(destination), this); - if (this.result_0 === COROUTINE_SUSPENDED) - return COROUTINE_SUSPENDED; - continue; - case 1: - throw this.exception_0; - case 2: - return; - default:this.state_0 = 1; - throw new Error('State Machine Unreachable execution'); - } - } - catch (e) { - if (this.state_0 === 1) { - this.exceptionState_0 = this.state_0; - throw e; - } - else { - this.state_0 = this.exceptionState_0; - this.exception_0 = e; - } - } - while (true); - }; - Blake2b.prototype.update_61zpoe$ = function (input_0, continuation_0, suspended) { - var instance = new Coroutine$update_61zpoe$(this, input_0, continuation_0); - if (suspended) - return instance; - else - return instance.doResume(null); - }; Blake2b.prototype.digest = function () { var lastBlockPadded = Blake2b$Companion_getInstance().padToBlock_0(this.buffer); this.counter = this.counter.plus_za3lpa$(this.bufferCounter); Blake2b$Companion_getInstance().compress_c1cv33$(this.h, lastBlockPadded, this.counter, true); var result = Blake2b$Companion_getInstance().formatResult_0(this.h); - var destination = ArrayList_init(result.length); - var tmp$; - for (tmp$ = 0; tmp$ !== result.length; ++tmp$) { - var item = result[tmp$]; - destination.add_11rb$(toString(item, 16)); - } - println(joinToString(destination, '')); + this.reset_0(); return result; }; Blake2b.prototype.digestString = function () { @@ -819,6 +629,18 @@ } return joinToString(destination, ''); }; + Blake2b.prototype.reset_0 = function () { + this.h = Blake2b$Companion_getInstance().iv_0.slice(); + this.counter = BigInteger.Companion.ZERO; + this.bufferCounter = 0; + var array = Array_0(128); + var tmp$; + tmp$ = array.length - 1 | 0; + for (var i = 0; i <= tmp$; i++) { + array[i] = new UByte(0); + } + this.buffer = array; + }; Blake2b.$metadata$ = { kind: Kind_CLASS, simpleName: 'Blake2b', @@ -852,15 +674,6 @@ }); function Sha256() { Sha256$Companion_getInstance(); - this.h0 = new UInt_init(1779033703); - this.h1 = new UInt_init(-1150833019); - this.h2 = new UInt_init(1013904242); - this.h3 = new UInt_init(-1521486534); - this.h4 = new UInt_init(1359893119); - this.h5 = new UInt_init(-1694144372); - this.h6 = new UInt_init(528734635); - this.h7 = new UInt_init(1541459225); - this.k = [new UInt_init(1116352408), new UInt_init(1899447441), new UInt_init(-1245643825), new UInt_init(-373957723), new UInt_init(961987163), new UInt_init(1508970993), new UInt_init(-1841331548), new UInt_init(-1424204075), new UInt_init(-670586216), new UInt_init(310598401), new UInt_init(607225278), new UInt_init(1426881987), new UInt_init(1925078388), new UInt_init(-2132889090), new UInt_init(-1680079193), new UInt_init(-1046744716), new UInt_init(-459576895), new UInt_init(-272742522), new UInt_init(264347078), new UInt_init(604807628), new UInt_init(770255983), new UInt_init(1249150122), new UInt_init(1555081692), new UInt_init(1996064986), new UInt_init(-1740746414), new UInt_init(-1473132947), new UInt_init(-1341970488), new UInt_init(-1084653625), new UInt_init(-958395405), new UInt_init(-710438585), new UInt_init(113926993), new UInt_init(338241895), new UInt_init(666307205), new UInt_init(773529912), new UInt_init(1294757372), new UInt_init(1396182291), new UInt_init(1695183700), new UInt_init(1986661051), new UInt_init(-2117940946), new UInt_init(-1838011259), new UInt_init(-1564481375), new UInt_init(-1474664885), new UInt_init(-1035236496), new UInt_init(-949202525), new UInt_init(-778901479), new UInt_init(-694614492), new UInt_init(-200395387), new UInt_init(275423344), new UInt_init(430227734), new UInt_init(506948616), new UInt_init(659060556), new UInt_init(883997877), new UInt_init(958139571), new UInt_init(1322822218), new UInt_init(1537002063), new UInt_init(1747873779), new UInt_init(1955562222), new UInt_init(2024104815), new UInt_init(-2067236844), new UInt_init(-1933114872), new UInt_init(-1866530822), new UInt_init(-1538233109), new UInt_init(-1090935817), new UInt_init(-965641998)]; } function Sha256$Companion() { Sha256$Companion_instance = this; @@ -869,21 +682,29 @@ this.UINT_MASK = new UInt_init(-1); this.BYTE_MASK_FROM_ULONG = new ULong_init(Kotlin.Long.fromInt(255)); this.BYTE_MASK_FROM_UINT = new UInt_init(255); + this.iv = [new UInt_init(1779033703), new UInt_init(-1150833019), new UInt_init(1013904242), new UInt_init(-1521486534), new UInt_init(1359893119), new UInt_init(-1694144372), new UInt_init(528734635), new UInt_init(1541459225)]; + this.k = [new UInt_init(1116352408), new UInt_init(1899447441), new UInt_init(-1245643825), new UInt_init(-373957723), new UInt_init(961987163), new UInt_init(1508970993), new UInt_init(-1841331548), new UInt_init(-1424204075), new UInt_init(-670586216), new UInt_init(310598401), new UInt_init(607225278), new UInt_init(1426881987), new UInt_init(1925078388), new UInt_init(-2132889090), new UInt_init(-1680079193), new UInt_init(-1046744716), new UInt_init(-459576895), new UInt_init(-272742522), new UInt_init(264347078), new UInt_init(604807628), new UInt_init(770255983), new UInt_init(1249150122), new UInt_init(1555081692), new UInt_init(1996064986), new UInt_init(-1740746414), new UInt_init(-1473132947), new UInt_init(-1341970488), new UInt_init(-1084653625), new UInt_init(-958395405), new UInt_init(-710438585), new UInt_init(113926993), new UInt_init(338241895), new UInt_init(666307205), new UInt_init(773529912), new UInt_init(1294757372), new UInt_init(1396182291), new UInt_init(1695183700), new UInt_init(1986661051), new UInt_init(-2117940946), new UInt_init(-1838011259), new UInt_init(-1564481375), new UInt_init(-1474664885), new UInt_init(-1035236496), new UInt_init(-949202525), new UInt_init(-778901479), new UInt_init(-694614492), new UInt_init(-200395387), new UInt_init(275423344), new UInt_init(430227734), new UInt_init(506948616), new UInt_init(659060556), new UInt_init(883997877), new UInt_init(958139571), new UInt_init(1322822218), new UInt_init(1537002063), new UInt_init(1747873779), new UInt_init(1955562222), new UInt_init(2024104815), new UInt_init(-2067236844), new UInt_init(-1933114872), new UInt_init(-1866530822), new UInt_init(-1538233109), new UInt_init(-1090935817), new UInt_init(-965641998)]; } - Sha256$Companion.$metadata$ = { - kind: Kind_OBJECT, - simpleName: 'Companion', - interfaces: [] - }; - var Sha256$Companion_instance = null; - function Sha256$Companion_getInstance() { - if (Sha256$Companion_instance === null) { - new Sha256$Companion(); - } - return Sha256$Companion_instance; - } - Sha256.prototype.digest_ummv9a$ = function (message) { + Sha256$Companion.prototype.digest_61zpoe$ = function (message) { + var $receiver = encodeToByteArray(message); + var destination = ArrayList_init($receiver.length); var tmp$; + for (tmp$ = 0; tmp$ !== $receiver.length; ++tmp$) { + var item = $receiver[tmp$]; + destination.add_11rb$(new UByte(item)); + } + return this.digest_ummv9a$(copyToArray(destination)); + }; + Sha256$Companion.prototype.digest_ummv9a$ = function (message) { + var tmp$; + var h0 = {v: new UInt_init(1779033703)}; + var h1 = {v: new UInt_init(-1150833019)}; + var h2 = {v: new UInt_init(1013904242)}; + var h3 = {v: new UInt_init(-1521486534)}; + var h4 = {v: new UInt_init(1359893119)}; + var h5 = {v: new UInt_init(-1694144372)}; + var h6 = {v: new UInt_init(528734635)}; + var h7 = {v: new UInt_init(1541459225)}; var originalMessageSizeInBits = message.length * 8 | 0; var expandedRemainderOf512 = (originalMessageSizeInBits + 65 | 0) % 512; if (expandedRemainderOf512 === 0) @@ -961,14 +782,14 @@ var other_2 = w[i_2 - 7 | 0]; w[i_2] = new UInt_init((new UInt_init($this.data + other_2.data | 0)).data + s1.data | 0); } - var a = this.h0; - var b = this.h1; - var c = this.h2; - var d = this.h3; - var e = this.h4; - var f = this.h5; - var g = this.h6; - var h = this.h7; + var a = h0.v; + var b = h1.v; + var c = h2.v; + var d = h3.v; + var e = h4.v; + var f = h5.v; + var g = h6.v; + var h = h7.v; for (var i_3 = 0; i_3 < 64; i_3++) { var s1_0 = this.compressionSigma1_0(e); var ch = this.ch_0(e, f, g); @@ -989,102 +810,91 @@ b = a; a = new UInt_init(temp1.data + temp2.data | 0); } - var $this_2 = this.h0; + var $this_2 = h0.v; var other_5 = a; - this.h0 = new UInt_init($this_2.data + other_5.data | 0); - var $this_3 = this.h1; + h0.v = new UInt_init($this_2.data + other_5.data | 0); + var $this_3 = h1.v; var other_6 = b; - this.h1 = new UInt_init($this_3.data + other_6.data | 0); - var $this_4 = this.h2; + h1.v = new UInt_init($this_3.data + other_6.data | 0); + var $this_4 = h2.v; var other_7 = c; - this.h2 = new UInt_init($this_4.data + other_7.data | 0); - var $this_5 = this.h3; + h2.v = new UInt_init($this_4.data + other_7.data | 0); + var $this_5 = h3.v; var other_8 = d; - this.h3 = new UInt_init($this_5.data + other_8.data | 0); - var $this_6 = this.h4; + h3.v = new UInt_init($this_5.data + other_8.data | 0); + var $this_6 = h4.v; var other_9 = e; - this.h4 = new UInt_init($this_6.data + other_9.data | 0); - var $this_7 = this.h5; + h4.v = new UInt_init($this_6.data + other_9.data | 0); + var $this_7 = h5.v; var other_10 = f; - this.h5 = new UInt_init($this_7.data + other_10.data | 0); - var $this_8 = this.h6; + h5.v = new UInt_init($this_7.data + other_10.data | 0); + var $this_8 = h6.v; var other_11 = g; - this.h6 = new UInt_init($this_8.data + other_11.data | 0); - var $this_9 = this.h7; + h6.v = new UInt_init($this_8.data + other_11.data | 0); + var $this_9 = h7.v; var other_12 = h; - this.h7 = new UInt_init($this_9.data + other_12.data | 0); + h7.v = new UInt_init($this_9.data + other_12.data | 0); } - var $receiver_0 = this.toPaddedByteArray_1(this.h0); - var elements_0 = this.toPaddedByteArray_1(this.h1); + var $receiver_0 = this.toPaddedByteArray_1(h0.v); + var elements_0 = this.toPaddedByteArray_1(h1.v); var $receiver_1 = $receiver_0.concat(elements_0); - var elements_1 = this.toPaddedByteArray_1(this.h2); + var elements_1 = this.toPaddedByteArray_1(h2.v); var $receiver_2 = $receiver_1.concat(elements_1); - var elements_2 = this.toPaddedByteArray_1(this.h3); + var elements_2 = this.toPaddedByteArray_1(h3.v); var $receiver_3 = $receiver_2.concat(elements_2); - var elements_3 = this.toPaddedByteArray_1(this.h4); + var elements_3 = this.toPaddedByteArray_1(h4.v); var $receiver_4 = $receiver_3.concat(elements_3); - var elements_4 = this.toPaddedByteArray_1(this.h5); + var elements_4 = this.toPaddedByteArray_1(h5.v); var $receiver_5 = $receiver_4.concat(elements_4); - var elements_5 = this.toPaddedByteArray_1(this.h6); + var elements_5 = this.toPaddedByteArray_1(h6.v); var $receiver_6 = $receiver_5.concat(elements_5); - var elements_6 = this.toPaddedByteArray_1(this.h7); + var elements_6 = this.toPaddedByteArray_1(h7.v); var digest = $receiver_6.concat(elements_6); - this.reset_0(); return digest; }; - Sha256.prototype.reset_0 = function () { - this.h0 = new UInt_init(1779033703); - this.h1 = new UInt_init(-1150833019); - this.h2 = new UInt_init(1013904242); - this.h3 = new UInt_init(-1521486534); - this.h4 = new UInt_init(1359893119); - this.h5 = new UInt_init(-1694144372); - this.h6 = new UInt_init(528734635); - this.h7 = new UInt_init(1541459225); - }; - Sha256.prototype.scheduleSigma0_0 = function (value) { + Sha256$Companion.prototype.scheduleSigma0_0 = function (value) { var $this = rotateRight(value, 7); var other = rotateRight(value, 18); var tmp$ = new UInt_init($this.data ^ other.data); var other_0 = new UInt_init(value.data >>> 3); return new UInt_init(tmp$.data ^ other_0.data); }; - Sha256.prototype.scheduleSigma1_0 = function (value) { + Sha256$Companion.prototype.scheduleSigma1_0 = function (value) { var $this = rotateRight(value, 17); var other = rotateRight(value, 19); var tmp$ = new UInt_init($this.data ^ other.data); var other_0 = new UInt_init(value.data >>> 10); return new UInt_init(tmp$.data ^ other_0.data); }; - Sha256.prototype.compressionSigma0_0 = function (a) { + Sha256$Companion.prototype.compressionSigma0_0 = function (a) { var $this = rotateRight(a, 2); var other = rotateRight(a, 13); var $this_0 = new UInt_init($this.data ^ other.data); var other_0 = rotateRight(a, 22); return new UInt_init($this_0.data ^ other_0.data); }; - Sha256.prototype.compressionSigma1_0 = function (e) { + Sha256$Companion.prototype.compressionSigma1_0 = function (e) { var $this = rotateRight(e, 6); var other = rotateRight(e, 11); var $this_0 = new UInt_init($this.data ^ other.data); var other_0 = rotateRight(e, 25); return new UInt_init($this_0.data ^ other_0.data); }; - Sha256.prototype.ch_0 = function (x, y, z) { + Sha256$Companion.prototype.ch_0 = function (x, y, z) { var tmp$ = new UInt_init(x.data & y.data); - var other = Sha256$Companion_getInstance().UINT_MASK; + var other = this.UINT_MASK; var other_0 = new UInt_init((new UInt_init(x.data ^ other.data)).data & z.data); return new UInt_init(tmp$.data ^ other_0.data); }; - Sha256.prototype.maj_0 = function (x, y, z) { + Sha256$Companion.prototype.maj_0 = function (x, y, z) { var tmp$ = new UInt_init(x.data & y.data); var other = new UInt_init(x.data & z.data); var tmp$_0 = new UInt_init(tmp$.data ^ other.data); var other_0 = new UInt_init(y.data & z.data); return new UInt_init(tmp$_0.data ^ other_0.data); }; - Sha256.prototype.toPaddedByteArray_0 = function ($receiver) { - var byteMask = Sha256$Companion_getInstance().BYTE_MASK_FROM_ULONG; + Sha256$Companion.prototype.toPaddedByteArray_0 = function ($receiver) { + var byteMask = this.BYTE_MASK_FROM_ULONG; var array = Array_0(8); var tmp$; tmp$ = array.length - 1 | 0; @@ -1124,8 +934,8 @@ } return array; }; - Sha256.prototype.toPaddedByteArray_1 = function ($receiver) { - var byteMask = Sha256$Companion_getInstance().BYTE_MASK_FROM_UINT; + Sha256$Companion.prototype.toPaddedByteArray_1 = function ($receiver) { + var byteMask = this.BYTE_MASK_FROM_UINT; var array = Array_0(4); var tmp$; tmp$ = array.length - 1 | 0; @@ -1153,10 +963,22 @@ } return array; }; + Sha256$Companion.$metadata$ = { + kind: Kind_OBJECT, + simpleName: 'Companion', + interfaces: [] + }; + var Sha256$Companion_instance = null; + function Sha256$Companion_getInstance() { + if (Sha256$Companion_instance === null) { + new Sha256$Companion(); + } + return Sha256$Companion_instance; + } Sha256.$metadata$ = { kind: Kind_CLASS, simpleName: 'Sha256', - interfaces: [] + interfaces: [Hash] }; var chunked$lambda_1 = wrapFunction(function () { var copyToArray = Kotlin.kotlin.collections.copyToArray; @@ -1166,35 +988,34 @@ }); function Sha512() { Sha512$Companion_getInstance(); - this.h0 = new ULong_init(new Kotlin.Long(-205731576, 1779033703)); - this.h1 = new ULong_init(new Kotlin.Long(-2067093701, -1150833019)); - this.h2 = new ULong_init(new Kotlin.Long(-23791573, 1013904242)); - this.h3 = new ULong_init(new Kotlin.Long(1595750129, -1521486534)); - this.h4 = new ULong_init(new Kotlin.Long(-1377402159, 1359893119)); - this.h5 = new ULong_init(new Kotlin.Long(725511199, -1694144372)); - this.h6 = new ULong_init(new Kotlin.Long(-79577749, 528734635)); - this.h7 = new ULong_init(new Kotlin.Long(327033209, 1541459225)); } function Sha512$Companion() { Sha512$Companion_instance = this; this.BLOCK_SIZE = 1024; this.ULONG_MASK = new ULong_init(Kotlin.Long.NEG_ONE); this.k = [new ULong_init(new Kotlin.Long(-685199838, 1116352408)), new ULong_init(new Kotlin.Long(602891725, 1899447441)), new ULong_init(new Kotlin.Long(-330482897, -1245643825)), new ULong_init(new Kotlin.Long(-2121671748, -373957723)), new ULong_init(new Kotlin.Long(-213338824, 961987163)), new ULong_init(new Kotlin.Long(-1241133031, 1508970993)), new ULong_init(new Kotlin.Long(-1357295717, -1841331548)), new ULong_init(new Kotlin.Long(-630357736, -1424204075)), new ULong_init(new Kotlin.Long(-1560083902, -670586216)), new ULong_init(new Kotlin.Long(1164996542, 310598401)), new ULong_init(new Kotlin.Long(1323610764, 607225278)), new ULong_init(new Kotlin.Long(-704662302, 1426881987)), new ULong_init(new Kotlin.Long(-226784913, 1925078388)), new ULong_init(new Kotlin.Long(991336113, -2132889090)), new ULong_init(new Kotlin.Long(633803317, -1680079193)), new ULong_init(new Kotlin.Long(-815192428, -1046744716)), new ULong_init(new Kotlin.Long(-1628353838, -459576895)), new ULong_init(new Kotlin.Long(944711139, -272742522)), new ULong_init(new Kotlin.Long(-1953704523, 264347078)), new ULong_init(new Kotlin.Long(2007800933, 604807628)), new ULong_init(new Kotlin.Long(1495990901, 770255983)), new ULong_init(new Kotlin.Long(1856431235, 1249150122)), new ULong_init(new Kotlin.Long(-1119749164, 1555081692)), new ULong_init(new Kotlin.Long(-2096016459, 1996064986)), new ULong_init(new Kotlin.Long(-295247957, -1740746414)), new ULong_init(new Kotlin.Long(766784016, -1473132947)), new ULong_init(new Kotlin.Long(-1728372417, -1341970488)), new ULong_init(new Kotlin.Long(-1091629340, -1084653625)), new ULong_init(new Kotlin.Long(1034457026, -958395405)), new ULong_init(new Kotlin.Long(-1828018395, -710438585)), new ULong_init(new Kotlin.Long(-536640913, 113926993)), new ULong_init(new Kotlin.Long(168717936, 338241895)), new ULong_init(new Kotlin.Long(1188179964, 666307205)), new ULong_init(new Kotlin.Long(1546045734, 773529912)), new ULong_init(new Kotlin.Long(1522805485, 1294757372)), new ULong_init(new Kotlin.Long(-1651133473, 1396182291)), new ULong_init(new Kotlin.Long(-1951439906, 1695183700)), new ULong_init(new Kotlin.Long(1014477480, 1986661051)), new ULong_init(new Kotlin.Long(1206759142, -2117940946)), new ULong_init(new Kotlin.Long(344077627, -1838011259)), new ULong_init(new Kotlin.Long(1290863460, -1564481375)), new ULong_init(new Kotlin.Long(-1136513023, -1474664885)), new ULong_init(new Kotlin.Long(-789014639, -1035236496)), new ULong_init(new Kotlin.Long(106217008, -949202525)), new ULong_init(new Kotlin.Long(-688958952, -778901479)), new ULong_init(new Kotlin.Long(1432725776, -694614492)), new ULong_init(new Kotlin.Long(1467031594, -200395387)), new ULong_init(new Kotlin.Long(851169720, 275423344)), new ULong_init(new Kotlin.Long(-1194143544, 430227734)), new ULong_init(new Kotlin.Long(1363258195, 506948616)), new ULong_init(new Kotlin.Long(-544281703, 659060556)), new ULong_init(new Kotlin.Long(-509917016, 883997877)), new ULong_init(new Kotlin.Long(-976659869, 958139571)), new ULong_init(new Kotlin.Long(-482243893, 1322822218)), new ULong_init(new Kotlin.Long(2003034995, 1537002063)), new ULong_init(new Kotlin.Long(-692930397, 1747873779)), new ULong_init(new Kotlin.Long(1575990012, 1955562222)), new ULong_init(new Kotlin.Long(1125592928, 2024104815)), new ULong_init(new Kotlin.Long(-1578062990, -2067236844)), new ULong_init(new Kotlin.Long(442776044, -1933114872)), new ULong_init(new Kotlin.Long(593698344, -1866530822)), new ULong_init(new Kotlin.Long(-561857047, -1538233109)), new ULong_init(new Kotlin.Long(-1295615723, -1090935817)), new ULong_init(new Kotlin.Long(-479046869, -965641998)), new ULong_init(new Kotlin.Long(-366583396, -903397682)), new ULong_init(new Kotlin.Long(566280711, -779700025)), new ULong_init(new Kotlin.Long(-840897762, -354779690)), new ULong_init(new Kotlin.Long(-294727304, -176337025)), new ULong_init(new Kotlin.Long(1914138554, 116418474)), new ULong_init(new Kotlin.Long(-1563912026, 174292421)), new ULong_init(new Kotlin.Long(-1090974290, 289380356)), new ULong_init(new Kotlin.Long(320620315, 460393269)), new ULong_init(new Kotlin.Long(587496836, 685471733)), new ULong_init(new Kotlin.Long(1086792851, 852142971)), new ULong_init(new Kotlin.Long(365543100, 1017036298)), new ULong_init(new Kotlin.Long(-1676669620, 1126000580)), new ULong_init(new Kotlin.Long(-885112138, 1288033470)), new ULong_init(new Kotlin.Long(-60457430, 1501505948)), new ULong_init(new Kotlin.Long(987167468, 1607167915)), new ULong_init(new Kotlin.Long(1246189591, 1816402316))]; + this.iv = [new ULong_init(new Kotlin.Long(-205731576, 1779033703)), new ULong_init(new Kotlin.Long(-2067093701, -1150833019)), new ULong_init(new Kotlin.Long(-23791573, 1013904242)), new ULong_init(new Kotlin.Long(1595750129, -1521486534)), new ULong_init(new Kotlin.Long(-1377402159, 1359893119)), new ULong_init(new Kotlin.Long(725511199, -1694144372)), new ULong_init(new Kotlin.Long(-79577749, 528734635)), new ULong_init(new Kotlin.Long(327033209, 1541459225))]; } - Sha512$Companion.$metadata$ = { - kind: Kind_OBJECT, - simpleName: 'Companion', - interfaces: [] - }; - var Sha512$Companion_instance = null; - function Sha512$Companion_getInstance() { - if (Sha512$Companion_instance === null) { - new Sha512$Companion(); - } - return Sha512$Companion_instance; - } - Sha512.prototype.digest_ummv9a$ = function (message) { + Sha512$Companion.prototype.digest_61zpoe$ = function (message) { + var $receiver = encodeToByteArray(message); + var destination = ArrayList_init($receiver.length); var tmp$; + for (tmp$ = 0; tmp$ !== $receiver.length; ++tmp$) { + var item = $receiver[tmp$]; + destination.add_11rb$(new UByte(item)); + } + return this.digest_ummv9a$(copyToArray(destination)); + }; + Sha512$Companion.prototype.digest_ummv9a$ = function (message) { + var tmp$; + var h0 = {v: new ULong_init(new Kotlin.Long(-205731576, 1779033703))}; + var h1 = {v: new ULong_init(new Kotlin.Long(-2067093701, -1150833019))}; + var h2 = {v: new ULong_init(new Kotlin.Long(-23791573, 1013904242))}; + var h3 = {v: new ULong_init(new Kotlin.Long(1595750129, -1521486534))}; + var h4 = {v: new ULong_init(new Kotlin.Long(-1377402159, 1359893119))}; + var h5 = {v: new ULong_init(new Kotlin.Long(725511199, -1694144372))}; + var h6 = {v: new ULong_init(new Kotlin.Long(-79577749, 528734635))}; + var h7 = {v: new ULong_init(new Kotlin.Long(327033209, 1541459225))}; var originalMessageSizeInBits = message.length * 8 | 0; var expandedRemainderOf1024 = (originalMessageSizeInBits + 129 | 0) % 1024; if (expandedRemainderOf1024 === 0) @@ -1288,19 +1109,19 @@ var other_6 = w[i_2 - 7 | 0]; w[i_2] = new ULong_init((new ULong_init($this_7.data.add(other_6.data))).data.add(s1.data)); } - var a = this.h0; - var b = this.h1; - var c = this.h2; - var d = this.h3; - var e = this.h4; - var f = this.h5; - var g = this.h6; - var h = this.h7; + var a = h0.v; + var b = h1.v; + var c = h2.v; + var d = h3.v; + var e = h4.v; + var f = h5.v; + var g = h6.v; + var h = h7.v; for (var i_3 = 0; i_3 < 80; i_3++) { var s1_0 = this.compressionSigma1_0(e); var ch = this.ch_0(e, f, g); var $this_8 = new ULong_init((new ULong_init(h.data.add(s1_0.data))).data.add(ch.data)); - var other_7 = Sha512$Companion_getInstance().k[i_3]; + var other_7 = this.k[i_3]; var $this_9 = new ULong_init($this_8.data.add(other_7.data)); var other_8 = w[i_3]; var temp1 = new ULong_init($this_9.data.add(other_8.data)); @@ -1316,101 +1137,90 @@ b = a; a = new ULong_init(temp1.data.add(temp2.data)); } - var $this_10 = this.h0; + var $this_10 = h0.v; var other_9 = a; - this.h0 = new ULong_init($this_10.data.add(other_9.data)); - var $this_11 = this.h1; + h0.v = new ULong_init($this_10.data.add(other_9.data)); + var $this_11 = h1.v; var other_10 = b; - this.h1 = new ULong_init($this_11.data.add(other_10.data)); - var $this_12 = this.h2; + h1.v = new ULong_init($this_11.data.add(other_10.data)); + var $this_12 = h2.v; var other_11 = c; - this.h2 = new ULong_init($this_12.data.add(other_11.data)); - var $this_13 = this.h3; + h2.v = new ULong_init($this_12.data.add(other_11.data)); + var $this_13 = h3.v; var other_12 = d; - this.h3 = new ULong_init($this_13.data.add(other_12.data)); - var $this_14 = this.h4; + h3.v = new ULong_init($this_13.data.add(other_12.data)); + var $this_14 = h4.v; var other_13 = e; - this.h4 = new ULong_init($this_14.data.add(other_13.data)); - var $this_15 = this.h5; + h4.v = new ULong_init($this_14.data.add(other_13.data)); + var $this_15 = h5.v; var other_14 = f; - this.h5 = new ULong_init($this_15.data.add(other_14.data)); - var $this_16 = this.h6; + h5.v = new ULong_init($this_15.data.add(other_14.data)); + var $this_16 = h6.v; var other_15 = g; - this.h6 = new ULong_init($this_16.data.add(other_15.data)); - var $this_17 = this.h7; + h6.v = new ULong_init($this_16.data.add(other_15.data)); + var $this_17 = h7.v; var other_16 = h; - this.h7 = new ULong_init($this_17.data.add(other_16.data)); + h7.v = new ULong_init($this_17.data.add(other_16.data)); } - var $receiver_0 = this.toPaddedByteArray_0(this.h0); - var elements_0 = this.toPaddedByteArray_0(this.h1); + var $receiver_0 = this.toPaddedByteArray_0(h0.v); + var elements_0 = this.toPaddedByteArray_0(h1.v); var $receiver_1 = $receiver_0.concat(elements_0); - var elements_1 = this.toPaddedByteArray_0(this.h2); + var elements_1 = this.toPaddedByteArray_0(h2.v); var $receiver_2 = $receiver_1.concat(elements_1); - var elements_2 = this.toPaddedByteArray_0(this.h3); + var elements_2 = this.toPaddedByteArray_0(h3.v); var $receiver_3 = $receiver_2.concat(elements_2); - var elements_3 = this.toPaddedByteArray_0(this.h4); + var elements_3 = this.toPaddedByteArray_0(h4.v); var $receiver_4 = $receiver_3.concat(elements_3); - var elements_4 = this.toPaddedByteArray_0(this.h5); + var elements_4 = this.toPaddedByteArray_0(h5.v); var $receiver_5 = $receiver_4.concat(elements_4); - var elements_5 = this.toPaddedByteArray_0(this.h6); + var elements_5 = this.toPaddedByteArray_0(h6.v); var $receiver_6 = $receiver_5.concat(elements_5); - var elements_6 = this.toPaddedByteArray_0(this.h7); + var elements_6 = this.toPaddedByteArray_0(h7.v); var digest = $receiver_6.concat(elements_6); - this.reset_0(); return digest; }; - Sha512.prototype.reset_0 = function () { - this.h0 = new ULong_init(new Kotlin.Long(-205731576, 1779033703)); - this.h1 = new ULong_init(new Kotlin.Long(-2067093701, -1150833019)); - this.h2 = new ULong_init(new Kotlin.Long(-23791573, 1013904242)); - this.h3 = new ULong_init(new Kotlin.Long(1595750129, -1521486534)); - this.h4 = new ULong_init(new Kotlin.Long(-1377402159, 1359893119)); - this.h5 = new ULong_init(new Kotlin.Long(725511199, -1694144372)); - this.h6 = new ULong_init(new Kotlin.Long(-79577749, 528734635)); - this.h7 = new ULong_init(new Kotlin.Long(327033209, 1541459225)); - }; - Sha512.prototype.scheduleSigma0_0 = function (value) { + Sha512$Companion.prototype.scheduleSigma0_0 = function (value) { var $this = rotateRight_0(value, 1); var other = rotateRight_0(value, 8); var tmp$ = new ULong_init($this.data.xor(other.data)); var other_0 = new ULong_init(value.data.shiftRightUnsigned(7)); return new ULong_init(tmp$.data.xor(other_0.data)); }; - Sha512.prototype.scheduleSigma1_0 = function (value) { + Sha512$Companion.prototype.scheduleSigma1_0 = function (value) { var $this = rotateRight_0(value, 19); var other = rotateRight_0(value, 61); var tmp$ = new ULong_init($this.data.xor(other.data)); var other_0 = new ULong_init(value.data.shiftRightUnsigned(6)); return new ULong_init(tmp$.data.xor(other_0.data)); }; - Sha512.prototype.compressionSigma0_0 = function (e) { + Sha512$Companion.prototype.compressionSigma0_0 = function (e) { var $this = rotateRight_0(e, 28); var other = rotateRight_0(e, 34); var $this_0 = new ULong_init($this.data.xor(other.data)); var other_0 = rotateRight_0(e, 39); return new ULong_init($this_0.data.xor(other_0.data)); }; - Sha512.prototype.compressionSigma1_0 = function (a) { + Sha512$Companion.prototype.compressionSigma1_0 = function (a) { var $this = rotateRight_0(a, 14); var other = rotateRight_0(a, 18); var $this_0 = new ULong_init($this.data.xor(other.data)); var other_0 = rotateRight_0(a, 41); return new ULong_init($this_0.data.xor(other_0.data)); }; - Sha512.prototype.ch_0 = function (x, y, z) { + Sha512$Companion.prototype.ch_0 = function (x, y, z) { var tmp$ = new ULong_init(x.data.and(y.data)); - var other = Sha512$Companion_getInstance().ULONG_MASK; + var other = this.ULONG_MASK; var other_0 = new ULong_init((new ULong_init(x.data.xor(other.data))).data.and(z.data)); return new ULong_init(tmp$.data.xor(other_0.data)); }; - Sha512.prototype.maj_0 = function (x, y, z) { + Sha512$Companion.prototype.maj_0 = function (x, y, z) { var tmp$ = new ULong_init(x.data.and(y.data)); var other = new ULong_init(x.data.and(z.data)); var tmp$_0 = new ULong_init(tmp$.data.xor(other.data)); var other_0 = new ULong_init(y.data.and(z.data)); return new ULong_init(tmp$_0.data.xor(other_0.data)); }; - Sha512.prototype.toPaddedByteArray_0 = function ($receiver) { + Sha512$Companion.prototype.toPaddedByteArray_0 = function ($receiver) { var byteMask = new ULong_init(Kotlin.Long.fromInt(255)); var array = Array_0(8); var tmp$; @@ -1452,7 +1262,7 @@ } return array; }; - Sha512.prototype.toPadded128BitByteArray_0 = function ($receiver) { + Sha512$Companion.prototype.toPadded128BitByteArray_0 = function ($receiver) { var byteMask = new ULong_init(Kotlin.Long.fromInt(255)); var array = Array_0(16); var tmp$; @@ -1494,15 +1304,30 @@ } return array; }; + Sha512$Companion.$metadata$ = { + kind: Kind_OBJECT, + simpleName: 'Companion', + interfaces: [] + }; + var Sha512$Companion_instance = null; + function Sha512$Companion_getInstance() { + if (Sha512$Companion_instance === null) { + new Sha512$Companion(); + } + return Sha512$Companion_instance; + } Sha512.$metadata$ = { kind: Kind_CLASS, simpleName: 'Sha512', - interfaces: [] + interfaces: [Hash] }; var package$com = _.com || (_.com = {}); var package$ionspin = package$com.ionspin || (package$com.ionspin = {}); var package$kotlin = package$ionspin.kotlin || (package$ionspin.kotlin = {}); var package$crypto = package$kotlin.crypto || (package$kotlin.crypto = {}); + Object.defineProperty(package$crypto, 'Config', { + get: Config_getInstance + }); package$crypto.Hash = Hash; package$crypto.UpdateableHash = UpdateableHash; package$crypto.hexColumsPrint_mgx7ee$ = hexColumsPrint; @@ -1528,6 +1353,6 @@ package$sha.Sha512 = Sha512; Kotlin.defineModule('crypto-core', _); return _; -}(module.exports, require('kotlin'), require('bignum'), require('kotlinx-coroutines-core'))); +}(module.exports, require('kotlin'), require('bignum'))); //# sourceMappingURL=crypto-core.js.map diff --git a/crypto-core/node_modules/crypto-core.js.map b/crypto-core/node_modules/crypto-core.js.map index db48bdb..d5150c1 100644 --- a/crypto-core/node_modules/crypto-core.js.map +++ b/crypto-core/node_modules/crypto-core.js.map @@ -1 +1 @@ -{"version":3,"file":"crypto-core.js","sources":["kotlin/text/numberConversions.kt","generated/_Arrays.kt","kotlin/UInt.kt","kotlin/ULong.kt","arrayUtils.kt","kotlin/UByte.kt","kotlin/collections.kt","generated/_Collections.kt","generated/_ArraysJs.kt","coroutines/Continuation.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/Util.kt","kotlin/text/string.kt","collections/Collections.kt","util/Standard.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2b.kt","collections/Arrays.kt","kotlin/kotlin.kt","util/Result.kt","../../../../../../../../../../../dummy.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha256.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha512.kt"],"sourcesContent":[null,null,null,null,null,"/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.experimental.*\n\n@Suppress(\"NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline class UByte @PublishedApi internal constructor(@PublishedApi internal val data: Byte) : Comparable {\n\n companion object {\n /**\n * A constant holding the minimum value an instance of UByte can have.\n */\n public const val MIN_VALUE: UByte = UByte(0)\n\n /**\n * A constant holding the maximum value an instance of UByte can have.\n */\n public const val MAX_VALUE: UByte = UByte(-1)\n\n /**\n * The number of bytes used to represent an instance of UByte in a binary form.\n */\n public const val SIZE_BYTES: Int = 1\n\n /**\n * The number of bits used to represent an instance of UByte in a binary form.\n */\n public const val SIZE_BITS: Int = 8\n }\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n @Suppress(\"OVERRIDE_BY_INLINE\")\n public override inline operator fun compareTo(other: UByte): Int = this.toInt().compareTo(other.toInt())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UShort): Int = this.toInt().compareTo(other.toInt())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UInt): Int = this.toUInt().compareTo(other)\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: ULong): Int = this.toULong().compareTo(other)\n\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UByte): UInt = this.toUInt().plus(other.toUInt())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UShort): UInt = this.toUInt().plus(other.toUInt())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UInt): UInt = this.toUInt().plus(other)\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: ULong): ULong = this.toULong().plus(other)\n\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UByte): UInt = this.toUInt().minus(other.toUInt())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UShort): UInt = this.toUInt().minus(other.toUInt())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UInt): UInt = this.toUInt().minus(other)\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: ULong): ULong = this.toULong().minus(other)\n\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UByte): UInt = this.toUInt().times(other.toUInt())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UShort): UInt = this.toUInt().times(other.toUInt())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UInt): UInt = this.toUInt().times(other)\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: ULong): ULong = this.toULong().times(other)\n\n /** Divides this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UByte): UInt = this.toUInt().div(other.toUInt())\n /** Divides this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UShort): UInt = this.toUInt().div(other.toUInt())\n /** Divides this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UInt): UInt = this.toUInt().div(other)\n /** Divides this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: ULong): ULong = this.toULong().div(other)\n\n /** Calculates the remainder of dividing this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UByte): UInt = this.toUInt().rem(other.toUInt())\n /** Calculates the remainder of dividing this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UShort): UInt = this.toUInt().rem(other.toUInt())\n /** Calculates the remainder of dividing this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UInt): UInt = this.toUInt().rem(other)\n /** Calculates the remainder of dividing this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: ULong): ULong = this.toULong().rem(other)\n\n /** Increments this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun inc(): UByte = UByte(data.inc())\n /** Decrements this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun dec(): UByte = UByte(data.dec())\n\n /** Creates a range from this value to the specified [other] value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rangeTo(other: UByte): UIntRange = UIntRange(this.toUInt(), other.toUInt())\n\n /** Performs a bitwise AND operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun and(other: UByte): UByte = UByte(this.data and other.data)\n /** Performs a bitwise OR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun or(other: UByte): UByte = UByte(this.data or other.data)\n /** Performs a bitwise XOR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun xor(other: UByte): UByte = UByte(this.data xor other.data)\n /** Inverts the bits in this value. */\n @kotlin.internal.InlineOnly\n public inline fun inv(): UByte = UByte(data.inv())\n\n /**\n * Converts this [UByte] value to [Byte].\n *\n * If this value is less than or equals to [Byte.MAX_VALUE], the resulting `Byte` value represents\n * the same numerical value as this `UByte`. Otherwise the result is negative.\n *\n * The resulting `Byte` value has the same binary representation as this `UByte` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toByte(): Byte = data\n /**\n * Converts this [UByte] value to [Short].\n *\n * The resulting `Short` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `Short` value are the same as the bits of this `UByte` value,\n * whereas the most significant 8 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toShort(): Short = data.toShort() and 0xFF\n /**\n * Converts this [UByte] value to [Int].\n *\n * The resulting `Int` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `Int` value are the same as the bits of this `UByte` value,\n * whereas the most significant 24 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toInt(): Int = data.toInt() and 0xFF\n /**\n * Converts this [UByte] value to [Long].\n *\n * The resulting `Long` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `Long` value are the same as the bits of this `UByte` value,\n * whereas the most significant 56 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toLong(): Long = data.toLong() and 0xFF\n\n /** Returns this value. */\n @kotlin.internal.InlineOnly\n public inline fun toUByte(): UByte = this\n /**\n * Converts this [UByte] value to [UShort].\n *\n * The resulting `UShort` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `UShort` value are the same as the bits of this `UByte` value,\n * whereas the most significant 8 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUShort(): UShort = UShort(data.toShort() and 0xFF)\n /**\n * Converts this [UByte] value to [UInt].\n *\n * The resulting `UInt` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `UInt` value are the same as the bits of this `UByte` value,\n * whereas the most significant 24 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUInt(): UInt = UInt(data.toInt() and 0xFF)\n /**\n * Converts this [UByte] value to [ULong].\n *\n * The resulting `ULong` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `ULong` value are the same as the bits of this `UByte` value,\n * whereas the most significant 56 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toULong(): ULong = ULong(data.toLong() and 0xFF)\n\n /**\n * Converts this [UByte] value to [Float].\n *\n * The resulting `Float` value represents the same numerical value as this `UByte`.\n */\n @kotlin.internal.InlineOnly\n public inline fun toFloat(): Float = this.toInt().toFloat()\n /**\n * Converts this [UByte] value to [Double].\n *\n * The resulting `Double` value represents the same numerical value as this `UByte`.\n */\n @kotlin.internal.InlineOnly\n public inline fun toDouble(): Double = this.toInt().toDouble()\n\n public override fun toString(): String = toInt().toString()\n\n}\n\n/**\n * Converts this [Byte] value to [UByte].\n *\n * If this value is positive, the resulting `UByte` value represents the same numerical value as this `Byte`.\n *\n * The resulting `UByte` value has the same binary representation as this `Byte` value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun Byte.toUByte(): UByte = UByte(this)\n/**\n * Converts this [Short] value to [UByte].\n *\n * If this value is positive and less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `Short`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `Short` value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun Short.toUByte(): UByte = UByte(this.toByte())\n/**\n * Converts this [Int] value to [UByte].\n *\n * If this value is positive and less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `Int`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `Int` value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun Int.toUByte(): UByte = UByte(this.toByte())\n/**\n * Converts this [Long] value to [UByte].\n *\n * If this value is positive and less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `Long`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `Long` value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun Long.toUByte(): UByte = UByte(this.toByte())\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\nimport kotlin.comparisons.naturalOrder\nimport kotlin.random.Random\n\n/** Returns the array if it's not `null`, or an empty array otherwise. */\n@kotlin.internal.InlineOnly\npublic actual inline fun Array?.orEmpty(): Array = this ?: emptyArray()\n\n@kotlin.internal.InlineOnly\npublic actual inline fun Collection.toTypedArray(): Array = copyToArray(this)\n\n@JsName(\"copyToArray\")\n@PublishedApi\ninternal fun copyToArray(collection: Collection): Array {\n return if (collection.asDynamic().toArray !== undefined)\n collection.asDynamic().toArray().unsafeCast>()\n else\n copyToArrayImpl(collection).unsafeCast>()\n}\n\n@JsName(\"copyToArrayImpl\")\ninternal actual fun copyToArrayImpl(collection: Collection<*>): Array {\n val array = emptyArray()\n val iterator = collection.iterator()\n while (iterator.hasNext())\n array.asDynamic().push(iterator.next())\n return array\n}\n\n@JsName(\"copyToExistingArrayImpl\")\ninternal actual fun copyToArrayImpl(collection: Collection<*>, array: Array): Array {\n if (array.size < collection.size)\n return copyToArrayImpl(collection).unsafeCast>()\n\n val iterator = collection.iterator()\n var index = 0\n while (iterator.hasNext()) {\n array[index++] = iterator.next().unsafeCast()\n }\n if (index < array.size) {\n array[index] = null.unsafeCast()\n }\n return array\n}\n\n/**\n * Returns an immutable list containing only the specified object [element].\n */\npublic fun listOf(element: T): List = arrayListOf(element)\n\n/**\n * Returns an immutable set containing only the specified object [element].\n */\npublic fun setOf(element: T): Set = hashSetOf(element)\n\n/**\n * Returns an immutable map, mapping only the specified key to the\n * specified value.\n */\npublic fun mapOf(pair: Pair): Map = hashMapOf(pair)\n\n/**\n * Fills the list with the provided [value].\n *\n * Each element in the list gets replaced with the [value].\n */\n@SinceKotlin(\"1.2\")\npublic actual fun MutableList.fill(value: T): Unit {\n for (index in 0..lastIndex) {\n this[index] = value\n }\n}\n\n/**\n * Randomly shuffles elements in this list.\n *\n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.2\")\npublic actual fun MutableList.shuffle(): Unit = shuffle(Random)\n\n/**\n * Returns a new list with the elements of this list randomly shuffled.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Iterable.shuffled(): List = toMutableList().apply { shuffle() }\n\n/**\n * Sorts elements in the list in-place according to their natural sort order.\n *\n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic actual fun > MutableList.sort(): Unit {\n collectionsSort(this, naturalOrder())\n}\n\n/**\n * Sorts elements in the list in-place according to the order specified with [comparator].\n *\n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic actual fun MutableList.sortWith(comparator: Comparator): Unit {\n collectionsSort(this, comparator)\n}\n\nprivate fun collectionsSort(list: MutableList, comparator: Comparator) {\n if (list.size <= 1) return\n\n val array = copyToArray(list)\n sortArrayWith(array, comparator)\n\n for (i in 0 until array.size) {\n list[i] = array[i]\n }\n}\n\ninternal actual fun arrayOfNulls(reference: Array, size: Int): Array {\n return arrayOfNulls(size).unsafeCast>()\n}\n\n@SinceKotlin(\"1.3\")\n@PublishedApi\n@JsName(\"arrayCopy\")\ninternal fun arrayCopy(source: Array, destination: Array, destinationOffset: Int, startIndex: Int, endIndex: Int) {\n AbstractList.checkRangeIndexes(startIndex, endIndex, source.size)\n val rangeSize = endIndex - startIndex\n AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size)\n\n if (js(\"ArrayBuffer\").isView(destination) && js(\"ArrayBuffer\").isView(source)) {\n val subrange = source.asDynamic().subarray(startIndex, endIndex)\n destination.asDynamic().set(subrange, destinationOffset)\n } else {\n if (source !== destination || destinationOffset <= startIndex) {\n for (index in 0 until rangeSize) {\n destination[destinationOffset + index] = source[startIndex + index]\n }\n } else {\n for (index in rangeSize - 1 downTo 0) {\n destination[destinationOffset + index] = source[startIndex + index]\n }\n }\n }\n}\n\n// no singleton map implementation in js, return map as is\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal actual inline fun Map.toSingletonMapOrSelf(): Map = this\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal actual inline fun Map.toSingletonMap(): Map = this.toMutableMap()\n\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal actual inline fun Array.copyToArrayOfAny(isVarargs: Boolean): Array =\n if (isVarargs)\n // no need to copy vararg array in JS\n this\n else\n this.copyOf()\n\n\n\n@PublishedApi\ninternal actual fun checkIndexOverflow(index: Int): Int {\n if (index < 0) {\n throwIndexOverflow()\n }\n return index\n}\n\n@PublishedApi\ninternal actual fun checkCountOverflow(count: Int): Int {\n if (count < 0) {\n throwCountOverflow()\n }\n return count\n}\n\n","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CollectionsKt\")\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns 1st *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component1(): T {\n return get(0)\n}\n\n/**\n * Returns 2nd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component2(): T {\n return get(1)\n}\n\n/**\n * Returns 3rd *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component3(): T {\n return get(2)\n}\n\n/**\n * Returns 4th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component4(): T {\n return get(3)\n}\n\n/**\n * Returns 5th *element* from the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component5(): T {\n return get(4)\n}\n\n/**\n * Returns `true` if [element] is found in the collection.\n */\npublic operator fun <@kotlin.internal.OnlyInputTypes T> Iterable.contains(element: T): Boolean {\n if (this is Collection)\n return contains(element)\n return indexOf(element) >= 0\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic fun Iterable.elementAt(index: Int): T {\n if (this is List)\n return get(index)\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"Collection doesn't contain element at index $index.\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAt(index: Int): T {\n return get(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\npublic fun Iterable.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n if (this is List)\n return this.getOrElse(index, defaultValue)\n if (index < 0)\n return defaultValue(index)\n val iterator = iterator()\n var count = 0\n while (iterator.hasNext()) {\n val element = iterator.next()\n if (index == count++)\n return element\n }\n return defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\npublic fun Iterable.elementAtOrNull(index: Int): T? {\n if (this is List)\n return this.getOrNull(index)\n if (index < 0)\n return null\n val iterator = iterator()\n var count = 0\n while (iterator.hasNext()) {\n val element = iterator.next()\n if (index == count++)\n return element\n }\n return null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAtOrNull(index: Int): T? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.find(predicate: (T) -> Boolean): T? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the collection is empty.\n */\npublic fun Iterable.first(): T {\n when (this) {\n is List -> return this.first()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n return iterator.next()\n }\n }\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the list is empty.\n */\npublic fun List.first(): T {\n if (isEmpty())\n throw NoSuchElementException(\"List is empty.\")\n return this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun Iterable.first(predicate: (T) -> Boolean): T {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element, or `null` if the collection is empty.\n */\npublic fun Iterable.firstOrNull(): T? {\n when (this) {\n is List -> {\n if (isEmpty())\n return null\n else\n return this[0]\n }\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n return iterator.next()\n }\n }\n}\n\n/**\n * Returns the first element, or `null` if the list is empty.\n */\npublic fun List.firstOrNull(): T? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun Iterable.firstOrNull(predicate: (T) -> Boolean): T? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this list.\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.getOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this list.\n */\npublic fun List.getOrNull(index: Int): T? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns first index of [element], or -1 if the collection does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Iterable.indexOf(element: T): Int {\n if (this is List) return this.indexOf(element)\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (element == item)\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the list does not contain element.\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\npublic fun <@kotlin.internal.OnlyInputTypes T> List.indexOf(element: T): Int {\n return indexOf(element)\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element.\n */\npublic inline fun Iterable.indexOfFirst(predicate: (T) -> Boolean): Int {\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (predicate(item))\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the list does not contain such element.\n */\npublic inline fun List.indexOfFirst(predicate: (T) -> Boolean): Int {\n var index = 0\n for (item in this) {\n if (predicate(item))\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element.\n */\npublic inline fun Iterable.indexOfLast(predicate: (T) -> Boolean): Int {\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (predicate(item))\n lastIndex = index\n index++\n }\n return lastIndex\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the list does not contain such element.\n */\npublic inline fun List.indexOfLast(predicate: (T) -> Boolean): Int {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n if (predicate(iterator.previous())) {\n return iterator.nextIndex()\n }\n }\n return -1\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the collection is empty.\n */\npublic fun Iterable.last(): T {\n when (this) {\n is List -> return this.last()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n var last = iterator.next()\n while (iterator.hasNext())\n last = iterator.next()\n return last\n }\n }\n}\n\n/**\n * Returns the last element.\n * @throws [NoSuchElementException] if the list is empty.\n */\npublic fun List.last(): T {\n if (isEmpty())\n throw NoSuchElementException(\"List is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun Iterable.last(predicate: (T) -> Boolean): T {\n var last: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n last = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return last as T\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun List.last(predicate: (T) -> Boolean): T {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n val element = iterator.previous()\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"List contains no element matching the predicate.\")\n}\n\n/**\n * Returns last index of [element], or -1 if the collection does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Iterable.lastIndexOf(element: T): Int {\n if (this is List) return this.lastIndexOf(element)\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (element == item)\n lastIndex = index\n index++\n }\n return lastIndex\n}\n\n/**\n * Returns last index of [element], or -1 if the list does not contain element.\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\npublic fun <@kotlin.internal.OnlyInputTypes T> List.lastIndexOf(element: T): Int {\n return lastIndexOf(element)\n}\n\n/**\n * Returns the last element, or `null` if the collection is empty.\n */\npublic fun Iterable.lastOrNull(): T? {\n when (this) {\n is List -> return if (isEmpty()) null else this[size - 1]\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n var last = iterator.next()\n while (iterator.hasNext())\n last = iterator.next()\n return last\n }\n }\n}\n\n/**\n * Returns the last element, or `null` if the list is empty.\n */\npublic fun List.lastOrNull(): T? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun Iterable.lastOrNull(predicate: (T) -> Boolean): T? {\n var last: T? = null\n for (element in this) {\n if (predicate(element)) {\n last = element\n }\n }\n return last\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n */\npublic inline fun List.lastOrNull(predicate: (T) -> Boolean): T? {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n val element = iterator.previous()\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns a random element from this collection.\n * \n * @throws NoSuchElementException if this collection is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Collection.random(): T {\n return random(Random)\n}\n\n/**\n * Returns a random element from this collection using the specified source of randomness.\n * \n * @throws NoSuchElementException if this collection is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun Collection.random(random: Random): T {\n if (isEmpty())\n throw NoSuchElementException(\"Collection is empty.\")\n return elementAt(random.nextInt(size))\n}\n\n/**\n * Returns the single element, or throws an exception if the collection is empty or has more than one element.\n */\npublic fun Iterable.single(): T {\n when (this) {\n is List -> return this.single()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n val single = iterator.next()\n if (iterator.hasNext())\n throw IllegalArgumentException(\"Collection has more than one element.\")\n return single\n }\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the list is empty or has more than one element.\n */\npublic fun List.single(): T {\n return when (size) {\n 0 -> throw NoSuchElementException(\"List is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"List has more than one element.\")\n }\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun Iterable.single(predicate: (T) -> Boolean): T {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Collection contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as T\n}\n\n/**\n * Returns single element, or `null` if the collection is empty or has more than one element.\n */\npublic fun Iterable.singleOrNull(): T? {\n when (this) {\n is List -> return if (size == 1) this[0] else null\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n val single = iterator.next()\n if (iterator.hasNext())\n return null\n return single\n }\n }\n}\n\n/**\n * Returns single element, or `null` if the list is empty or has more than one element.\n */\npublic fun List.singleOrNull(): T? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun Iterable.singleOrNull(predicate: (T) -> Boolean): T? {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Iterable.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return toList()\n val list: ArrayList\n if (this is Collection<*>) {\n val resultSize = size - n\n if (resultSize <= 0)\n return emptyList()\n if (resultSize == 1)\n return listOf(last())\n list = ArrayList(resultSize)\n if (this is List) {\n if (this is RandomAccess) {\n for (index in n until size)\n list.add(this[index])\n } else {\n for (item in listIterator(n))\n list.add(item)\n }\n return list\n }\n }\n else {\n list = ArrayList()\n }\n var count = 0\n for (item in this) {\n if (count >= n) list.add(item) else ++count\n }\n return list.optimizeReadOnlyList()\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun List.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun List.dropLastWhile(predicate: (T) -> Boolean): List {\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n if (!predicate(iterator.previous())) {\n return take(iterator.nextIndex() + 1)\n }\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun Iterable.dropWhile(predicate: (T) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n */\npublic inline fun Iterable.filter(predicate: (T) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun Iterable.filterIndexed(predicate: (index: Int, T) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n */\npublic inline fun > Iterable.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Returns a list containing all elements that are instances of specified type parameter R.\n */\npublic inline fun Iterable<*>.filterIsInstance(): List<@kotlin.internal.NoInfer R> {\n return filterIsInstanceTo(ArrayList())\n}\n\n/**\n * Appends all elements that are instances of specified type parameter R to the given [destination].\n */\npublic inline fun > Iterable<*>.filterIsInstanceTo(destination: C): C {\n for (element in this) if (element is R) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n */\npublic inline fun Iterable.filterNot(predicate: (T) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements that are not `null`.\n */\npublic fun Iterable.filterNotNull(): List {\n return filterNotNullTo(ArrayList())\n}\n\n/**\n * Appends all elements that are not `null` to the given [destination].\n */\npublic fun , T : Any> Iterable.filterNotNullTo(destination: C): C {\n for (element in this) if (element != null) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n */\npublic inline fun > Iterable.filterNotTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n */\npublic inline fun > Iterable.filterTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun List.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return this.subList(indices.start, indices.endInclusive + 1).toList()\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun List.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun Iterable.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (this is Collection) {\n if (n >= size) return toList()\n if (n == 1) return listOf(first())\n }\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n if (count++ == n)\n break\n list.add(item)\n }\n return list.optimizeReadOnlyList()\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun List.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(last())\n val list = ArrayList(n)\n if (this is RandomAccess) {\n for (index in size - n until size)\n list.add(this[index])\n } else {\n for (item in listIterator(size - n))\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun List.takeLastWhile(predicate: (T) -> Boolean): List {\n if (isEmpty())\n return emptyList()\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n if (!predicate(iterator.previous())) {\n iterator.next()\n val expectedSize = size - iterator.nextIndex()\n if (expectedSize == 0) return emptyList()\n return ArrayList(expectedSize).apply {\n while (iterator.hasNext())\n add(iterator.next())\n }\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun Iterable.takeWhile(predicate: (T) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Reverses elements in the list in-place.\n */\npublic expect fun MutableList.reverse(): Unit\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun Iterable.reversed(): List {\n if (this is Collection && size <= 1) return toList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Sorts elements in the list in-place according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > MutableList.sortBy(crossinline selector: (T) -> R?): Unit {\n if (size > 1) sortWith(compareBy(selector))\n}\n\n/**\n * Sorts elements in the list in-place descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > MutableList.sortByDescending(crossinline selector: (T) -> R?): Unit {\n if (size > 1) sortWith(compareByDescending(selector))\n}\n\n/**\n * Sorts elements in the list in-place descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > MutableList.sortDescending(): Unit {\n sortWith(reverseOrder())\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Iterable.sorted(): List {\n if (this is Collection) {\n if (size <= 1) return this.toList()\n @Suppress(\"UNCHECKED_CAST\")\n return (toTypedArray>() as Array).apply { sort() }.asList()\n }\n return toMutableList().apply { sort() }\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > Iterable.sortedBy(crossinline selector: (T) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > Iterable.sortedByDescending(crossinline selector: (T) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Iterable.sortedDescending(): List {\n return sortedWith(reverseOrder())\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun Iterable.sortedWith(comparator: Comparator): List {\n if (this is Collection) {\n if (size <= 1) return this.toList()\n @Suppress(\"UNCHECKED_CAST\")\n return (toTypedArray() as Array).apply { sortWith(comparator) }.asList()\n }\n return toMutableList().apply { sortWith(comparator) }\n}\n\n/**\n * Returns an array of Boolean containing all of the elements of this collection.\n */\npublic fun Collection.toBooleanArray(): BooleanArray {\n val result = BooleanArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Byte containing all of the elements of this collection.\n */\npublic fun Collection.toByteArray(): ByteArray {\n val result = ByteArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Char containing all of the elements of this collection.\n */\npublic fun Collection.toCharArray(): CharArray {\n val result = CharArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Double containing all of the elements of this collection.\n */\npublic fun Collection.toDoubleArray(): DoubleArray {\n val result = DoubleArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Float containing all of the elements of this collection.\n */\npublic fun Collection.toFloatArray(): FloatArray {\n val result = FloatArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Int containing all of the elements of this collection.\n */\npublic fun Collection.toIntArray(): IntArray {\n val result = IntArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Long containing all of the elements of this collection.\n */\npublic fun Collection.toLongArray(): LongArray {\n val result = LongArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Short containing all of the elements of this collection.\n */\npublic fun Collection.toShortArray(): ShortArray {\n val result = ShortArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given collection.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n */\npublic inline fun Iterable.associate(transform: (T) -> Pair): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing the elements from the given collection indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n */\npublic inline fun Iterable.associateBy(keySelector: (T) -> K): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given collection.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n */\npublic inline fun Iterable.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given collection\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n */\npublic inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given collection.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n */\npublic inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given collection.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n */\npublic inline fun > Iterable.associateTo(destination: M, transform: (T) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Returns a [Map] where keys are elements from the given collection and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.3\")\npublic inline fun Iterable.associateWith(valueSelector: (K) -> V): Map {\n val result = LinkedHashMap(mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given collection,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n */\n@SinceKotlin(\"1.3\")\npublic inline fun > Iterable.associateWithTo(destination: M, valueSelector: (K) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > Iterable.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Returns a [HashSet] of all elements.\n */\npublic fun Iterable.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(collectionSizeOrDefault(12))))\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun Iterable.toList(): List {\n if (this is Collection) {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(if (this is List) get(0) else iterator().next())\n else -> this.toMutableList()\n }\n }\n return this.toMutableList().optimizeReadOnlyList()\n}\n\n/**\n * Returns a [MutableList] filled with all elements of this collection.\n */\npublic fun Iterable.toMutableList(): MutableList {\n if (this is Collection)\n return this.toMutableList()\n return toCollection(ArrayList())\n}\n\n/**\n * Returns a [MutableList] filled with all elements of this collection.\n */\npublic fun Collection.toMutableList(): MutableList {\n return ArrayList(this)\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic fun Iterable.toSet(): Set {\n if (this is Collection) {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(if (this is List) this[0] else iterator().next())\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n }\n return toCollection(LinkedHashSet()).optimizeReadOnlySet()\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.\n */\npublic inline fun Iterable.flatMap(transform: (T) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].\n */\npublic inline fun > Iterable.flatMapTo(destination: C, transform: (T) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Groups elements of the original collection by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original collection.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun Iterable.groupBy(keySelector: (T) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original collection\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original collection.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun Iterable.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups elements of the original collection by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original collection\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Creates a [Grouping] source from a collection to be used later with one of group-and-fold operations\n * using the specified [keySelector] function to extract a key from each element.\n * \n * @sample samples.collections.Grouping.groupingByEachCount\n */\n@SinceKotlin(\"1.1\")\npublic inline fun Iterable.groupingBy(crossinline keySelector: (T) -> K): Grouping {\n return object : Grouping {\n override fun sourceIterator(): Iterator = this@groupingBy.iterator()\n override fun keyOf(element: T): K = keySelector(element)\n }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun Iterable.map(transform: (T) -> R): List {\n return mapTo(ArrayList(collectionSizeOrDefault(10)), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original collection.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun Iterable.mapIndexed(transform: (index: Int, T) -> R): List {\n return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform)\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each element and its index in the original collection.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun Iterable.mapIndexedNotNull(transform: (index: Int, T) -> R?): List {\n return mapIndexedNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original collection\n * and appends only the non-null results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > Iterable.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C {\n forEachIndexed { index, element -> transform(index, element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original collection\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > Iterable.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(checkIndexOverflow(index++), item))\n return destination\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each element in the original collection.\n */\npublic inline fun Iterable.mapNotNull(transform: (T) -> R?): List {\n return mapNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each element in the original collection\n * and appends only the non-null results to the given [destination].\n */\npublic inline fun > Iterable.mapNotNullTo(destination: C, transform: (T) -> R?): C {\n forEach { element -> transform(element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original collection\n * and appends the results to the given [destination].\n */\npublic inline fun > Iterable.mapTo(destination: C, transform: (T) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Returns a lazy [Iterable] of [IndexedValue] for each element of the original collection.\n */\npublic fun Iterable.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a list containing only distinct elements from the given collection.\n * \n * The elements in the resulting list are in the same order as they were in the source collection.\n */\npublic fun Iterable.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only elements from the given collection\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source collection.\n */\npublic inline fun Iterable.distinctBy(selector: (T) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a set containing all elements that are contained by both this set and the specified collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic infix fun Iterable.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this collection and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic infix fun Iterable.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a mutable set containing all distinct elements from the given collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic fun Iterable.toMutableSet(): MutableSet {\n return when (this) {\n is Collection -> LinkedHashSet(this)\n else -> toCollection(LinkedHashSet())\n }\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original collection.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n */\npublic infix fun Iterable.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun Iterable.all(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return true\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if collection has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun Iterable.any(): Boolean {\n if (this is Collection) return !isEmpty()\n return iterator().hasNext()\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun Iterable.any(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return false\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns the number of elements in this collection.\n */\npublic fun Iterable.count(): Int {\n if (this is Collection) return size\n var count = 0\n for (element in this) checkCountOverflow(++count)\n return count\n}\n\n/**\n * Returns the number of elements in this collection.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun Iterable.count(predicate: (T) -> Boolean): Int {\n if (this is Collection && isEmpty()) return 0\n var count = 0\n for (element in this) if (predicate(element)) checkCountOverflow(++count)\n return count\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element.\n */\npublic inline fun Iterable.fold(initial: R, operation: (acc: R, T) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original collection.\n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun Iterable.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(checkIndexOverflow(index++), accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left to each element and current accumulator value.\n */\npublic inline fun List.foldRight(initial: R, operation: (T, acc: R) -> R): R {\n var accumulator = initial\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n accumulator = operation(iterator.previous(), accumulator)\n }\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original list and current accumulator value.\n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun List.foldRightIndexed(initial: R, operation: (index: Int, T, acc: R) -> R): R {\n var accumulator = initial\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n val index = iterator.previousIndex()\n accumulator = operation(index, iterator.previous(), accumulator)\n }\n }\n return accumulator\n}\n\n/**\n * Performs the given [action] on each element.\n */\n@kotlin.internal.HidesMembers\npublic inline fun Iterable.forEach(action: (T) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the desired action on the element.\n */\npublic inline fun Iterable.forEachIndexed(action: (index: Int, T) -> Unit): Unit {\n var index = 0\n for (item in this) action(checkIndexOverflow(index++), item)\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\npublic fun Iterable.max(): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n if (max.isNaN()) return max\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (e.isNaN()) return e\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\npublic fun Iterable.max(): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n if (max.isNaN()) return max\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (e.isNaN()) return e\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\npublic fun > Iterable.max(): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxBy\n */\npublic inline fun > Iterable.maxBy(selector: (T) -> R): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxElem = iterator.next()\n if (!iterator.hasNext()) return maxElem\n var maxValue = selector(maxElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n } while (iterator.hasNext())\n return maxElem\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\npublic fun Iterable.maxWith(comparator: Comparator): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\npublic fun Iterable.min(): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n if (min.isNaN()) return min\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (e.isNaN()) return e\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\npublic fun Iterable.min(): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n if (min.isNaN()) return min\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (e.isNaN()) return e\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\npublic fun > Iterable.min(): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minBy\n */\npublic inline fun > Iterable.minBy(selector: (T) -> R): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minElem = iterator.next()\n if (!iterator.hasNext()) return minElem\n var minValue = selector(minElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n } while (iterator.hasNext())\n return minElem\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\npublic fun Iterable.minWith(comparator: Comparator): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns `true` if the collection has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun Iterable.none(): Boolean {\n if (this is Collection) return isEmpty()\n return !iterator().hasNext()\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun Iterable.none(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return true\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Performs the given [action] on each element and returns the collection itself afterwards.\n */\n@SinceKotlin(\"1.1\")\npublic inline fun > C.onEach(action: (T) -> Unit): C {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right to current accumulator value and each element.\n */\npublic inline fun Iterable.reduce(operation: (acc: S, T) -> S): S {\n val iterator = this.iterator()\n if (!iterator.hasNext()) throw UnsupportedOperationException(\"Empty collection can't be reduced.\")\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original collection.\n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself and calculates the next accumulator value.\n */\npublic inline fun Iterable.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {\n val iterator = this.iterator()\n if (!iterator.hasNext()) throw UnsupportedOperationException(\"Empty collection can't be reduced.\")\n var index = 1\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with last element and applying [operation] from right to left to each element and current accumulator value.\n */\npublic inline fun List.reduceRight(operation: (T, acc: S) -> S): S {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n throw UnsupportedOperationException(\"Empty list can't be reduced.\")\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n accumulator = operation(iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with last element and applying [operation] from right to left\n * to each element with its index in the original list and current accumulator value.\n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun List.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n throw UnsupportedOperationException(\"Empty list can't be reduced.\")\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n val index = iterator.previousIndex()\n accumulator = operation(index, iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\npublic inline fun Iterable.sumBy(selector: (T) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\npublic inline fun Iterable.sumByDouble(selector: (T) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.\n */\npublic fun Iterable.requireNoNulls(): Iterable {\n for (element in this) {\n if (element == null) {\n throw IllegalArgumentException(\"null element found in $this.\")\n }\n }\n @Suppress(\"UNCHECKED_CAST\")\n return this as Iterable\n}\n\n/**\n * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.\n */\npublic fun List.requireNoNulls(): List {\n for (element in this) {\n if (element == null) {\n throw IllegalArgumentException(\"null element found in $this.\")\n }\n }\n @Suppress(\"UNCHECKED_CAST\")\n return this as List\n}\n\n/**\n * Splits this collection into a list of lists each not exceeding the given [size].\n * \n * The last list in the resulting list may have less elements than the given [size].\n * \n * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection.\n * \n * @sample samples.collections.Collections.Transformations.chunked\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.chunked(size: Int): List> {\n return windowed(size, size, partialWindows = true)\n}\n\n/**\n * Splits this collection into several lists each not exceeding the given [size]\n * and applies the given [transform] function to an each.\n * \n * @return list of results of the [transform] applied to an each list.\n * \n * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * The last list may have less elements than the given [size].\n * \n * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection.\n * \n * @sample samples.text.Strings.chunkedTransform\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.chunked(size: Int, transform: (List) -> R): List {\n return windowed(size, size, partialWindows = true, transform = transform)\n}\n\n/**\n * Returns a list containing all elements of the original collection without the first occurrence of the given [element].\n */\npublic operator fun Iterable.minus(element: T): List {\n val result = ArrayList(collectionSizeOrDefault(10))\n var removed = false\n return this.filterTo(result) { if (!removed && it == element) { removed = true; false } else true }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] array.\n * \n * The [elements] array may be converted to a [HashSet] to speed up the operation, thus the elements are required to have\n * a correct and stable implementation of `hashCode()` that doesn't change between successive invocations.\n */\npublic operator fun Iterable.minus(elements: Array): List {\n if (elements.isEmpty()) return this.toList()\n val other = elements.toHashSet()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] collection.\n * \n * The [elements] collection may be converted to a [HashSet] to speed up the operation, thus the elements are required to have\n * a correct and stable implementation of `hashCode()` that doesn't change between successive invocations.\n */\npublic operator fun Iterable.minus(elements: Iterable): List {\n val other = elements.convertToSetForSetOperationWith(this)\n if (other.isEmpty())\n return this.toList()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] sequence.\n * \n * The [elements] sequence may be converted to a [HashSet] to speed up the operation, thus the elements are required to have\n * a correct and stable implementation of `hashCode()` that doesn't change between successive invocations.\n */\npublic operator fun Iterable.minus(elements: Sequence): List {\n val other = elements.toHashSet()\n if (other.isEmpty())\n return this.toList()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection without the first occurrence of the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minusElement(element: T): List {\n return minus(element)\n}\n\n/**\n * Splits the original collection into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n */\npublic inline fun Iterable.partition(predicate: (T) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\npublic operator fun Iterable.plus(element: T): List {\n if (this is Collection) return this.plus(element)\n val result = ArrayList()\n result.addAll(this)\n result.add(element)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\npublic operator fun Collection.plus(element: T): List {\n val result = ArrayList(size + 1)\n result.addAll(this)\n result.add(element)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] array.\n */\npublic operator fun Iterable.plus(elements: Array): List {\n if (this is Collection) return this.plus(elements)\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] array.\n */\npublic operator fun Collection.plus(elements: Array): List {\n val result = ArrayList(this.size + elements.size)\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] collection.\n */\npublic operator fun Iterable.plus(elements: Iterable): List {\n if (this is Collection) return this.plus(elements)\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] collection.\n */\npublic operator fun Collection.plus(elements: Iterable): List {\n if (elements is Collection) {\n val result = ArrayList(this.size + elements.size)\n result.addAll(this)\n result.addAll(elements)\n return result\n } else {\n val result = ArrayList(this)\n result.addAll(elements)\n return result\n }\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] sequence.\n */\npublic operator fun Iterable.plus(elements: Sequence): List {\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] sequence.\n */\npublic operator fun Collection.plus(elements: Sequence): List {\n val result = ArrayList(this.size + 10)\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.plusElement(element: T): List {\n return plus(element)\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection.plusElement(element: T): List {\n return plus(element)\n}\n\n/**\n * Returns a list of snapshots of the window of the given [size]\n * sliding along this collection with the given [step], where each\n * snapshot is a list.\n * \n * Several last lists may have less elements than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this collection.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.takeWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false): List> {\n checkWindowSizeStep(size, step)\n if (this is RandomAccess && this is List) {\n val thisSize = this.size\n val result = ArrayList>((thisSize + step - 1) / step)\n var index = 0\n while (index < thisSize) {\n val windowSize = size.coerceAtMost(thisSize - index)\n if (windowSize < size && !partialWindows) break\n result.add(List(windowSize) { this[it + index] })\n index += step\n }\n return result\n }\n val result = ArrayList>()\n windowedIterator(iterator(), size, step, partialWindows, reuseBuffer = false).forEach {\n result.add(it)\n }\n return result\n}\n\n/**\n * Returns a list of results of applying the given [transform] function to\n * an each list representing a view over the window of the given [size]\n * sliding along this collection with the given [step].\n * \n * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * Several last lists may have less elements than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this collection.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.averageWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false, transform: (List) -> R): List {\n checkWindowSizeStep(size, step)\n if (this is RandomAccess && this is List) {\n val thisSize = this.size\n val result = ArrayList((thisSize + step - 1) / step)\n val window = MovingSubList(this)\n var index = 0\n while (index < thisSize) {\n window.move(index, (index + size).coerceAtMost(thisSize))\n if (!partialWindows && window.size < size) break\n result.add(transform(window))\n index += step\n }\n return result\n }\n val result = ArrayList()\n windowedIterator(iterator(), size, step, partialWindows, reuseBuffer = true).forEach {\n result.add(transform(it))\n }\n return result\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun Iterable.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` collection and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun Iterable.zip(other: Array, transform: (a: T, b: R) -> V): List {\n val arraySize = other.size\n val list = ArrayList(minOf(collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in this) {\n if (i >= arraySize) break\n list.add(transform(element, other[i++]))\n }\n return list\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] collection with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun Iterable.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` collection and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun Iterable.zip(other: Iterable, transform: (a: T, b: R) -> V): List {\n val first = iterator()\n val second = other.iterator()\n val list = ArrayList(minOf(collectionSizeOrDefault(10), other.collectionSizeOrDefault(10)))\n while (first.hasNext() && second.hasNext()) {\n list.add(transform(first.next(), second.next()))\n }\n return list\n}\n\n/**\n * Returns a list of pairs of each two adjacent elements in this collection.\n * \n * The returned list is empty if this collection contains less than two elements.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNext\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.zipWithNext(): List> {\n return zipWithNext { a, b -> a to b }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to an each pair of two adjacent elements in this collection.\n * \n * The returned list is empty if this collection contains less than two elements.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNextToFindDeltas\n */\n@SinceKotlin(\"1.2\")\npublic inline fun Iterable.zipWithNext(transform: (a: T, b: T) -> R): List {\n val iterator = iterator()\n if (!iterator.hasNext()) return emptyList()\n val result = mutableListOf()\n var current = iterator.next()\n while (iterator.hasNext()) {\n val next = iterator.next()\n result.add(transform(current, next))\n current = next\n }\n return result\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun Iterable.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n buffer.appendElement(element, transform)\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun Iterable.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Returns this collection as an [Iterable].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.asIterable(): Iterable {\n return this\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original collection returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromCollection\n */\npublic fun Iterable.asSequence(): Sequence {\n return Sequence { this.iterator() }\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfByte\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfShort\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfInt\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfLong\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfFloat\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfDouble\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfByte\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfShort\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfInt\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfLong\")\npublic fun Iterable.sum(): Long {\n var sum: Long = 0L\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfFloat\")\npublic fun Iterable.sum(): Float {\n var sum: Float = 0.0f\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfDouble\")\npublic fun Iterable.sum(): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.js.*\nimport primitiveArrayConcat\nimport withType\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun Array.elementAt(index: Int): T {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun ByteArray.elementAt(index: Int): Byte {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun ShortArray.elementAt(index: Int): Short {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun IntArray.elementAt(index: Int): Int {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun LongArray.elementAt(index: Int): Long {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun FloatArray.elementAt(index: Int): Float {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun DoubleArray.elementAt(index: Int): Double {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun BooleanArray.elementAt(index: Int): Boolean {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun CharArray.elementAt(index: Int): Char {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic actual fun Array.asList(): List {\n return ArrayList(this.unsafeCast>())\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun ByteArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun ShortArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun IntArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun LongArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun FloatArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun DoubleArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun BooleanArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic actual fun CharArray.asList(): List {\n return object : AbstractList(), RandomAccess {\n override val size: Int get() = this@asList.size\n override fun isEmpty(): Boolean = this@asList.isEmpty()\n override fun contains(element: Char): Boolean = this@asList.contains(element)\n override fun get(index: Int): Char {\n AbstractList.checkElementIndex(index, size)\n return this@asList[index]\n }\n override fun indexOf(element: Char): Int {\n if ((element as Any?) !is Char) return -1\n return this@asList.indexOf(element)\n }\n override fun lastIndexOf(element: Char): Int {\n if ((element as Any?) !is Char) return -1\n return this@asList.lastIndexOf(element)\n }\n }\n}\n\n/**\n * Returns `true` if the two specified arrays are *deeply* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * If two corresponding elements are nested arrays, they are also compared deeply.\n * If any of arrays contains itself on any nesting level the behavior is undefined.\n * \n * The elements of other types are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayDeepEquals\")\npublic actual infix fun Array.contentDeepEquals(other: Array): Boolean {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level the behavior is undefined.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayDeepHashCode\")\npublic actual fun Array.contentDeepHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of this array as if it is a [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level that reference\n * is rendered as `\"[...]\"` to prevent recursion.\n * \n * @sample samples.collections.Arrays.ContentOperations.contentDeepToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayDeepToString\")\npublic actual fun Array.contentDeepToString(): String {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun Array.contentEquals(other: Array): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun ByteArray.contentEquals(other: ByteArray): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun ShortArray.contentEquals(other: ShortArray): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun IntArray.contentEquals(other: IntArray): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun LongArray.contentEquals(other: LongArray): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun FloatArray.contentEquals(other: FloatArray): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun DoubleArray.contentEquals(other: DoubleArray): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun BooleanArray.contentEquals(other: BooleanArray): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayEquals\")\npublic actual infix fun CharArray.contentEquals(other: CharArray): Boolean {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun Array.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun ByteArray.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun ShortArray.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun IntArray.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun LongArray.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun FloatArray.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun DoubleArray.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun BooleanArray.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayHashCode\")\npublic actual fun CharArray.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun Array.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun ByteArray.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun ShortArray.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun IntArray.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun LongArray.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun FloatArray.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun DoubleArray.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun BooleanArray.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.1\")\n@library(\"arrayToString\")\npublic actual fun CharArray.contentToString(): String {\n definedExternally\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun Array.copyInto(destination: Array, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array {\n arrayCopy(this, destination, destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\", \"NOTHING_TO_INLINE\")\npublic actual inline fun Array.copyOf(): Array {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun ByteArray.copyOf(): ByteArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun ShortArray.copyOf(): ShortArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun IntArray.copyOf(): IntArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic actual fun LongArray.copyOf(): LongArray {\n return withType(\"LongArray\", this.asDynamic().slice())\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun FloatArray.copyOf(): FloatArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun DoubleArray.copyOf(): DoubleArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic actual fun BooleanArray.copyOf(): BooleanArray {\n return withType(\"BooleanArray\", this.asDynamic().slice())\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic actual fun CharArray.copyOf(): CharArray {\n return withType(\"CharArray\", this.asDynamic().slice())\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun ByteArray.copyOf(newSize: Int): ByteArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, ByteArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun ShortArray.copyOf(newSize: Int): ShortArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, ShortArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun IntArray.copyOf(newSize: Int): IntArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, IntArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun LongArray.copyOf(newSize: Int): LongArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return withType(\"LongArray\", arrayCopyResize(this, newSize, 0L))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun FloatArray.copyOf(newSize: Int): FloatArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, FloatArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun DoubleArray.copyOf(newSize: Int): DoubleArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, DoubleArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with `false` values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `false` values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun BooleanArray.copyOf(newSize: Int): BooleanArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return withType(\"BooleanArray\", arrayCopyResize(this, newSize, false))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with null char (`\\u0000`) values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with null char (`\\u0000`) values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun CharArray.copyOf(newSize: Int): CharArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return withType(\"CharArray\", fillFrom(this, CharArray(newSize)))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with `null` values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `null` values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizingCopyOf\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\")\npublic actual fun Array.copyOf(newSize: Int): Array {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return arrayCopyResize(this, newSize, null)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\")\npublic actual fun Array.copyOfRange(fromIndex: Int, toIndex: Int): Array {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\npublic actual fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\npublic actual fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\npublic actual fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\npublic actual fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return withType(\"LongArray\", this.asDynamic().slice(fromIndex, toIndex))\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\npublic actual fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\npublic actual fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\npublic actual fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return withType(\"BooleanArray\", this.asDynamic().slice(fromIndex, toIndex))\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive), must be in `0..array.size`\n * @param toIndex the end of the range (exclusive), must be in `fromIndex..array.size`\n */\npublic actual fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return withType(\"CharArray\", this.asDynamic().slice(fromIndex, toIndex))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\", \"NOTHING_TO_INLINE\")\npublic actual inline operator fun Array.plus(element: T): Array {\n return this.asDynamic().concat(arrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun ByteArray.plus(element: Byte): ByteArray {\n return plus(byteArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun ShortArray.plus(element: Short): ShortArray {\n return plus(shortArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun IntArray.plus(element: Int): IntArray {\n return plus(intArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun LongArray.plus(element: Long): LongArray {\n return plus(longArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun FloatArray.plus(element: Float): FloatArray {\n return plus(floatArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun DoubleArray.plus(element: Double): DoubleArray {\n return plus(doubleArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun BooleanArray.plus(element: Boolean): BooleanArray {\n return plus(booleanArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun CharArray.plus(element: Char): CharArray {\n return plus(charArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\")\npublic actual operator fun Array.plus(elements: Collection): Array {\n return arrayPlusCollection(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun ByteArray.plus(elements: Collection): ByteArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun ShortArray.plus(elements: Collection): ShortArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun IntArray.plus(elements: Collection): IntArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun LongArray.plus(elements: Collection): LongArray {\n return arrayPlusCollection(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun FloatArray.plus(elements: Collection): FloatArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun DoubleArray.plus(elements: Collection): DoubleArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun BooleanArray.plus(elements: Collection): BooleanArray {\n return arrayPlusCollection(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun CharArray.plus(elements: Collection): CharArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\", \"NOTHING_TO_INLINE\")\npublic actual inline operator fun Array.plus(elements: Array): Array {\n return this.asDynamic().concat(elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun ByteArray.plus(elements: ByteArray): ByteArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun ShortArray.plus(elements: ShortArray): ShortArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun IntArray.plus(elements: IntArray): IntArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun LongArray.plus(elements: LongArray): LongArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun FloatArray.plus(elements: FloatArray): FloatArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun CharArray.plus(elements: CharArray): CharArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\", \"NOTHING_TO_INLINE\")\npublic actual inline fun Array.plusElement(element: T): Array {\n return this.asDynamic().concat(arrayOf(element))\n}\n\n/**\n * Sorts the array in-place.\n */\n@library(\"primitiveArraySort\")\npublic actual fun IntArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n */\npublic actual fun LongArray.sort(): Unit {\n if (size > 1) sort { a: Long, b: Long -> a.compareTo(b) }\n}\n\n/**\n * Sorts the array in-place.\n */\n@library(\"primitiveArraySort\")\npublic actual fun ByteArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n */\n@library(\"primitiveArraySort\")\npublic actual fun ShortArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n */\n@library(\"primitiveArraySort\")\npublic actual fun DoubleArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n */\n@library(\"primitiveArraySort\")\npublic actual fun FloatArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n */\n@library(\"primitiveArraySort\")\npublic actual fun CharArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place according to the natural order of its elements.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic actual fun > Array.sort(): Unit {\n if (size > 1) sortArray(this)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun Array.sort(comparison: (a: T, b: T) -> Int): Unit {\n if (size > 1) sortArrayWith(this, comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.sort(noinline comparison: (a: Byte, b: Byte) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.sort(noinline comparison: (a: Short, b: Short) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.sort(noinline comparison: (a: Int, b: Int) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.sort(noinline comparison: (a: Long, b: Long) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.sort(noinline comparison: (a: Float, b: Float) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic actual fun Array.sortWith(comparator: Comparator): Unit {\n if (size > 1) sortArrayWith(this, comparator)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun ByteArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun ShortArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun IntArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun LongArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun FloatArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun DoubleArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun BooleanArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun CharArray.toTypedArray(): Array {\n return Array(size) { index -> this[index] }\n}\n\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines\n\nimport kotlin.coroutines.intrinsics.*\nimport kotlin.internal.InlineOnly\n\n/**\n * Interface representing a continuation after a suspension point that returns a value of type `T`.\n */\n@SinceKotlin(\"1.3\")\npublic interface Continuation {\n /**\n * The context of the coroutine that corresponds to this continuation.\n */\n public val context: CoroutineContext\n\n /**\n * Resumes the execution of the corresponding coroutine passing a successful or failed [result] as the\n * return value of the last suspension point.\n */\n public fun resumeWith(result: Result)\n}\n\n/**\n * Classes and interfaces marked with this annotation are restricted when used as receivers for extension\n * `suspend` functions. These `suspend` extensions can only invoke other member or extension `suspend` functions on this particular\n * receiver and are restricted from calling arbitrary suspension functions.\n */\n@SinceKotlin(\"1.3\")\n@Target(AnnotationTarget.CLASS)\n@Retention(AnnotationRetention.BINARY)\npublic annotation class RestrictsSuspension\n\n/**\n * Resumes the execution of the corresponding coroutine passing [value] as the return value of the last suspension point.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic inline fun Continuation.resume(value: T): Unit =\n resumeWith(Result.success(value))\n\n/**\n * Resumes the execution of the corresponding coroutine so that the [exception] is re-thrown right after the\n * last suspension point.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic inline fun Continuation.resumeWithException(exception: Throwable): Unit =\n resumeWith(Result.failure(exception))\n\n\n/**\n * Creates a [Continuation] instance with the given [context] and implementation of [resumeWith] method.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic inline fun Continuation(\n context: CoroutineContext,\n crossinline resumeWith: (Result) -> Unit\n): Continuation =\n object : Continuation {\n override val context: CoroutineContext\n get() = context\n\n override fun resumeWith(result: Result) =\n resumeWith(result)\n }\n\n/**\n * Creates a coroutine without a receiver and with result type [T].\n * This function creates a new, fresh instance of suspendable computation every time it is invoked.\n *\n * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance.\n * The [completion] continuation is invoked when the coroutine completes with a result or an exception.\n * Subsequent invocation of any resume function on the resulting continuation will produce an [IllegalStateException].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"UNCHECKED_CAST\")\npublic fun (suspend () -> T).createCoroutine(\n completion: Continuation\n): Continuation =\n SafeContinuation(createCoroutineUnintercepted(completion).intercepted(), COROUTINE_SUSPENDED)\n\n/**\n * Creates a coroutine with receiver type [R] and result type [T].\n * This function creates a new, fresh instance of suspendable computation every time it is invoked.\n *\n * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance.\n * The [completion] continuation is invoked when the coroutine completes with a result or an exception.\n * Subsequent invocation of any resume function on the resulting continuation will produce an [IllegalStateException].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"UNCHECKED_CAST\")\npublic fun (suspend R.() -> T).createCoroutine(\n receiver: R,\n completion: Continuation\n): Continuation =\n SafeContinuation(createCoroutineUnintercepted(receiver, completion).intercepted(), COROUTINE_SUSPENDED)\n\n/**\n * Starts a coroutine without a receiver and with result type [T].\n * This function creates and starts a new, fresh instance of suspendable computation every time it is invoked.\n * The [completion] continuation is invoked when the coroutine completes with a result or an exception.\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"UNCHECKED_CAST\")\npublic fun (suspend () -> T).startCoroutine(\n completion: Continuation\n) {\n createCoroutineUnintercepted(completion).intercepted().resume(Unit)\n}\n\n/**\n * Starts a coroutine with receiver type [R] and result type [T].\n * This function creates and starts a new, fresh instance of suspendable computation every time it is invoked.\n * The [completion] continuation is invoked when the coroutine completes with a result or an exception.\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"UNCHECKED_CAST\")\npublic fun (suspend R.() -> T).startCoroutine(\n receiver: R,\n completion: Continuation\n) {\n createCoroutineUnintercepted(receiver, completion).intercepted().resume(Unit)\n}\n\n/**\n * Obtains the current continuation instance inside suspend functions and suspends\n * the currently running coroutine.\n *\n * In this function both [Continuation.resume] and [Continuation.resumeWithException] can be used either synchronously in\n * the same stack-frame where the suspension function is run or asynchronously later in the same thread or\n * from a different thread of execution. Subsequent invocation of any resume function will produce an [IllegalStateException].\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic suspend inline fun suspendCoroutine(crossinline block: (Continuation) -> Unit): T =\n suspendCoroutineUninterceptedOrReturn { c: Continuation ->\n val safe = SafeContinuation(c.intercepted())\n block(safe)\n safe.getOrThrow()\n }\n\n/**\n * Returns the context of the current coroutine.\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"WRONG_MODIFIER_TARGET\")\n@InlineOnly\npublic suspend inline val coroutineContext: CoroutineContext\n get() {\n throw NotImplementedError(\"Implemented as intrinsic\")\n }\n",null,null,null,null,null,"/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"ArraysKt\")\n\n\npackage kotlin.collections\n\nimport kotlin.contracts.*\n\n\n/**\n * Returns a single list of all elements from all arrays in the given array.\n * @sample samples.collections.Arrays.Transformations.flattenArray\n */\npublic fun Array>.flatten(): List {\n val result = ArrayList(sumBy { it.size })\n for (element in this) {\n result.addAll(element)\n }\n return result\n}\n\n/**\n * Returns a pair of lists, where\n * *first* list is built from the first values of each pair from this array,\n * *second* list is built from the second values of each pair from this array.\n * @sample samples.collections.Arrays.Transformations.unzipArray\n */\npublic fun Array>.unzip(): Pair, List> {\n val listT = ArrayList(size)\n val listR = ArrayList(size)\n for (pair in this) {\n listT.add(pair.first)\n listR.add(pair.second)\n }\n return listT to listR\n}\n\n/**\n * Returns `true` if this nullable array is either null or empty.\n * @sample samples.collections.Arrays.Usage.arrayIsNullOrEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Array<*>?.isNullOrEmpty(): Boolean {\n contract {\n returns(false) implies (this@isNullOrEmpty != null)\n }\n\n return this == null || this.isEmpty()\n}\n\n/**\n * Returns this array if it's not empty\n * or the result of calling [defaultValue] function if the array is empty.\n *\n * @sample samples.collections.Arrays.Usage.arrayIfEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"UPPER_BOUND_CANNOT_BE_ARRAY\")\npublic inline fun C.ifEmpty(defaultValue: () -> R): R where C : Array<*>, C : R =\n if (isEmpty()) defaultValue() else this\n\n\n@UseExperimental(ExperimentalUnsignedTypes::class)\n@SinceKotlin(\"1.3\")\n@PublishedApi\n@kotlin.jvm.JvmName(\"contentDeepEquals\")\n@kotlin.js.JsName(\"contentDeepEqualsImpl\")\ninternal fun Array.contentDeepEqualsImpl(other: Array): Boolean {\n if (this === other) return true\n if (this.size != other.size) return false\n\n for (i in indices) {\n val v1 = this[i]\n val v2 = other[i]\n\n if (v1 === v2) {\n continue\n } else if (v1 == null || v2 == null) {\n return false\n }\n\n when {\n v1 is Array<*> && v2 is Array<*> -> if (!v1.contentDeepEquals(v2)) return false\n v1 is ByteArray && v2 is ByteArray -> if (!v1.contentEquals(v2)) return false\n v1 is ShortArray && v2 is ShortArray -> if (!v1.contentEquals(v2)) return false\n v1 is IntArray && v2 is IntArray -> if (!v1.contentEquals(v2)) return false\n v1 is LongArray && v2 is LongArray -> if (!v1.contentEquals(v2)) return false\n v1 is FloatArray && v2 is FloatArray -> if (!v1.contentEquals(v2)) return false\n v1 is DoubleArray && v2 is DoubleArray -> if (!v1.contentEquals(v2)) return false\n v1 is CharArray && v2 is CharArray -> if (!v1.contentEquals(v2)) return false\n v1 is BooleanArray && v2 is BooleanArray -> if (!v1.contentEquals(v2)) return false\n\n v1 is UByteArray && v2 is UByteArray -> if (!v1.contentEquals(v2)) return false\n v1 is UShortArray && v2 is UShortArray -> if (!v1.contentEquals(v2)) return false\n v1 is UIntArray && v2 is UIntArray -> if (!v1.contentEquals(v2)) return false\n v1 is ULongArray && v2 is ULongArray -> if (!v1.contentEquals(v2)) return false\n\n else -> if (v1 != v2) return false\n }\n\n }\n return true\n}\n\n@SinceKotlin(\"1.3\")\n@PublishedApi\n@kotlin.jvm.JvmName(\"contentDeepToString\")\n@kotlin.js.JsName(\"contentDeepToStringImpl\")\ninternal fun Array.contentDeepToStringImpl(): String {\n val length = size.coerceAtMost((Int.MAX_VALUE - 2) / 5) * 5 + 2 // in order not to overflow Int.MAX_VALUE\n return buildString(length) {\n contentDeepToStringInternal(this, mutableListOf())\n }\n}\n\n@UseExperimental(ExperimentalUnsignedTypes::class)\nprivate fun Array.contentDeepToStringInternal(result: StringBuilder, processed: MutableList>) {\n if (this in processed) {\n result.append(\"[...]\")\n return\n }\n processed.add(this)\n result.append('[')\n\n for (i in indices) {\n if (i != 0) {\n result.append(\", \")\n }\n val element = this[i]\n when (element) {\n null -> result.append(\"null\")\n is Array<*> -> element.contentDeepToStringInternal(result, processed)\n is ByteArray -> result.append(element.contentToString())\n is ShortArray -> result.append(element.contentToString())\n is IntArray -> result.append(element.contentToString())\n is LongArray -> result.append(element.contentToString())\n is FloatArray -> result.append(element.contentToString())\n is DoubleArray -> result.append(element.contentToString())\n is CharArray -> result.append(element.contentToString())\n is BooleanArray -> result.append(element.contentToString())\n\n is UByteArray -> result.append(element.contentToString())\n is UShortArray -> result.append(element.contentToString())\n is UIntArray -> result.append(element.contentToString())\n is ULongArray -> result.append(element.contentToString())\n\n else -> result.append(element.toString())\n }\n }\n\n result.append(']')\n processed.removeAt(processed.lastIndex)\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:Suppress(\"UNUSED_PARAMETER\", \"NOTHING_TO_INLINE\")\n\npackage kotlin\n\n/**\n * Returns an empty array of the specified type [T].\n */\npublic inline fun emptyArray(): Array = js(\"[]\")\n\n@library\npublic fun arrayOf(vararg elements: T): Array = definedExternally\n\n@library\npublic fun doubleArrayOf(vararg elements: Double): DoubleArray = definedExternally\n\n@library\npublic fun floatArrayOf(vararg elements: Float): FloatArray = definedExternally\n\n@library\npublic fun longArrayOf(vararg elements: Long): LongArray = definedExternally\n\n@library\npublic fun intArrayOf(vararg elements: Int): IntArray = definedExternally\n\n@library\npublic fun charArrayOf(vararg elements: Char): CharArray = definedExternally\n\n@library\npublic fun shortArrayOf(vararg elements: Short): ShortArray = definedExternally\n\n@library\npublic fun byteArrayOf(vararg elements: Byte): ByteArray = definedExternally\n\n@library\npublic fun booleanArrayOf(vararg elements: Boolean): BooleanArray = definedExternally\n\n/**\n * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].\n */\npublic actual fun lazy(initializer: () -> T): Lazy = UnsafeLazyImpl(initializer)\n\n/**\n * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].\n *\n * The [mode] parameter is ignored. */\npublic actual fun lazy(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy = UnsafeLazyImpl(initializer)\n\n/**\n * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].\n *\n * The [lock] parameter is ignored.\n */\npublic actual fun lazy(lock: Any?, initializer: () -> T): Lazy = UnsafeLazyImpl(initializer)\n\n\ninternal fun fillFrom(src: dynamic, dst: dynamic): dynamic {\n val srcLen: Int = src.length\n val dstLen: Int = dst.length\n var index: Int = 0\n while (index < srcLen && index < dstLen) dst[index] = src[index++]\n return dst\n}\n\n\ninternal fun arrayCopyResize(source: dynamic, newSize: Int, defaultValue: Any?): dynamic {\n val result = source.slice(0, newSize)\n copyArrayType(source, result)\n var index: Int = source.length\n if (newSize > index) {\n result.length = newSize\n while (index < newSize) result[index++] = defaultValue\n }\n return result\n}\n\ninternal fun arrayPlusCollection(array: dynamic, collection: Collection): dynamic {\n val result = array.slice()\n result.length += collection.size\n copyArrayType(array, result)\n var index: Int = array.length\n for (element in collection) result[index++] = element\n return result\n}\n\ninternal fun fillFromCollection(dst: dynamic, startIndex: Int, collection: Collection): dynamic {\n var index = startIndex\n for (element in collection) dst[index++] = element\n return dst\n}\n\ninternal inline fun copyArrayType(from: dynamic, to: dynamic) {\n if (from.`$type$` !== undefined) {\n to.`$type$` = from.`$type$`\n }\n}\n\ninternal inline fun jsIsType(obj: dynamic, jsClass: dynamic) = js(\"Kotlin\").isType(obj, jsClass)","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:Suppress(\"UNCHECKED_CAST\", \"RedundantVisibilityModifier\")\n\npackage kotlin\n\nimport kotlin.contracts.*\nimport kotlin.internal.InlineOnly\nimport kotlin.jvm.JvmField\n\n/**\n * A discriminated union that encapsulates successful outcome with a value of type [T]\n * or a failure with an arbitrary [Throwable] exception.\n */\n@Suppress(\"NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS\")\n@SinceKotlin(\"1.3\")\npublic inline class Result @PublishedApi internal constructor(\n @PublishedApi\n internal val value: Any?\n) : Serializable {\n // discovery\n\n /**\n * Returns `true` if this instance represents successful outcome.\n * In this case [isFailure] returns `false`.\n */\n public val isSuccess: Boolean get() = value !is Failure\n\n /**\n * Returns `true` if this instance represents failed outcome.\n * In this case [isSuccess] returns `false`.\n */\n public val isFailure: Boolean get() = value is Failure\n\n // value & exception retrieval\n\n /**\n * Returns the encapsulated value if this instance represents [success][Result.isSuccess] or `null`\n * if it is [failure][Result.isFailure].\n *\n * This function is shorthand for `getOrElse { null }` (see [getOrElse]) or\n * `fold(onSuccess = { it }, onFailure = { null })` (see [fold]).\n */\n @InlineOnly\n public inline fun getOrNull(): T? =\n when {\n isFailure -> null\n else -> value as T\n }\n\n /**\n * Returns the encapsulated exception if this instance represents [failure][isFailure] or `null`\n * if it is [success][isSuccess].\n *\n * This function is shorthand for `fold(onSuccess = { null }, onFailure = { it })` (see [fold]).\n */\n public fun exceptionOrNull(): Throwable? =\n when (value) {\n is Failure -> value.exception\n else -> null\n }\n\n /**\n * Returns a string `Success(v)` if this instance represents [success][Result.isSuccess]\n * where `v` is a string representation of the value or a string `Failure(x)` if\n * it is [failure][isFailure] where `x` is a string representation of the exception.\n */\n public override fun toString(): String =\n when (value) {\n is Failure -> value.toString() // \"Failure($exception)\"\n else -> \"Success($value)\"\n }\n\n // companion with constructors\n\n /**\n * Companion object for [Result] class that contains its constructor functions\n * [success] and [failure].\n */\n public companion object {\n /**\n * Returns an instance that encapsulates the given [value] as successful value.\n */\n @InlineOnly\n public inline fun success(value: T): Result =\n Result(value)\n\n /**\n * Returns an instance that encapsulates the given [exception] as failure.\n */\n @InlineOnly\n public inline fun failure(exception: Throwable): Result =\n Result(createFailure(exception))\n }\n\n internal class Failure(\n @JvmField\n val exception: Throwable\n ) : Serializable {\n override fun equals(other: Any?): Boolean = other is Failure && exception == other.exception\n override fun hashCode(): Int = exception.hashCode()\n override fun toString(): String = \"Failure($exception)\"\n }\n}\n\n/**\n * Creates an instance of internal marker [Result.Failure] class to\n * make sure that this class is not exposed in ABI.\n */\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun createFailure(exception: Throwable): Any =\n Result.Failure(exception)\n\n/**\n * Throws exception if the result is failure. This internal function minimizes\n * inlined bytecode for [getOrThrow] and makes sure that in the future we can\n * add some exception-augmenting logic here (if needed).\n */\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun Result<*>.throwOnFailure() {\n if (value is Result.Failure) throw value.exception\n}\n\n/**\n * Calls the specified function [block] and returns its encapsulated result if invocation was successful,\n * catching and encapsulating any thrown exception as a failure.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun runCatching(block: () -> R): Result {\n return try {\n Result.success(block())\n } catch (e: Throwable) {\n Result.failure(e)\n }\n}\n\n/**\n * Calls the specified function [block] with `this` value as its receiver and returns its encapsulated result\n * if invocation was successful, catching and encapsulating any thrown exception as a failure.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun T.runCatching(block: T.() -> R): Result {\n return try {\n Result.success(block())\n } catch (e: Throwable) {\n Result.failure(e)\n }\n}\n\n// -- extensions ---\n\n/**\n * Returns the encapsulated value if this instance represents [success][Result.isSuccess] or throws the encapsulated exception\n * if it is [failure][Result.isFailure].\n *\n * This function is shorthand for `getOrElse { throw it }` (see [getOrElse]).\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.getOrThrow(): T {\n throwOnFailure()\n return value as T\n}\n\n/**\n * Returns the encapsulated value if this instance represents [success][Result.isSuccess] or the\n * result of [onFailure] function for encapsulated exception if it is [failure][Result.isFailure].\n *\n * Note, that an exception thrown by [onFailure] function is rethrown by this function.\n *\n * This function is shorthand for `fold(onSuccess = { it }, onFailure = onFailure)` (see [fold]).\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.getOrElse(onFailure: (exception: Throwable) -> R): R {\n contract {\n callsInPlace(onFailure, InvocationKind.AT_MOST_ONCE)\n }\n return when (val exception = exceptionOrNull()) {\n null -> value as T\n else -> onFailure(exception)\n }\n}\n\n/**\n * Returns the encapsulated value if this instance represents [success][Result.isSuccess] or the\n * [defaultValue] if it is [failure][Result.isFailure].\n *\n * This function is shorthand for `getOrElse { defaultValue }` (see [getOrElse]).\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.getOrDefault(defaultValue: R): R {\n if (isFailure) return defaultValue\n return value as T\n}\n\n/**\n * Returns the the result of [onSuccess] for encapsulated value if this instance represents [success][Result.isSuccess]\n * or the result of [onFailure] function for encapsulated exception if it is [failure][Result.isFailure].\n *\n * Note, that an exception thrown by [onSuccess] or by [onFailure] function is rethrown by this function.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.fold(\n onSuccess: (value: T) -> R,\n onFailure: (exception: Throwable) -> R\n): R {\n contract {\n callsInPlace(onSuccess, InvocationKind.AT_MOST_ONCE)\n callsInPlace(onFailure, InvocationKind.AT_MOST_ONCE)\n }\n return when (val exception = exceptionOrNull()) {\n null -> onSuccess(value as T)\n else -> onFailure(exception)\n }\n}\n\n// transformation\n\n/**\n * Returns the encapsulated result of the given [transform] function applied to encapsulated value\n * if this instance represents [success][Result.isSuccess] or the\n * original encapsulated exception if it is [failure][Result.isFailure].\n *\n * Note, that an exception thrown by [transform] function is rethrown by this function.\n * See [mapCatching] for an alternative that encapsulates exceptions.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.map(transform: (value: T) -> R): Result {\n contract {\n callsInPlace(transform, InvocationKind.AT_MOST_ONCE)\n }\n return when {\n isSuccess -> Result.success(transform(value as T))\n else -> Result(value)\n }\n}\n\n/**\n * Returns the encapsulated result of the given [transform] function applied to encapsulated value\n * if this instance represents [success][Result.isSuccess] or the\n * original encapsulated exception if it is [failure][Result.isFailure].\n *\n * Any exception thrown by [transform] function is caught, encapsulated as a failure and returned by this function.\n * See [map] for an alternative that rethrows exceptions.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.mapCatching(transform: (value: T) -> R): Result {\n return when {\n isSuccess -> runCatching { transform(value as T) }\n else -> Result(value)\n }\n}\n\n/**\n * Returns the encapsulated result of the given [transform] function applied to encapsulated exception\n * if this instance represents [failure][Result.isFailure] or the\n * original encapsulated value if it is [success][Result.isSuccess].\n *\n * Note, that an exception thrown by [transform] function is rethrown by this function.\n * See [recoverCatching] for an alternative that encapsulates exceptions.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.recover(transform: (exception: Throwable) -> R): Result {\n contract {\n callsInPlace(transform, InvocationKind.AT_MOST_ONCE)\n }\n return when (val exception = exceptionOrNull()) {\n null -> this\n else -> Result.success(transform(exception))\n }\n}\n\n/**\n * Returns the encapsulated result of the given [transform] function applied to encapsulated exception\n * if this instance represents [failure][Result.isFailure] or the\n * original encapsulated value if it is [success][Result.isSuccess].\n *\n * Any exception thrown by [transform] function is caught, encapsulated as a failure and returned by this function.\n * See [recover] for an alternative that rethrows exceptions.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.recoverCatching(transform: (exception: Throwable) -> R): Result {\n val value = value // workaround for inline classes BE bug\n return when (val exception = exceptionOrNull()) {\n null -> this\n else -> runCatching { transform(exception) }\n }\n}\n\n// \"peek\" onto value/exception and pipe\n\n/**\n * Performs the given [action] on encapsulated exception if this instance represents [failure][Result.isFailure].\n * Returns the original `Result` unchanged.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.onFailure(action: (exception: Throwable) -> Unit): Result {\n contract {\n callsInPlace(action, InvocationKind.AT_MOST_ONCE)\n }\n exceptionOrNull()?.let { action(it) }\n return this\n}\n\n/**\n * Performs the given [action] on encapsulated value if this instance represents [success][Result.isSuccess].\n * Returns the original `Result` unchanged.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.onSuccess(action: (value: T) -> Unit): Result {\n contract {\n callsInPlace(action, InvocationKind.AT_MOST_ONCE)\n }\n if (isSuccess) action(value as T)\n return this\n}\n\n// -------------------\n",null,null,null],"names":[],"mappings":";;;;;;;;;;;mBAiGA,mC;uBCm9QA,gD;kBC95QI,kB;mBCAA,mB;;;;;;;;;;;;;;;;;;;gBCzIJ,K;aC4NiE,wB;oBC3NjE,qC;gCC2wCA,yD;kBC5wBA,mC;eH5OA,a;yBE45BA,+C;eAOA,wC;;;eE/pCA,oB;oBA6FA,uD;8BAAA,sD;;;;;;;;;;;;;;;;ICzGkE,OAAA,ECmJE,c;EDnJe,C;;ITkiRxE,kBAAM,eSniRE,STmiRW,OAAb,C;IA6UA,Q;IAAb,wBSh3Re,STg3Rf,gB;MAAa,WSh3RE,STg3Rf,M;MACI,WAAY,WDjyRsD,WCiyRxC,IDjyRwC,EUhFhC,EVgFgC,CCiyRtD,C;;ISj3RhB,eAA4C,QTk3RrC,WSl3RqC,EAAQ,EAAR,C;IHyhD5B,U;IAAA,SGxhDhB,QHwhDgB,W;IAAhB,OAAgB,gBAAhB,C;MAAgB,2B;MGxhDG,QAAW,aHwhDD,OGxhDC,EAAyB,GAAzB,kCAA8B,4BAA9B,CAAX,C;;EACvB,C;;IAIkE,OAAA,EC8IE,c;ED9Ie,C;;IT6hRxE,kBAAM,eS9hRE,ST8hRW,OAAb,C;IA6UA,Q;IAAb,wBS32Re,ST22Rf,gB;MAAa,WS32RE,ST22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d,MEiFY,SAAX,C;YepF9B,gB;kBAAA,cASY,Y;YATZ,gB;;;;MhBrMJ,MAAM,CAAN,e;;IgBoMA,OhBlMG,K;EgB+MP,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"crypto-core.js","sources":["kotlin/text/numberConversions.kt","generated/_Arrays.kt","kotlin/UInt.kt","kotlin/ULong.kt","arrayUtils.kt","kotlin/UByte.kt","kotlin/collections.kt","generated/_Collections.kt","generated/_ArraysJs.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/Config.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/Util.kt","kotlin/text/string.kt","collections/Collections.kt","util/Standard.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2b.kt","collections/Arrays.kt","kotlin/kotlin.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha256.kt","../../../../../src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha512.kt"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;;;;;mBAiGA,mC;uBCm9QA,gD;kBC95QI,kB;mBCAA,mB;;;;;;;;;;;gBCzIJ,K;aC4NiE,wB;oBC3NjE,qC;gCC2wCA,yD;kBC5wBA,mC;eH5OA,a;yBE45BA,+C;eAOA,wC;;;;IElrCA,sB;IAMI,aAAkB,K;EANtB,C;;;;;;;;IAAA,6B;MAAA,Y;;IAAA,sB;EAAA,C;;;;;;;;;;;;;;;;ICOkE,OAAA,ECmJE,c;EDnJe,C;;ITkiRxE,kBAAM,eSniRE,STmiRW,OAAb,C;IA6UA,Q;IAAb,wBSh3Re,STg3Rf,gB;MAAa,WSh3RE,STg3Rf,M;MACI,WAAY,WDjyRsD,WCiyRxC,IDjyRwC,EUhFhC,EVgFgC,CCiyRtD,C;;ISj3RhB,eAA4C,QTk3RrC,WSl3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eyI1B,EfzI0B,CAAN,CAGU,MAAL,KAAoB,aAApB,CAAN,CAgEd,MEiFY,SAAX,C;YanB1B,gB;kBAAA,cASY,Y;YATZ,gB;;;;MdtQR,MAAM,CAAN,e;;IcqQI,OdnQD,K;EcgRH,C;;;;;;;;IAvQJ,uC;MAAA,sB;;IAAA,gC;EAAA,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/crypto-core/node_modules/crypto-core.meta.js b/crypto-core/node_modules/crypto-core.meta.js index 018a5b2..f426d75 100644 --- a/crypto-core/node_modules/crypto-core.meta.js +++ b/crypto-core/node_modules/crypto-core.meta.js @@ -1 +1 @@ -// Kotlin.kotlin_module_metadata(393729, "crypto-core", "H4sIAAAAAAAAAJVXS3MjRRJWP9QqVetRbr9kwTAeDyxgGJDFeHjDWB6D/HZIdjDsxdGWylJjqVsrtSbGHDaAjfDeCQ4EB4572B9AcOBIBH+JCCLYzapKSd0ywwSH7uz8MpVVnZmVXytBDOd7k/6kUaMRdGnKC/xBz/OpdRGEHSEb/cteGFCz6g7a1NjwL2nupNd0Q+6edbgEU4320L/gTZrc6PfdS6od0/Sg4zV43fucU2PbD2muzR9vBp1hd3DU90A3T3wP7pXLkNPkCYq9wG9Rux+EELzmtdrCTfzY6nXcBh/Qpa3HPd73utwP3c6JP/BaPm8eX/b4wOlTnSWoSRJMg7vGdLjrzKAWMZhZSIBVh+ckS8KzwCwpk4ygtFFmUeZQ5lEylA7KuUKi+ItWLLNUMedQhzimo1fTJVIiKxZsIl3QVsdY2WK0qJfS1SvyI9GKsywDGlX2kl2S4EIMzJTIr1riOp4d48tsBvDcKlwQflaG/7cJxq+JTvITjyx4ZP/Y4yvdpDpZ+pYYKzY5L5hlvWT9SBJSSYFigvI1MWmCJpyf8/R/yac0SOqs417w8hlNVfAhvRl0e64PP8DuyVS2j+un2wennxzWHqjGsCt7h5u7p5VPj7fqNLe/8fC0ulGvop4X+vbB0ckxAtYZ1HwoN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kIErJSBmTVhpN8BTgFJ2cojQzoni5cQE2I0wMmekI8z4yMxGmiEw2wiwgcybCfIrMbITJVU2aG0fj3iPeIapZ+lyoGKZ4MeCMaBiFn2Wi5+ILvBCnr0ta+Tkya5Jh1k1eJNf5Hn7qy/Mm9UsCgjiiSdKM1NEF+h4+zmCw34/U07KfFT+Zc7QsTFYm8rGRDlchJzS6ygtxg9A1/puKvDFLPzi5ATfNigkNq0Pm9ep7jAG5Mba79zjFAzJF3wnClsLHd3ki+aMZLmRhqQVvhnmOvDNOifDxTbLYUBGxZX5nwLfKU1qm0m9ZKOktq3T1zXC39K9sEHTG2vqHa0GrnOaNa39zuXZ7/4Pq9ub+3vrWrrhYzUxO3dneujXsWVPc0J8E7W6wXqixSUcg11uiJUifQGbY2tCRGm92Rd46TrBLILFRHxOtb9RGhl3qlAaldKyPINWvt1hj0GZik/gDqz1gE/QSZDx3x28/fIfA4+Aucbrk+xG9ulQC8MMQvPnscJ2l0rWy7Y1WM7/8b/0h6Au6uHbq4rqpi+umTpMCMwLPCjwvcF70gkti/IKPKn3RR5PvEfSE75VhTyB+T7jo6wS/cs4IzArkSgDBoZn2RYCTuTA5J8j8mDyHQjC8pyZCwo0jPn0+Mq3hNBfgoe6n0ZuFZ/HmgiALYfLiSTKLPWq03eKptHGKVJPqGV+qASk0+JroyP6l7EjIc3E2xrwa8FmaCtvzjEg7XPHTkxqeRlkPfAA/NEiYEWIonudH2km5doZVIcOv2b/LPKHTEwk1RAgNEUJjdKUPJdQQuTPCCTVElo3/MaFP9eaCIAth8uJJMosieTJzz5xQigm6HE4cPyI8QeNsGJPZME5kwzw1G/ivjcr/sckLRc6Lfyz+BhYSXt9cDwAA"); diff --git a/crypto-core/node_modules/crypto-core/com/ionspin/kotlin/crypto/blake2b/blake2b.kjsm b/crypto-core/node_modules/crypto-core/com/ionspin/kotlin/crypto/blake2b/blake2b.kjsm index 13907cee297bc6c6ab732b4289f589c149d09377..03c499a41419932fca16f597c2b1dbf8d31790d7 100644 GIT binary patch delta 484 zcmYk2PfG$p7{+&IcgJzb^>x$KwNlE0%s?#7?5~!&c(hAb#XSfXVjFafs7@Wif#^^j zyL5^O`T#*+q+^})*zB^Pr+1!te)GH!Gw^?_w>k9wn(w2DQ01&^_S#40vDN4tSglUG zS?adg7kXmPxT?xM^Tf0ia@uV*ER)5=N%X)9;`tnfR76k+6=BVp6t>-2jR?AUPosC{ zVK)r927zh&iQ#dU)-_lkt~$I{Ia>F^21mSH@#7}D^Cag3ytLx{o1a(raq0p~3Z_vz LCG}H;}8*W0E&QU zCos(+-~y$6ptP?9gB0@&4i=?c5#d*dGAgsd3ZoWwZ9gg68=rC1~w4FrWaIG6-1!B)Dm zspvQZS>iw^xgr_FCg29P1MCP%0e7epkI7TnlIB`-(^n}8!wR;-DMg^P(pauNpK}zZS^B1f) GGGtHsQY+j5 diff --git a/crypto-core/node_modules/crypto-core/com/ionspin/kotlin/crypto/sha/sha.kjsm b/crypto-core/node_modules/crypto-core/com/ionspin/kotlin/crypto/sha/sha.kjsm index 1fac5207d08591a26f44fd7fa7d9dd2fb0af7f49..e7fccdd21ca7481e946f4749e6cd1f601359eeaa 100644 GIT binary patch literal 1491 zcmb`G%Wm3G5QgnzV;=^R93UiwHkXp#7ZD((s=5nN+T0UyQ7;?hf(35CAnZh;tE!8v ztE{Rl`v6_{o%#Y@Rh@woZfUD7y0CxwoAEz${L6}>Xo{k!crm<;<>X?e)m(F0uGejXgjVCvE1w8R{3C~uvdPbKRPIvb`Fc6m#8#5S=v83d;x*de#@;vkQ#gM zf$_5M$DA_=Y;-zS7t|AAl{%>BpyI=Oh~UQUj_rB4NWrN!tu(0CO_~AK2BYfKY|qC* zxvp=6*~HhZ8uEhQad2{c>%47uoTlyiR-@oo8_wH}wgXzzdI!^9rEXVG8@3!0II|k3 z_5{vA#BUv2)v8^k3H^=rZOf~}!l-x2^_-e(SBu@Y?e)IsdL|1{qR-Gj`TVs{Ci^t! z_yf1-Cl#1bKmra)Py@n1Wmq@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Hash { companion object : Hash { @@ -75,8 +75,6 @@ class Blake2b(val key: Array? = null, val hashLength: Int = 64) : Updatea internal fun mixRound(input: Array, message: Array, round: Int): Array { var v = input val selectedSigma = sigma[round % 10] - val printout = v.map { it.toString(16) }.chunked(3) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } v = mix(v, 0, 4, 8, 12, message[selectedSigma[0]], message[selectedSigma[1]]) v = mix(v, 1, 5, 9, 13, message[selectedSigma[2]], message[selectedSigma[3]]) v = mix(v, 2, 6, 10, 14, message[selectedSigma[4]], message[selectedSigma[5]]) @@ -120,11 +118,11 @@ class Blake2b(val key: Array? = null, val hashLength: Int = 64) : Updatea acc[slot] = acc[slot] + (byte.toULong() shl ((position) * 8)) acc } - - println("m") - val printout = m.map { it.toString(16) }.chunked(4) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } - println("Offset ${offsetCounter}") + if (Config.DEBUG) { + val printout = m.map { it.toString(16) }.chunked(4) + printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } + println("Offset ${offsetCounter}") + } v[12] = v[12] xor offsetCounter.ulongValue() v[13] = v[13] xor (offsetCounter shr BITS_IN_WORD).ulongValue() @@ -144,7 +142,7 @@ class Blake2b(val key: Array? = null, val hashLength: Int = 64) : Updatea return h } - + @ExperimentalStdlibApi fun digest(inputString: String, key: String? = null): Array { val chunked = inputString.encodeToByteArray().map { it.toUByte() }.toList().chunked(BLOCK_BYTES) .map { it.toTypedArray() }.toTypedArray() @@ -239,7 +237,7 @@ class Blake2b(val key: Array? = null, val hashLength: Int = 64) : Updatea } } - + @ExperimentalStdlibApi constructor( key: String?, requestedHashLenght: Int = 64 @@ -248,10 +246,6 @@ class Blake2b(val key: Array? = null, val hashLength: Int = 64) : Updatea requestedHashLenght ) - var job = Job() - val scope = CoroutineScope(Dispatchers.Default + job) - - var h = iv.copyOf() var counter = BigInteger.ZERO var bufferCounter = 0 @@ -306,7 +300,7 @@ class Blake2b(val key: Array? = null, val hashLength: Int = 64) : Updatea } } - + @ExperimentalStdlibApi fun update(input: String) { update(input.encodeToByteArray().map { it.toUByte() }.toTypedArray()) } @@ -326,7 +320,7 @@ class Blake2b(val key: Array? = null, val hashLength: Int = 64) : Updatea compress(h, lastBlockPadded, counter, true) val result = formatResult(h) - println(result.map { it.toString(16) }.joinToString(separator = "")) + reset() return result } @@ -335,6 +329,13 @@ class Blake2b(val key: Array? = null, val hashLength: Int = 64) : Updatea return digest().map { it.toString(16) }.joinToString(separator = "") } + private fun reset() { + h = iv.copyOf() + counter = BigInteger.ZERO + bufferCounter = 0 + buffer = Array(BLOCK_BYTES) { 0U } + } + } diff --git a/crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha256.kt b/crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha256.kt index 0d4c96d..2f506db 100644 --- a/crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha256.kt +++ b/crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha256.kt @@ -16,6 +16,7 @@ package com.ionspin.kotlin.crypto.sha +import com.ionspin.kotlin.crypto.Hash import com.ionspin.kotlin.crypto.chunked import com.ionspin.kotlin.crypto.rotateRight @@ -26,8 +27,10 @@ import com.ionspin.kotlin.crypto.rotateRight * on 17-Jul-2019 */ + @ExperimentalUnsignedTypes -class Sha256() { +class Sha256() : Hash { + companion object { const val BLOCK_SIZE = 512 const val W_SIZE = 64 @@ -35,181 +38,185 @@ class Sha256() { const val BYTE_MASK_FROM_ULONG = 0xFFUL const val BYTE_MASK_FROM_UINT = 0xFFU - } + val iv = arrayOf( + 0x6a09e667U, + 0xbb67ae85U, + 0x3c6ef372U, + 0xa54ff53aU, + 0x510e527fU, + 0x9b05688cU, + 0x1f83d9abU, + 0x5be0cd19U + ) - var h0 = 0x6a09e667U - var h1 = 0xbb67ae85U - var h2 = 0x3c6ef372U - var h3 = 0xa54ff53aU - var h4 = 0x510e527fU - var h5 = 0x9b05688cU - var h6 = 0x1f83d9abU - var h7 = 0x5be0cd19U + val k = arrayOf( + 0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U, 0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U, + 0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U, 0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U, + 0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU, 0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU, + 0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U, 0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U, + 0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U, 0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U, + 0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U, 0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U, + 0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U, 0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U, + 0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U, 0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U + ) - val k = arrayOf( - 0x428a2f98U, 0x71374491U, 0xb5c0fbcfU, 0xe9b5dba5U, 0x3956c25bU, 0x59f111f1U, 0x923f82a4U, 0xab1c5ed5U, - 0xd807aa98U, 0x12835b01U, 0x243185beU, 0x550c7dc3U, 0x72be5d74U, 0x80deb1feU, 0x9bdc06a7U, 0xc19bf174U, - 0xe49b69c1U, 0xefbe4786U, 0x0fc19dc6U, 0x240ca1ccU, 0x2de92c6fU, 0x4a7484aaU, 0x5cb0a9dcU, 0x76f988daU, - 0x983e5152U, 0xa831c66dU, 0xb00327c8U, 0xbf597fc7U, 0xc6e00bf3U, 0xd5a79147U, 0x06ca6351U, 0x14292967U, - 0x27b70a85U, 0x2e1b2138U, 0x4d2c6dfcU, 0x53380d13U, 0x650a7354U, 0x766a0abbU, 0x81c2c92eU, 0x92722c85U, - 0xa2bfe8a1U, 0xa81a664bU, 0xc24b8b70U, 0xc76c51a3U, 0xd192e819U, 0xd6990624U, 0xf40e3585U, 0x106aa070U, - 0x19a4c116U, 0x1e376c08U, 0x2748774cU, 0x34b0bcb5U, 0x391c0cb3U, 0x4ed8aa4aU, 0x5b9cca4fU, 0x682e6ff3U, - 0x748f82eeU, 0x78a5636fU, 0x84c87814U, 0x8cc70208U, 0x90befffaU, 0xa4506cebU, 0xbef9a3f7U, 0xc67178f2U - ) - - fun digest(message: Array) : Array { - - val originalMessageSizeInBits = message.size * 8 - - - //K such that L + 1 + K + 64 is a multiple of 512 - val expandedRemainderOf512 = (originalMessageSizeInBits + 65) % BLOCK_SIZE - val zeroAddAmount = when (expandedRemainderOf512) { - 0 -> 0 - else -> (BLOCK_SIZE - expandedRemainderOf512) / 8 + @ExperimentalStdlibApi + fun digest(message : String) : Array { + return digest(message.encodeToByteArray().map { it.toUByte() }.toTypedArray()) } - val expansionArray = Array(zeroAddAmount + 1) { - when (it) { - 0 -> 0b10000000U //TODO This wont work if there the byte needs to be shared with the L (length) ULong - else -> 0U + + fun digest(message: Array) : Array { + + var h0 = 0x6a09e667U + var h1 = 0xbb67ae85U + var h2 = 0x3c6ef372U + var h3 = 0xa54ff53aU + var h4 = 0x510e527fU + var h5 = 0x9b05688cU + var h6 = 0x1f83d9abU + var h7 = 0x5be0cd19U + + val originalMessageSizeInBits = message.size * 8 + + + //K such that L + 1 + K + 64 is a multiple of 512 + val expandedRemainderOf512 = (originalMessageSizeInBits + 65) % BLOCK_SIZE + val zeroAddAmount = when (expandedRemainderOf512) { + 0 -> 0 + else -> (BLOCK_SIZE - expandedRemainderOf512) / 8 } - } - - val chunks = (message + expansionArray + originalMessageSizeInBits.toULong().toPaddedByteArray()).chunked(64) - - chunks.forEach { chunk -> - val w = Array(W_SIZE) { + val expansionArray = Array(zeroAddAmount + 1) { when (it) { - in 0 until 16 -> { - var collected = (chunk[(it * 4)].toUInt() shl 24) + - (chunk[(it * 4) + 1].toUInt() shl 16 ) + - (chunk[(it * 4) + 2].toUInt() shl 8 ) + - (chunk[(it * 4) + 3].toUInt()) - collected - } + 0 -> 0b10000000U //TODO This wont work if there the byte needs to be shared with the L (length) ULong else -> 0U } } - for (i in 16 until W_SIZE) { - val s0 = scheduleSigma0(w[i - 15]) - val s1 = scheduleSigma1(w[i - 2]) - w[i] = w[i-16] + s0 + w[i - 7] + s1 + + val chunks = (message + expansionArray + originalMessageSizeInBits.toULong().toPaddedByteArray()).chunked(64) + + chunks.forEach { chunk -> + val w = Array(W_SIZE) { + when (it) { + in 0 until 16 -> { + var collected = (chunk[(it * 4)].toUInt() shl 24) + + (chunk[(it * 4) + 1].toUInt() shl 16 ) + + (chunk[(it * 4) + 2].toUInt() shl 8 ) + + (chunk[(it * 4) + 3].toUInt()) + collected + } + else -> 0U + } + } + for (i in 16 until W_SIZE) { + val s0 = scheduleSigma0(w[i - 15]) + val s1 = scheduleSigma1(w[i - 2]) + w[i] = w[i-16] + s0 + w[i - 7] + s1 + } + + var a = h0 + var b = h1 + var c = h2 + var d = h3 + var e = h4 + var f = h5 + var g = h6 + var h = h7 + + for (i in 0 until W_SIZE) { + val s1 = compressionSigma1(e) + val ch = ch(e, f, g) + val temp1 = h + s1 + ch + k[i] + w[i] + val s0 = compressionSigma0(a) + val maj = maj(a,b,c) + val temp2 = s0 + maj + h = g + g = f + f = e + e = d + temp1 + d = c + c = b + b = a + a = temp1 + temp2 + } + + h0 += a + h1 += b + h2 += c + h3 += d + h4 += e + h5 += f + h6 += g + h7 += h + } - var a = h0 - var b = h1 - var c = h2 - var d = h3 - var e = h4 - var f = h5 - var g = h6 - var h = h7 - - for (i in 0 until W_SIZE) { - val s1 = compressionSigma1(e) - val ch = ch(e, f, g) - val temp1 = h + s1 + ch + k[i] + w[i] - val s0 = compressionSigma0(a) - val maj = maj(a,b,c) - val temp2 = s0 + maj - h = g - g = f - f = e - e = d + temp1 - d = c - c = b - b = a - a = temp1 + temp2 - } - - h0 += a - h1 += b - h2 += c - h3 += d - h4 += e - h5 += f - h6 += g - h7 += h - + val digest = h0.toPaddedByteArray() + + h1.toPaddedByteArray() + + h2.toPaddedByteArray() + + h3.toPaddedByteArray() + + h4.toPaddedByteArray() + + h5.toPaddedByteArray() + + h6.toPaddedByteArray() + + h7.toPaddedByteArray() + return digest } - val digest = h0.toPaddedByteArray() + - h1.toPaddedByteArray() + - h2.toPaddedByteArray() + - h3.toPaddedByteArray() + - h4.toPaddedByteArray() + - h5.toPaddedByteArray() + - h6.toPaddedByteArray() + - h7.toPaddedByteArray() - reset() - return digest - } + private fun scheduleSigma0(value: UInt): UInt { + return value.rotateRight(7) xor value.rotateRight(18) xor (value shr 3) + } - private fun reset() { - h0 = 0x6a09e667U - h1 = 0xbb67ae85U - h2 = 0x3c6ef372U - h3 = 0xa54ff53aU - h4 = 0x510e527fU - h5 = 0x9b05688cU - h6 = 0x1f83d9abU - h7 = 0x5be0cd19U - } + private fun scheduleSigma1(value : UInt) : UInt { + return value.rotateRight(17) xor value.rotateRight(19) xor (value shr 10) + } - private fun scheduleSigma0(value: UInt): UInt { - return value.rotateRight(7) xor value.rotateRight(18) xor (value shr 3) - } + private fun compressionSigma0(a : UInt) : UInt { + return (a rotateRight 2) xor (a rotateRight 13) xor (a rotateRight 22) + } - private fun scheduleSigma1(value : UInt) : UInt { - return value.rotateRight(17) xor value.rotateRight(19) xor (value shr 10) - } + private fun compressionSigma1(e : UInt) : UInt { + return (e rotateRight 6) xor (e rotateRight 11) xor (e rotateRight 25) + } - private fun compressionSigma0(a : UInt) : UInt { - return (a rotateRight 2) xor (a rotateRight 13) xor (a rotateRight 22) - } + private fun ch(x : UInt, y : UInt, z : UInt) : UInt { + return ((x and y) xor ((x xor UINT_MASK) and z)) + } - private fun compressionSigma1(e : UInt) : UInt { - return (e rotateRight 6) xor (e rotateRight 11) xor (e rotateRight 25) - } + private fun maj(x : UInt, y : UInt, z : UInt) : UInt { + return (((x and y) xor (x and z) xor (y and z))) + } - private fun ch(x : UInt, y : UInt, z : UInt) : UInt { - return ((x and y) xor ((x xor UINT_MASK) and z)) - } - private fun maj(x : UInt, y : UInt, z : UInt) : UInt { - return (((x and y) xor (x and z) xor (y and z))) - } - - - private fun ULong.toPaddedByteArray(): Array { - val byteMask = BYTE_MASK_FROM_ULONG - return Array(8) { - when (it) { - 7 -> (this and byteMask).toUByte() - 6 -> ((this shr 8) and byteMask).toUByte() - 5 -> ((this shr 16) and byteMask).toUByte() - 4 -> ((this shr 24) and byteMask).toUByte() - 3 -> ((this shr 32) and byteMask).toUByte() - 2 -> ((this shr 40) and byteMask).toUByte() - 1 -> ((this shr 48) and byteMask).toUByte() - 0 -> ((this shr 54) and byteMask).toUByte() - else -> throw RuntimeException("Invalid conversion") + private fun ULong.toPaddedByteArray(): Array { + val byteMask = BYTE_MASK_FROM_ULONG + return Array(8) { + when (it) { + 7 -> (this and byteMask).toUByte() + 6 -> ((this shr 8) and byteMask).toUByte() + 5 -> ((this shr 16) and byteMask).toUByte() + 4 -> ((this shr 24) and byteMask).toUByte() + 3 -> ((this shr 32) and byteMask).toUByte() + 2 -> ((this shr 40) and byteMask).toUByte() + 1 -> ((this shr 48) and byteMask).toUByte() + 0 -> ((this shr 54) and byteMask).toUByte() + else -> throw RuntimeException("Invalid conversion") + } } } - } - private fun UInt.toPaddedByteArray(): Array { - val byteMask = BYTE_MASK_FROM_UINT - return Array(4) { - when (it) { - 3 -> (this and byteMask).toUByte() - 2 -> ((this shr 8) and byteMask).toUByte() - 1 -> ((this shr 16) and byteMask).toUByte() - 0 -> ((this shr 24) and byteMask).toUByte() - else -> throw RuntimeException("Invalid conversion") + private fun UInt.toPaddedByteArray(): Array { + val byteMask = BYTE_MASK_FROM_UINT + return Array(4) { + when (it) { + 3 -> (this and byteMask).toUByte() + 2 -> ((this shr 8) and byteMask).toUByte() + 1 -> ((this shr 16) and byteMask).toUByte() + 0 -> ((this shr 24) and byteMask).toUByte() + else -> throw RuntimeException("Invalid conversion") + } } } + } @@ -217,4 +224,6 @@ class Sha256() { + + } \ No newline at end of file diff --git a/crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha512.kt b/crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha512.kt index 275ca51..ba6a9f5 100644 --- a/crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha512.kt +++ b/crypto-core/src/commonMain/kotlin/com/ionspin/kotlin/crypto/sha/Sha512.kt @@ -16,6 +16,7 @@ package com.ionspin.kotlin.crypto.sha +import com.ionspin.kotlin.crypto.Hash import com.ionspin.kotlin.crypto.chunked import com.ionspin.kotlin.crypto.rotateRight @@ -26,206 +27,272 @@ import com.ionspin.kotlin.crypto.rotateRight */ @ExperimentalUnsignedTypes -class Sha512 { +class Sha512 : Hash { companion object { const val BLOCK_SIZE = 1024 const val ULONG_MASK = 0xFFFFFFFFFFFFFFFFUL val k = arrayOf( - 0x428a2f98d728ae22UL, 0x7137449123ef65cdUL, 0xb5c0fbcfec4d3b2fUL, 0xe9b5dba58189dbbcUL, 0x3956c25bf348b538UL, - 0x59f111f1b605d019UL, 0x923f82a4af194f9bUL, 0xab1c5ed5da6d8118UL, 0xd807aa98a3030242UL, 0x12835b0145706fbeUL, - 0x243185be4ee4b28cUL, 0x550c7dc3d5ffb4e2UL, 0x72be5d74f27b896fUL, 0x80deb1fe3b1696b1UL, 0x9bdc06a725c71235UL, - 0xc19bf174cf692694UL, 0xe49b69c19ef14ad2UL, 0xefbe4786384f25e3UL, 0x0fc19dc68b8cd5b5UL, 0x240ca1cc77ac9c65UL, - 0x2de92c6f592b0275UL, 0x4a7484aa6ea6e483UL, 0x5cb0a9dcbd41fbd4UL, 0x76f988da831153b5UL, 0x983e5152ee66dfabUL, - 0xa831c66d2db43210UL, 0xb00327c898fb213fUL, 0xbf597fc7beef0ee4UL, 0xc6e00bf33da88fc2UL, 0xd5a79147930aa725UL, - 0x06ca6351e003826fUL, 0x142929670a0e6e70UL, 0x27b70a8546d22ffcUL, 0x2e1b21385c26c926UL, 0x4d2c6dfc5ac42aedUL, - 0x53380d139d95b3dfUL, 0x650a73548baf63deUL, 0x766a0abb3c77b2a8UL, 0x81c2c92e47edaee6UL, 0x92722c851482353bUL, - 0xa2bfe8a14cf10364UL, 0xa81a664bbc423001UL, 0xc24b8b70d0f89791UL, 0xc76c51a30654be30UL, 0xd192e819d6ef5218UL, - 0xd69906245565a910UL, 0xf40e35855771202aUL, 0x106aa07032bbd1b8UL, 0x19a4c116b8d2d0c8UL, 0x1e376c085141ab53UL, - 0x2748774cdf8eeb99UL, 0x34b0bcb5e19b48a8UL, 0x391c0cb3c5c95a63UL, 0x4ed8aa4ae3418acbUL, 0x5b9cca4f7763e373UL, - 0x682e6ff3d6b2b8a3UL, 0x748f82ee5defb2fcUL, 0x78a5636f43172f60UL, 0x84c87814a1f0ab72UL, 0x8cc702081a6439ecUL, - 0x90befffa23631e28UL, 0xa4506cebde82bde9UL, 0xbef9a3f7b2c67915UL, 0xc67178f2e372532bUL, 0xca273eceea26619cUL, - 0xd186b8c721c0c207UL, 0xeada7dd6cde0eb1eUL, 0xf57d4f7fee6ed178UL, 0x06f067aa72176fbaUL, 0x0a637dc5a2c898a6UL, - 0x113f9804bef90daeUL, 0x1b710b35131c471bUL, 0x28db77f523047d84UL, 0x32caab7b40c72493UL, 0x3c9ebe0a15c9bebcUL, - 0x431d67c49c100d4cUL, 0x4cc5d4becb3e42b6UL, 0x597f299cfc657e2aUL, 0x5fcb6fab3ad6faecUL, 0x6c44198c4a475817UL + 0x428a2f98d728ae22UL, + 0x7137449123ef65cdUL, + 0xb5c0fbcfec4d3b2fUL, + 0xe9b5dba58189dbbcUL, + 0x3956c25bf348b538UL, + 0x59f111f1b605d019UL, + 0x923f82a4af194f9bUL, + 0xab1c5ed5da6d8118UL, + 0xd807aa98a3030242UL, + 0x12835b0145706fbeUL, + 0x243185be4ee4b28cUL, + 0x550c7dc3d5ffb4e2UL, + 0x72be5d74f27b896fUL, + 0x80deb1fe3b1696b1UL, + 0x9bdc06a725c71235UL, + 0xc19bf174cf692694UL, + 0xe49b69c19ef14ad2UL, + 0xefbe4786384f25e3UL, + 0x0fc19dc68b8cd5b5UL, + 0x240ca1cc77ac9c65UL, + 0x2de92c6f592b0275UL, + 0x4a7484aa6ea6e483UL, + 0x5cb0a9dcbd41fbd4UL, + 0x76f988da831153b5UL, + 0x983e5152ee66dfabUL, + 0xa831c66d2db43210UL, + 0xb00327c898fb213fUL, + 0xbf597fc7beef0ee4UL, + 0xc6e00bf33da88fc2UL, + 0xd5a79147930aa725UL, + 0x06ca6351e003826fUL, + 0x142929670a0e6e70UL, + 0x27b70a8546d22ffcUL, + 0x2e1b21385c26c926UL, + 0x4d2c6dfc5ac42aedUL, + 0x53380d139d95b3dfUL, + 0x650a73548baf63deUL, + 0x766a0abb3c77b2a8UL, + 0x81c2c92e47edaee6UL, + 0x92722c851482353bUL, + 0xa2bfe8a14cf10364UL, + 0xa81a664bbc423001UL, + 0xc24b8b70d0f89791UL, + 0xc76c51a30654be30UL, + 0xd192e819d6ef5218UL, + 0xd69906245565a910UL, + 0xf40e35855771202aUL, + 0x106aa07032bbd1b8UL, + 0x19a4c116b8d2d0c8UL, + 0x1e376c085141ab53UL, + 0x2748774cdf8eeb99UL, + 0x34b0bcb5e19b48a8UL, + 0x391c0cb3c5c95a63UL, + 0x4ed8aa4ae3418acbUL, + 0x5b9cca4f7763e373UL, + 0x682e6ff3d6b2b8a3UL, + 0x748f82ee5defb2fcUL, + 0x78a5636f43172f60UL, + 0x84c87814a1f0ab72UL, + 0x8cc702081a6439ecUL, + 0x90befffa23631e28UL, + 0xa4506cebde82bde9UL, + 0xbef9a3f7b2c67915UL, + 0xc67178f2e372532bUL, + 0xca273eceea26619cUL, + 0xd186b8c721c0c207UL, + 0xeada7dd6cde0eb1eUL, + 0xf57d4f7fee6ed178UL, + 0x06f067aa72176fbaUL, + 0x0a637dc5a2c898a6UL, + 0x113f9804bef90daeUL, + 0x1b710b35131c471bUL, + 0x28db77f523047d84UL, + 0x32caab7b40c72493UL, + 0x3c9ebe0a15c9bebcUL, + 0x431d67c49c100d4cUL, + 0x4cc5d4becb3e42b6UL, + 0x597f299cfc657e2aUL, + 0x5fcb6fab3ad6faecUL, + 0x6c44198c4a475817UL ) - } - - var h0 = 0x6a09e667f3bcc908UL - var h1 = 0xbb67ae8584caa73bUL - var h2 = 0x3c6ef372fe94f82bUL - var h3 = 0xa54ff53a5f1d36f1UL - var h4 = 0x510e527fade682d1UL - var h5 = 0x9b05688c2b3e6c1fUL - var h6 = 0x1f83d9abfb41bd6bUL - var h7 = 0x5be0cd19137e2179UL + val iv = arrayOf( + 0x6a09e667f3bcc908UL, + 0xbb67ae8584caa73bUL, + 0x3c6ef372fe94f82bUL, + 0xa54ff53a5f1d36f1UL, + 0x510e527fade682d1UL, + 0x9b05688c2b3e6c1fUL, + 0x1f83d9abfb41bd6bUL, + 0x5be0cd19137e2179UL + ) - - - fun digest(message: Array) : Array { - - val originalMessageSizeInBits = message.size * 8 - - - //K such that L + 1 + K + 64 is a multiple of 512 - val expandedRemainderOf1024 = (originalMessageSizeInBits + 129) % BLOCK_SIZE - val zeroAddAmount = when (expandedRemainderOf1024) { - 0 -> 0 - else -> (BLOCK_SIZE - expandedRemainderOf1024) / 8 + @ExperimentalStdlibApi + fun digest(message: String): Array { + return digest(message.encodeToByteArray().map { it.toUByte() }.toTypedArray()) } - val expansionArray = Array(zeroAddAmount + 1) { - when (it) { - 0 -> 0b10000000U //TODO This wont work if there the byte needs to be shared with the L (length) ULong - else -> 0U + + fun digest(message: Array): Array { + + var h0 = 0x6a09e667f3bcc908UL + var h1 = 0xbb67ae8584caa73bUL + var h2 = 0x3c6ef372fe94f82bUL + var h3 = 0xa54ff53a5f1d36f1UL + var h4 = 0x510e527fade682d1UL + var h5 = 0x9b05688c2b3e6c1fUL + var h6 = 0x1f83d9abfb41bd6bUL + var h7 = 0x5be0cd19137e2179UL + + val originalMessageSizeInBits = message.size * 8 + + + //K such that L + 1 + K + 64 is a multiple of 512 + val expandedRemainderOf1024 = (originalMessageSizeInBits + 129) % BLOCK_SIZE + val zeroAddAmount = when (expandedRemainderOf1024) { + 0 -> 0 + else -> (BLOCK_SIZE - expandedRemainderOf1024) / 8 } - } - - val chunks = (message + expansionArray + originalMessageSizeInBits.toULong().toPadded128BitByteArray()).chunked(128) - - chunks.forEach { chunk -> - val w = Array(80) { + val expansionArray = Array(zeroAddAmount + 1) { when (it) { - in 0 until 16 -> { - var collected = (chunk[(it * 8)].toULong() shl 56) + - (chunk[(it * 8) + 1].toULong() shl 48 ) + - (chunk[(it * 8) + 2].toULong() shl 40 ) + - (chunk[(it * 8) + 3].toULong() shl 32 ) + - (chunk[(it * 8) + 4].toULong() shl 24 ) + - (chunk[(it * 8) + 5].toULong() shl 16 ) + - (chunk[(it * 8) + 6].toULong() shl 8 ) + - (chunk[(it * 8) + 7].toULong()) - collected - } - else -> 0UL + 0 -> 0b10000000U //TODO This wont work if there the byte needs to be shared with the L (length) ULong + else -> 0U } } - for (i in 16 until 80) { - val s0 = scheduleSigma0(w[i - 15]) - val s1 = scheduleSigma1(w[i - 2]) - w[i] = w[i-16] + s0 + w[i - 7] + s1 + + val chunks = + (message + expansionArray + originalMessageSizeInBits.toULong().toPadded128BitByteArray()).chunked(128) + + chunks.forEach { chunk -> + val w = Array(80) { + when (it) { + in 0 until 16 -> { + var collected = (chunk[(it * 8)].toULong() shl 56) + + (chunk[(it * 8) + 1].toULong() shl 48) + + (chunk[(it * 8) + 2].toULong() shl 40) + + (chunk[(it * 8) + 3].toULong() shl 32) + + (chunk[(it * 8) + 4].toULong() shl 24) + + (chunk[(it * 8) + 5].toULong() shl 16) + + (chunk[(it * 8) + 6].toULong() shl 8) + + (chunk[(it * 8) + 7].toULong()) + collected + } + else -> 0UL + } + } + for (i in 16 until 80) { + val s0 = scheduleSigma0(w[i - 15]) + val s1 = scheduleSigma1(w[i - 2]) + w[i] = w[i - 16] + s0 + w[i - 7] + s1 + } + + var a = h0 + var b = h1 + var c = h2 + var d = h3 + var e = h4 + var f = h5 + var g = h6 + var h = h7 + + for (i in 0 until 80) { + val s1 = compressionSigma1(e) + val ch = ch(e, f, g) + val temp1 = h + s1 + ch + k[i] + w[i] + val s0 = compressionSigma0(a) + val maj = maj(a, b, c) + val temp2 = s0 + maj + h = g + g = f + f = e + e = d + temp1 + d = c + c = b + b = a + a = temp1 + temp2 + } + + h0 += a + h1 += b + h2 += c + h3 += d + h4 += e + h5 += f + h6 += g + h7 += h + } - var a = h0 - var b = h1 - var c = h2 - var d = h3 - var e = h4 - var f = h5 - var g = h6 - var h = h7 - - for (i in 0 until 80) { - val s1 = compressionSigma1(e) - val ch = ch(e, f, g) - val temp1 = h + s1 + ch + k[i] + w[i] - val s0 = compressionSigma0(a) - val maj = maj(a,b,c) - val temp2 = s0 + maj - h = g - g = f - f = e - e = d + temp1 - d = c - c = b - b = a - a = temp1 + temp2 - } - - h0 += a - h1 += b - h2 += c - h3 += d - h4 += e - h5 += f - h6 += g - h7 += h - + val digest = h0.toPaddedByteArray() + + h1.toPaddedByteArray() + + h2.toPaddedByteArray() + + h3.toPaddedByteArray() + + h4.toPaddedByteArray() + + h5.toPaddedByteArray() + + h6.toPaddedByteArray() + + h7.toPaddedByteArray() + return digest } - val digest = h0.toPaddedByteArray() + - h1.toPaddedByteArray() + - h2.toPaddedByteArray() + - h3.toPaddedByteArray() + - h4.toPaddedByteArray() + - h5.toPaddedByteArray() + - h6.toPaddedByteArray() + - h7.toPaddedByteArray() - reset() - return digest - } + private fun scheduleSigma0(value: ULong): ULong { + return value.rotateRight(1) xor value.rotateRight(8) xor (value shr 7) + } - private fun reset() { - h0 = 0x6a09e667f3bcc908UL - h1 = 0xbb67ae8584caa73bUL - h2 = 0x3c6ef372fe94f82bUL - h3 = 0xa54ff53a5f1d36f1UL - h4 = 0x510e527fade682d1UL - h5 = 0x9b05688c2b3e6c1fUL - h6 = 0x1f83d9abfb41bd6bUL - h7 = 0x5be0cd19137e2179UL - } + private fun scheduleSigma1(value: ULong): ULong { + return value.rotateRight(19) xor value.rotateRight(61) xor (value shr 6) + } - private fun scheduleSigma0(value: ULong): ULong { - return value.rotateRight(1) xor value.rotateRight(8) xor (value shr 7) - } + private fun compressionSigma0(e: ULong): ULong { + return (e rotateRight 28) xor (e rotateRight 34) xor (e rotateRight 39) + } - private fun scheduleSigma1(value : ULong) : ULong { - return value.rotateRight(19) xor value.rotateRight(61) xor (value shr 6) - } + private fun compressionSigma1(a: ULong): ULong { + return (a rotateRight 14) xor (a rotateRight 18) xor (a rotateRight 41) + } - private fun compressionSigma0(e : ULong) : ULong { - return (e rotateRight 28) xor (e rotateRight 34) xor (e rotateRight 39) - } + private fun ch(x: ULong, y: ULong, z: ULong): ULong { + return ((x and y) xor ((x xor ULONG_MASK) and z)) + } - private fun compressionSigma1(a : ULong) : ULong { - return (a rotateRight 14) xor (a rotateRight 18) xor (a rotateRight 41) - } - - private fun ch(x : ULong, y : ULong, z : ULong) : ULong { - return ((x and y) xor ((x xor ULONG_MASK) and z)) - } - - private fun maj(x : ULong, y : ULong, z : ULong) : ULong { - return ((x and y) xor (x and z) xor (y and z)) - } + private fun maj(x: ULong, y: ULong, z: ULong): ULong { + return ((x and y) xor (x and z) xor (y and z)) + } + private fun ULong.toPaddedByteArray(): Array { + val byteMask = 0xFFUL + //Ignore messages longer than 64 bits for now + return Array(8) { + when (it) { + 7 -> (this and byteMask).toUByte() + 6 -> ((this shr 8) and byteMask).toUByte() + 5 -> ((this shr 16) and byteMask).toUByte() + 4 -> ((this shr 24) and byteMask).toUByte() + 3 -> ((this shr 32) and byteMask).toUByte() + 2 -> ((this shr 40) and byteMask).toUByte() + 1 -> ((this shr 48) and byteMask).toUByte() + 0 -> ((this shr 56) and byteMask).toUByte() + else -> 0U + } + } + } - private fun ULong.toPaddedByteArray(): Array { - val byteMask = 0xFFUL - //Ignore messages longer than 64 bits for now - return Array(8) { - when (it) { - 7 -> (this and byteMask).toUByte() - 6 -> ((this shr 8) and byteMask).toUByte() - 5 -> ((this shr 16) and byteMask).toUByte() - 4 -> ((this shr 24) and byteMask).toUByte() - 3 -> ((this shr 32) and byteMask).toUByte() - 2 -> ((this shr 40) and byteMask).toUByte() - 1 -> ((this shr 48) and byteMask).toUByte() - 0 -> ((this shr 56) and byteMask).toUByte() - else -> 0U + private fun ULong.toPadded128BitByteArray(): Array { + val byteMask = 0xFFUL + //Ignore messages longer than 64 bits for now + return Array(16) { + when (it) { + 15 -> (this and byteMask).toUByte() + 14 -> ((this shr 8) and byteMask).toUByte() + 13 -> ((this shr 16) and byteMask).toUByte() + 12 -> ((this shr 24) and byteMask).toUByte() + 11 -> ((this shr 32) and byteMask).toUByte() + 10 -> ((this shr 40) and byteMask).toUByte() + 9 -> ((this shr 48) and byteMask).toUByte() + 8 -> ((this shr 54) and byteMask).toUByte() + else -> 0U + } } } } - private fun ULong.toPadded128BitByteArray(): Array { - val byteMask = 0xFFUL - //Ignore messages longer than 64 bits for now - return Array(16) { - when (it) { - 15 -> (this and byteMask).toUByte() - 14 -> ((this shr 8) and byteMask).toUByte() - 13 -> ((this shr 16) and byteMask).toUByte() - 12 -> ((this shr 24) and byteMask).toUByte() - 11 -> ((this shr 32) and byteMask).toUByte() - 10 -> ((this shr 40) and byteMask).toUByte() - 9 -> ((this shr 48) and byteMask).toUByte() - 8 -> ((this shr 54) and byteMask).toUByte() - else -> 0U - } - } - } } \ No newline at end of file diff --git a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/ReadmeTest.kt b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/ReadmeTest.kt new file mode 100644 index 0000000..4f39cf1 --- /dev/null +++ b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/ReadmeTest.kt @@ -0,0 +1,100 @@ +/* + * Copyright 2019 Ugljesa Jovanovic + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.ionspin.kotlin.crypto + +import com.ionspin.kotlin.crypto.blake2b.Blake2b +import com.ionspin.kotlin.crypto.sha.Sha256 +import com.ionspin.kotlin.crypto.sha.Sha512 +import kotlin.test.Test + +import kotlin.test.assertTrue + +/** + * Created by Ugljesa Jovanovic + * ugljesa.jovanovic@ionspin.com + * on 20-Jul-2019 + */ +@ExperimentalUnsignedTypes +@ExperimentalStdlibApi +class ReadmeTest { + + @Test + fun blake2bObjectExample() { + val input = "abc" + val result = Blake2b.digest(input) + //@formatter:off + val expectedResult = arrayOf( + 0xBAU,0x80U,0xA5U,0x3FU,0x98U,0x1CU,0x4DU,0x0DU,0x6AU,0x27U,0x97U,0xB6U,0x9FU,0x12U,0xF6U,0xE9U, + 0x4CU,0x21U,0x2FU,0x14U,0x68U,0x5AU,0xC4U,0xB7U,0x4BU,0x12U,0xBBU,0x6FU,0xDBU,0xFFU,0xA2U,0xD1U, + 0x7DU,0x87U,0xC5U,0x39U,0x2AU,0xABU,0x79U,0x2DU,0xC2U,0x52U,0xD5U,0xDEU,0x45U,0x33U,0xCCU,0x95U, + 0x18U,0xD3U,0x8AU,0xA8U,0xDBU,0xF1U,0x92U,0x5AU,0xB9U,0x23U,0x86U,0xEDU,0xD4U,0x00U,0x99U,0x23U + ) + //@formatter:on + + assertTrue { + result.contentEquals(expectedResult) + } + } + + @Test + fun blake2bInstanceExample() { + val test = "abc" + val key = "key" + val blake2b = Blake2b(key) + blake2b.update(test) + val result = blake2b.digest() + + assertTrue { + result.isNotEmpty() + } + val expectedResult = ("5c6a9a4ae911c02fb7e71a991eb9aea371ae993d4842d206e" + + "6020d46f5e41358c6d5c277c110ef86c959ed63e6ecaaaceaaff38019a43264ae06acf73b9550b1") + .chunked(2).map { it.toUByte(16) }.toTypedArray() + + assertTrue { + result.contentEquals(expectedResult) + } + } + + @ExperimentalStdlibApi + @Test + fun sha256Example() { + val input ="abc" + val result = Sha256.digest(message = input) + val expectedResult = "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" + assertTrue { + result.contentEquals(expectedResult.chunked(2).map { it.toUByte(16) }.toTypedArray()) + } + + + } + + @ExperimentalStdlibApi + @Test + fun sha512Example() { + val input ="abc" + val result = Sha512.digest(message = input.encodeToByteArray().map { it.toUByte() }.toTypedArray()) + println(result.map {it.toString(16)}) + val expectedResult = "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a" + + "2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f" + assertTrue { + result.contentEquals(expectedResult.chunked(2).map { it.toUByte(16) }.toTypedArray()) + } + + + } +} \ No newline at end of file diff --git a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2BTest.kt b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2BTest.kt index 619bc3a..5916900 100644 --- a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2BTest.kt +++ b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2BTest.kt @@ -44,7 +44,6 @@ class Blake2BTest { "1234567890" + "1234567890" + "1234567890" - print("|$test|") val result = Blake2b.digest(test) //Generated with b2sum 8.31 @@ -58,9 +57,6 @@ class Blake2BTest { //@formatter:on ) - val printout = result.map { it.toString(16) }.chunked(16) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } - assertTrue { result.contentEquals(expectedResult) } @@ -79,7 +75,6 @@ class Blake2BTest { "1234567890" + "1234567890" - print("|$test|") val result = Blake2b.digest(test) val expectedResultString = "800bb78cd4da18995c8074713bb674" + @@ -87,9 +82,6 @@ class Blake2BTest { "4ce1935a76154d7ea7c410493557741d18ec3a08da75" val expectedResult = expectedResultString.chunked(2).map { it.toUByte(16) }.toTypedArray() - val printout = result.map { it.toString(16) }.chunked(16) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } - assertTrue { result.contentEquals(expectedResult) } @@ -111,9 +103,6 @@ class Blake2BTest { //@formatter:on ) - val printout = result.map { it.toString(16) }.chunked(16) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } - assertTrue { result.contentEquals(expectedResult) } @@ -126,10 +115,6 @@ class Blake2BTest { val key = "key" val result = Blake2b.digest(test, key) - val printout = result.map { it.toString(16) }.chunked(16) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } - - assertTrue { result.isNotEmpty() @@ -159,9 +144,6 @@ class Blake2BTest { ) //@formatter:on - val printout = result.map { it.toString(16) }.chunked(16) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } - assertTrue { result.contentEquals(expectedResult) } @@ -290,9 +272,6 @@ class Blake2BTest { val inputRound = mixChain[i] val round = i val result = Blake2b.mixRound(inputRound, message, round) - println("Result: ") - val printout = result.map { it.toString(16) }.chunked(3) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } val expectedResult = mixChain[i + 1] assertTrue { result.contentEquals(expectedResult) diff --git a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2bInstanceTest.kt b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2bInstanceTest.kt index 53be313..020232e 100644 --- a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2bInstanceTest.kt +++ b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/blake2b/Blake2bInstanceTest.kt @@ -80,10 +80,6 @@ class Blake2bInstanceTest { val blake2b = Blake2b(key) blake2b.update(test) val result = blake2b.digest() - val printout = result.map { it.toString(16) }.chunked(16) - printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) } - - assertTrue { result.isNotEmpty() diff --git a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/sha/Sha256Test.kt b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/sha/Sha256Test.kt index 1291f40..57507bd 100644 --- a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/sha/Sha256Test.kt +++ b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/sha/Sha256Test.kt @@ -30,10 +30,8 @@ class Sha256Test { @ExperimentalStdlibApi @Test fun testWellKnownValue() { - val sha = Sha256() - val result = sha.digest(message = "abc".encodeToByteArray().map { it.toUByte() }.toTypedArray()) - println(result.map {it.toString(16)}) + val result = Sha256.digest(message = "abc") val expectedResult = "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" assertTrue { result.contentEquals(expectedResult.chunked(2).map { it.toUByte(16) }.toTypedArray()) @@ -45,9 +43,8 @@ class Sha256Test { @ExperimentalStdlibApi @Test fun testWellKnownDoubleBlock() { - val sha = Sha256() - val resultDoubleBlock = sha.digest(message = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq".encodeToByteArray().map { it.toUByte() }.toTypedArray()) + val resultDoubleBlock = Sha256.digest(message = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") val expectedResultForDoubleBlock = "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1" assertTrue { resultDoubleBlock.contentEquals(expectedResultForDoubleBlock.chunked(2).map { it.toUByte(16) }.toTypedArray()) diff --git a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/sha/Sha512Test.kt b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/sha/Sha512Test.kt index 3c3a830..5a375e3 100644 --- a/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/sha/Sha512Test.kt +++ b/crypto-core/src/commonTest/kotlin/com/ionspin/kotlin/crypto/sha/Sha512Test.kt @@ -29,9 +29,8 @@ class Sha512Test { @ExperimentalStdlibApi @Test fun testWellKnownValue() { - val sha = Sha512() - val result = sha.digest(message = "abc".encodeToByteArray().map { it.toUByte() }.toTypedArray()) + val result = Sha512.digest(message = "abc".encodeToByteArray().map { it.toUByte() }.toTypedArray()) println(result.map {it.toString(16)}) val expectedResult = "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a" + "2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f" @@ -42,14 +41,13 @@ class Sha512Test { } + @ExperimentalUnsignedTypes @ExperimentalStdlibApi @Test fun testWellKnownDoubleBlock() { - val sha = Sha512() - val resultDoubleBlock = sha.digest(message = ("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" + - "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu").encodeToByteArray().map { it.toUByte() }.toTypedArray()) - println(resultDoubleBlock.map {it.toString(16)}) + val resultDoubleBlock = Sha512.digest(message = "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" + + "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu") val expectedResultForDoubleBlock = "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018" + "501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909" assertTrue { @@ -60,16 +58,11 @@ class Sha512Test { @ExperimentalStdlibApi @Test fun testWellKnownLong() { - val sha = Sha512() val inputBuilder = StringBuilder() for (i in 0 until 1000000) { inputBuilder.append("a") - if (i % 100000 == 0) { - println("$i / 1000000") - } } - val resultDoubleBlock = sha.digest(message = (inputBuilder.toString()).encodeToByteArray().map { it.toUByte() }.toTypedArray()) - println(resultDoubleBlock.map {it.toString(16)}) + val resultDoubleBlock = Sha512.digest(message = (inputBuilder.toString()).encodeToByteArray().map { it.toUByte() }.toTypedArray()) val expectedResultForDoubleBlock = "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b" assertTrue { resultDoubleBlock.contentEquals(expectedResultForDoubleBlock.chunked(2).map { it.toUByte(16) }.toTypedArray())