From: James Hartley Subject: RE: [PATCH V3 1/2] crypto: Add Imagination Technologies hw hash accelerator Date: Tue, 10 Mar 2015 15:31:35 +0000 Message-ID: <72BC0C8BD7BB6F45988A99382E5FBAE544463666@hhmail02.hh.imgtec.org> References: <1425610912-9930-1-git-send-email-james.hartley@imgtec.com> <1425610912-9930-2-git-send-email-james.hartley@imgtec.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: "linux-crypto@vger.kernel.org" To: Andrew Bresticker Return-path: Received: from mailapp01.imgtec.com ([195.59.15.196]:37162 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752848AbbCJPbk (ORCPT ); Tue, 10 Mar 2015 11:31:40 -0400 In-Reply-To: Content-Language: en-US Sender: linux-crypto-owner@vger.kernel.org List-ID: SGkgQW5kcmV3DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogYWJyZXN0 aWNAZ29vZ2xlLmNvbSBbbWFpbHRvOmFicmVzdGljQGdvb2dsZS5jb21dIE9uIEJlaGFsZiBPZg0K PiBBbmRyZXcgQnJlc3RpY2tlcg0KPiBTZW50OiAwOSBNYXJjaCAyMDE1IDA1OjQyDQo+IFRvOiBK YW1lcyBIYXJ0bGV5DQo+IENjOiBsaW51eC1jcnlwdG9Admdlci5rZXJuZWwub3JnDQo+IFN1Ympl Y3Q6IFJlOiBbUEFUQ0ggVjMgMS8yXSBjcnlwdG86IEFkZCBJbWFnaW5hdGlvbiBUZWNobm9sb2dp ZXMgaHcgaGFzaA0KPiBhY2NlbGVyYXRvcg0KPiANCj4gSGkgSmFtZXMsDQo+IA0KPiBPbiBUaHUs IE1hciA1LCAyMDE1IGF0IDc6MDEgUE0sIEphbWVzIEhhcnRsZXkgPGphbWVzLmhhcnRsZXlAaW1n dGVjLmNvbT4NCj4gd3JvdGU6DQo+ID4gVGhpcyBhZGRzIHN1cHBvcnQgZm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lIENSX0lOVF9ORVdfUkVTVUxUU19TRVQgICAgICAgICBCSVQoMSkNCj4gPiArI2RlZmlu ZSBDUl9JTlRfUkVTVUxUX1JFQURfRVJSICAgICAgICAgQklUKDIpDQo+ID4gKyNkZWZpbmUgQ1Jf SU5UX01FU1NBR0VfV1JJVEVfRVJST1IgICAgIEJJVCgzKQ0KPiA+ICsjZGVmaW5lIENSX0lOVF9T VEFUVVMgICAgICAgICAgICAgICAgICBCSVQoOCkNCj4gPiArDQo+ID4gKyNkZWZpbmUgQ1JfUkVT VUxUX1FVRVVFICAgICAgICAgICAgICAgIDB4MWMNCj4gPiArI2RlZmluZSBDUl9SU0QwICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAweDQwDQo+ID4gKyNkZWZpbmUgQ1JfQ09SRV9SRVYg ICAgICAgICAgICAgICAgICAgIDB4NTANCj4gPiArI2RlZmluZSBDUl9DT1JFX0RFUzEgICAgICAg ICAgIDB4NjANCj4gPiArI2RlZmluZSBDUl9DT1JFX0RFUzIgICAgICAgICAgIDB4NzANCj4gPiAr DQo+ID4gKyNkZWZpbmUgRFJJVkVSX0ZMQUdTX0JVU1kgICAgICAgICAgICAgIEJJVCgwKQ0KPiA+ ICsjZGVmaW5lIERSSVZFUl9GTEFHU19GSU5BTCAgICAgICAgICAgICBCSVQoMSkNCj4gPiArI2Rl ZmluZSBEUklWRVJfRkxBR1NfRE1BX0FDVElWRSAgICAgICAgICAgICAgICBCSVQoMikNCj4gPiAr I2RlZmluZSBEUklWRVJfRkxBR1NfT1VUUFVUX1JFQURZICAgICAgQklUKDMpDQo+ID4gKyNkZWZp bmUgRFJJVkVSX0ZMQUdTX0lOSVQgICAgICAgICAgICAgIEJJVCg0KQ0KPiA+ICsjZGVmaW5lIERS SVZFUl9GTEFHU19DUFUgICAgICAgICAgICAgICBCSVQoNSkNCj4gPiArI2RlZmluZSBEUklWRVJf RkxBR1NfRE1BX1JFQURZICAgICAgICAgQklUKDYpDQo+ID4gKyNkZWZp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RVNUX1NJWkVdIF9fYWxpZ25lZChzaXplb2YodTMyKSk7DQo+ID4gKyAgICAgICB1bnNp Z25lZCBsb25nICAgICAgICAgICBmbGFnczsNCj4gPiArICAgICAgIHNpemVfdCAgICAgICAgICAg ICAgICAgIGRpZ3NpemU7DQo+ID4gKw0KPiA+ICsgICAgICAgZG1hX2FkZHJfdCAgICAgICAgICAg ICAgZG1hX2FkZHI7DQo+ID4gKyAgICAgICBzaXplX3QgICAgICAgICAgICAgICAgICBkbWFfY3Q7 DQo+ID4gKw0KPiA+ICsgICAgICAgLyogc2cgcm9vdCAqLw0KPiA+ICsgICAgICAgc3RydWN0IHNj YXR0ZXJsaXN0ICAgICAgKnNnZmlyc3Q7DQo+ID4gKyAgICAgICAvKiB3YWxrIHN0YXRlICovDQo+ ID4gKyAgICAgICBzdHJ1Y3Qgc2NhdHRlcmxpc3QgICAgICAqc2c7DQo+ID4gKyAgICAgICBzaXpl X3QgICAgICAgICAgICAgICAgICBuZW50czsNCj4gPiArICAgICAgIHNpemVfdCAgICAgICAgICAg ICAgICAgIG9mZnNldDsNCj4gPiArICAgICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgIHRvdGFs Ow0KPiA+ICsgICAgICAgc2l6ZV90ICAgICAgICAgICAgICAgICAgc2VudDsNCj4gPiArDQo+ID4g KyAgICAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICBvcDsNCj4gPiArDQo+ID4gKyAgICAgICBz aXplX3QgICAgICAgICAgICAgICAgICBidWZjbnQ7DQo+ID4gKyAgICAgICB1OCBidWZmZXJbMF0g X19hbGlnbmVkKHNpemVvZih1MzIpKTsNCj4gPiArICAgICAgIHN0cnVjdCBhaGFzaF9yZXF1ZXN0 ICAgIGZhbGxiYWNrX3JlcTsNCj4gPiArfTsNCj4gPiArDQo+ID4gK3N0cnVjdCBpbWdfaGFzaF9j dHggew0KPiA+ICsgICAgICAgc3RydWN0IGltZ19oYXNoX2RldiAgICAgKmhkZXY7DQo+ID4gKyAg ICAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICBmbGFnczsNCj4gPiArICAgICAgIHN0cnVjdCBj cnlwdG9fYWhhc2ggICAgICpmYWxsYmFjazsNCj4gPiArfTsNCj4gPiArDQo+ID4gK3N0cnVjdCBp bWdfaGFzaF9kZXYgew0KPiA+ICsgICAgICAgc3RydWN0IGxpc3RfaGVhZCAgICAgICAgbGlzdDsN Cj4gPiArICAgICAgIHN0cnVjdCBkZXZpY2UgICAgICAgICAgICpkZXY7DQo+ID4gKyAgICAgICBz dHJ1Y3QgY2xrICAgICAgICAgICAgICAqaWNsazsNCj4gPiArICAgICAgIHN0cnVjdCBjbGsgICAg ICAgICAgICAgICpmY2xrOw0KPiANCj4gTWF5YmUgbWFrZSB0aGVzZSBuYW1lcyBhIGxpdHRsZSBt b3JlIG9idmlvdXMgc28gaXQncyBjbGVhciB3aGljaCBjbG9jayBpcw0KPiB3aGljaC4NCg0KQWdy ZWVkIC0gZG9uZQ0KDQo+IA0KPiA+ICsgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgaXJx Ow0KPiANCj4gVGhpcyBpc24ndCB1c2VkIG91dHNpZGUgb2YgcHJvYmUoKSwgc28gaXQgbmVlZCBu b3QgYmUgY2FycmllZCBhcm91bmQgaW4gdGhpcw0KPiBzdHJ1Y3QuDQoNCkRvbmUNCg0KPiANCj4g PiArICAgICAgIHZvaWQgX19pb21lbSAgICAgICAgICAgICppb19iYXNlOw0KPiA+ICsNCj4gPiAr ICAgICAgIHBoeXNfYWRkcl90ICAgICAgICAgICAgIGJ1c19hZGRyOw0KPiA+ICsgICAgICAgdm9p ZCBfX2lvbWVtICAgICAgICAgICAgKmNwdV9hZGRyOw0KPiA+ICsNCj4gPiArICAgICAgIHNwaW5s b2NrX3QgICAgICAgICAgICAgIGxvY2s7DQo+ID4gKyAgICAgICBpbnQgICAgICAgICAgICAgICAg ICAgICBlcnI7DQo+ID4gKyAgICAgICBzdHJ1Y3QgdGFza2xldF9zdHJ1Y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iArICAgICAgICAgICAgICAgICAgICAgICBpbWdfaGFzaF94bWl0 X2NwdShoZGV2LCBhZGRyICsgY3R4LT5vZmZzZXQsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgd3NlbmQgKiA0LCAwKTsNCj4gPiArICAgICAgICAgICAgICAg ICAgICAgICBjdHgtPnNlbnQgKz0gd3NlbmQgKiA0Ow0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgIHdzZW5kID0gMDsNCj4gPiArICAgICAgICAgICAgICAgfSBlbHNlIHsNCj4gPiArICAgICAg ICAgICAgICAgICAgICAgICBjdHgtPnNlbnQgKz0gd3NlbmQgKiA0Ow0KPiA+ICsgICAgICAgICAg ICAgICB9DQo+ID4gKyAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAgICAgaWYgKGJsZWZ0KSB7DQo+ ID4gKyAgICAgICAgICAgICAgIGN0eC0+YnVmY250ID0gc2dfcGNvcHlfdG9fYnVmZmVyKGN0eC0+ c2dmaXJzdCwgY3R4LT5uZW50cywNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgY3R4LT5idWZmZXIsIGJsZWZ0LCBjdHgtPnNlbnQpOw0KPiA+ICsg ICAgICAgICAgICAgICB0YmMgPSAwOw0KPiA+ICsgICAgICAgICAgICAgICBjdHgtPnNnID0gc2df bmV4dChjdHgtPnNnKTsNCj4gPiArICAgICAgICAgICAgICAgd2hpbGUgKGN0eC0+c2cgJiYgKGN0 eC0+YnVmY250IDwgNCkpIHsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICBsZW4gPSBjdHgt PnNnLT5sZW5ndGg7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpa2VseShsZW4g PiAoNCAtIGN0eC0+YnVmY250KSkpDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBsZW4gPSA0IC0gY3R4LT5idWZjbnQ7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgdGJj ID0gc2dfcGNvcHlfdG9fYnVmZmVyKGN0eC0+c2dmaXJzdCwgY3R4LT5uZW50cywNCj4gPiArICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3R4LT5idWZmZXIg KyBjdHgtPmJ1ZmNudCwgbGVuLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBjdHgtPnNlbnQgKyBjdHgtPmJ1ZmNudCk7DQo+ID4gKyAgICAgICAgICAgICAgICAg ICAgICAgY3R4LT5idWZjbnQgKz0gdGJjOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGlm ICh0YmMgPj0gY3R4LT5zZy0+bGVuZ3RoKSB7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBjdHgtPnNnID0gc2dfbmV4dChjdHgtPnNnKTsNCj4gPiArICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHRiYyA9IDA7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgfQ0K PiA+ICsgICAgICAgICAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAgICAgICAgICAgICBjdHgtPnNl bnQgKz0gY3R4LT5idWZjbnQ7DQo+ID4gKyAgICAgICAgICAgICAgIGN0eC0+b2Zmc2V0ID0gdGJj Ow0KPiA+ICsNCj4gPiArICAgICAgICAgICAgICAgaWYgKCF3c2VuZCkNCj4gPiArICAgICAgICAg ICAgICAgICAgICAgICBpbWdfaGFzaF9kbWFfY2FsbGJhY2soaGRldik7DQo+ID4gKyAgICAgICB9 IGVsc2Ugew0KPiA+ICsgICAgICAgICAgICAgICBjdHgtPm9mZnNldCA9IDA7DQo+ID4gKyAgICAg ICAgICAgICAgIGN0eC0+c2cgPSBzZ19uZXh0KGN0eC0+c2cpOw0KPiA+ICsgICAgICAgfQ0KPiA+ ICt9DQo+ID4gKw0KPiA+ICtzdGF0aWMgaW50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ltZ19hbGdzW10g PSB7DQo+ID4gKyAgICAgICB7DQo+ID4gKyAgICAgICAgICAgICAgIC5pbml0ID0gaW1nX2hhc2hf aW5pdCwNCj4gPiArICAgICAgICAgICAgICAgLnVwZGF0ZSA9IGltZ19oYXNoX3VwZGF0ZSwNCj4g PiArICAgICAgICAgICAgICAgLmZpbmFsID0gaW1nX2hhc2hfZmluYWwsDQo+ID4gKyAgICAgICAg ICAgICAgIC5maW51cCA9IGltZ19oYXNoX2ZpbnVwLA0KPiA+ICsgICAgICAgICAgICAgICAuZGln ZXN0ID0gaW1nX2hhc2hfZGlnZXN0LA0KPiA+ICsgICAgICAgICAgICAgICAuaGFsZyA9IHsNCj4g PiArICAgICAgICAgICAgICAgICAgICAgICAuZGlnZXN0c2l6ZSA9IE1ENV9ESUdFU1RfU0laRSwN Cj4gPiArICAgICAgICAgICAgICAgICAgICAgICAuYmFzZSA9IHsNCj4gPiArICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIC5jcmFfbmFtZSA9ICJtZDUiLA0KPiA+ICsgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgLmNyYV9kcml2ZXJfbmFtZSA9ICJpbWctbWQ1IiwNCj4gPiArICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jcmFfcHJpb3JpdHkgPSAzMDEsDQo+ID4gKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY3JhX2ZsYWdzID0NCj4gPiArICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIENSWVBUT19BTEdfQVNZTkMgfA0KPiA+ICsgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgQ1JZUFRPX0FMR19ORUVEX0ZBTExCQUNLLA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNyYV9ibG9ja3NpemUgPSBNRDVfSE1BQ19CTE9D S19TSVpFLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNyYV9jdHhzaXpl ID0gc2l6ZW9mKHN0cnVjdCBpbWdfaGFzaF9jdHgpLA0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmNyYV9pbml0ID0gaW1nX2hhc2hfY3JhX2luaXQsDQo+ID4gKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAuY3JhX2V4aXQgPSBpbWdfaGFzaF9jcmFfZXhpdCwNCj4g PiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jcmFfbW9kdWxlID0gVEhJU19NT0RV TEUsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgfQ0KPiA+ICsgICAgICAgICAgICAgICB9 DQo+ID4gKyAgICAgICB9LA0KPiA+ICsgICAgICAgew0KPiA+ICsgICAgICAgICAgICAgICAuaW5p dCA9IGltZ19oYXNoX2luaXQsDQo+ID4gKyAgICAgICAgICAgICAgIC51cGRhdGUgPSBpbWdfaGFz aF91cGRhdGUsDQo+ID4gKyAgICAgICAgICAgICAgIC5maW5hbCA9IGltZ19oYXNoX2ZpbmFsLA0K PiA+ICsgICAgICAgICAgICAgICAuZmludXAgPSBpbWdfaGFzaF9maW51cCwNCj4gPiArICAgICAg ICAgICAgICAgLmRpZ2VzdCA9IGltZ19oYXNoX2RpZ2VzdCwNCj4gPiArICAgICAgICAgICAgICAg LmhhbGcgPSB7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgLmRpZ2VzdHNpemUgPSBTSEEx X0RJR0VTVF9TSVpFLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIC5iYXNlID0gew0KPiA+ ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNyYV9uYW1lID0gInNoYTEiLA0KPiA+ ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNyYV9kcml2ZXJfbmFtZSA9ICJpbWct c2hhMSIsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY3JhX3ByaW9yaXR5 ID0gMzAwMCwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jcmFfZmxhZ3Mg PQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1JZUFRPX0FMR19BU1lOQyB8 DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDUllQVE9fQUxHX05FRURfRkFM TEJBQ0ssDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY3JhX2Jsb2Nrc2l6 ZSA9IFNIQTFfQkxPQ0tfU0laRSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IC5jcmFfY3R4c2l6ZSA9IHNpemVvZihzdHJ1Y3QgaW1nX2hhc2hfY3R4KSwNCj4gPiArICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIC5jcmFfaW5pdCA9IGltZ19oYXNoX2NyYV9pbml0LA0K PiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNyYV9leGl0ID0gaW1nX2hhc2hf Y3JhX2V4aXQsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY3JhX21vZHVs ZSA9IFRISVNfTU9EVUxFLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIH0NCj4gPiArICAg ICAgICAgICAgICAgfQ0KPiA+ICsgICAgICAgfSwNCj4gPiArICAgICAgIHsNCj4gPiArICAgICAg ICAgICAgICAgLmluaXQgPSBpbWdfaGFzaF9pbml0LA0KPiA+ICsgICAgICAgICAgICAgICAudXBk YXRlID0gaW1nX2hhc2hfdXBkYXRlLA0KPiA+ICsgICAgICAgICAgICAgICAuZmluYWwgPSBpbWdf aGFzaF9maW5hbCwNCj4gPiArICAgICAgICAgICAgICAgLmZpbnVwID0gaW1nX2hhc2hfZmludXAs DQo+ID4gKyAgICAgICAgICAgICAgIC5kaWdlc3QgPSBpbWdfaGFzaF9kaWdlc3QsDQo+ID4gKyAg ICAgICAgICAgICAgIC5oYWxnID0gew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIC5kaWdl c3RzaXplID0gU0hBMjI0X0RJR0VTVF9TSVpFLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAg IC5iYXNlID0gew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNyYV9uYW1l ID0gInNoYTIyNCIsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY3JhX2Ry aXZlcl9uYW1lID0gImltZy1zaGEyMjQiLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmNyYV9wcmlvcml0eSA9IDMwMDAsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAuY3JhX2ZsYWdzID0NCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IENSWVBUT19BTEdfQVNZTkMgfA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Q1JZUFRPX0FMR19ORUVEX0ZBTExCQUNLLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLmNyYV9ibG9ja3NpemUgPSBTSEEyMjRfQkxPQ0tfU0laRSwNCj4gPiArICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIC5jcmFfY3R4c2l6ZSA9IHNpemVvZihzdHJ1Y3QgaW1nX2hh c2hfY3R4KSwNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jcmFfaW5pdCA9 IGltZ19oYXNoX2NyYV9pbml0LA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg LmNyYV9leGl0ID0gaW1nX2hhc2hfY3JhX2V4aXQsDQo+ID4gKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAuY3JhX21vZHVsZSA9IFRISVNfTU9EVUxFLA0KPiA+ICsgICAgICAgICAgICAg ICAgICAgICAgIH0NCj4gPiArICAgICAgICAgICAgICAgfQ0KPiA+ICsgICAgICAgfSwNCj4gPiAr ICAgICAgIHsNCj4gPiArICAgICAgICAgICAgICAgLmluaXQgPSBpbWdfaGFzaF9pbml0LA0KPiA+ ICsgICAgICAgICAgICAgICAudXBkYXRlID0gaW1nX2hhc2hfdXBkYXRlLA0KPiA+ICsgICAgICAg ICAgICAgICAuZmluYWwgPSBpbWdfaGFzaF9maW5hbCwNCj4gPiArICAgICAgICAgICAgICAgLmZp bnVwID0gaW1nX2hhc2hfZmludXAsDQo+ID4gKyAgICAgICAgICAgICAgIC5kaWdlc3QgPSBpbWdf aGFzaF9kaWdlc3QsDQo+ID4gKyAgICAgICAgICAgICAgIC5oYWxnID0gew0KPiA+ICsgICAgICAg ICAgICAgICAgICAgICAgIC5kaWdlc3RzaXplID0gU0hBMjU2X0RJR0VTVF9TSVpFLA0KPiA+ICsg ICAgICAgICAgICAgICAgICAgICAgIC5iYXNlID0gew0KPiA+ICsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgLmNyYV9uYW1lID0gInNoYTI1NiIsDQo+ID4gKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAuY3JhX2RyaXZlcl9uYW1lID0gImltZy1zaGEyNTYiLA0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNyYV9wcmlvcml0eSA9IDMwMSwNCj4gPiArICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jcmFfZmxhZ3MgPQ0KPiA+ICsgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgQ1JZUFRPX0FMR19BU1lOQyB8DQo+ID4gKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBDUllQVE9fQUxHX05FRURfRkFMTEJBQ0ssDQo+ID4gKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAuY3JhX2Jsb2Nrc2l6ZSA9IFNIQTI1Nl9CTE9DS19T SVpFLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNyYV9jdHhzaXplID0g c2l6ZW9mKH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Jj0gfkRSSVZFUl9GTEFHU19PVVRQVVRfUkVBRFk7DQo+ID4gKyAgICAgICAg ICAgICAgICAgICAgICAgZ290byBmaW5pc2g7DQo+ID4gKyAgICAgICAgICAgICAgIH0NCj4gPiAr ICAgICAgIH0gZWxzZSBpZiAoRFJJVkVSX0ZMQUdTX0RNQV9SRUFEWSAmIGhkZXYtPmZsYWdzKSB7 DQo+ID4gKyAgICAgICAgICAgICAgIGlmIChEUklWRVJfRkxBR1NfRE1BX0FDVElWRSAmIGhkZXYt PmZsYWdzKSB7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgaGRldi0+ZmxhZ3MgJj0gfkRS SVZFUl9GTEFHU19ETUFfQUNUSVZFOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGltZ19o YXNoX3dyaXRlX3ZpYV9kbWFfc3RvcChoZGV2KTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAg ICBpZiAoaGRldi0+ZXJyKSB7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBl cnIgPSBoZGV2LT5lcnI7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnb3Rv IGZpbmlzaDsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICB9DQo+ID4gKyAgICAgICAgICAg ICAgIH0NCj4gPiArICAgICAgICAgICAgICAgaWYgKERSSVZFUl9GTEFHU19PVVRQVVRfUkVBRFkg JiBoZGV2LT5mbGFncykgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgIGhkZXYtPmZsYWdz ICY9IH4oRFJJVkVSX0ZMQUdTX0RNQV9SRUFEWSB8DQo+ID4gKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIERSSVZFUl9GTEFHU19PVVRQVVRfUkVBRFkpOw0KPiA+ICsgICAg ICAgICAgICAgICAgICAgICAgIGdvdG8gZmluaXNoOw0KPiA+ICsgICAgICAgICAgICAgICB9DQo+ ID4gKyAgICAgICB9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3Jl bWFwIHdyaXRlIHBvcnRcbiIpOw0KPiA+ICsgICAgICAgICAgICAgICBlcnIgPSBQVFJfRVJSKGhk ZXYtPmNwdV9hZGRyKTsNCj4gPiArICAgICAgICAgICAgICAgZ290byByZXNfZXJyOw0KPiA+ICsg ICAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAgIGhkZXYtPmlycSA9IHBsYXRmb3JtX2dldF9pcnEo cGRldiwgMCk7DQo+ID4gKyAgICAgICBpZiAoaGRldi0+aXJxIDwgMCkgew0KPiA+ICsgICAgICAg ICAgICAgICBkZXZfZXJyKGRldiwgIm5vIElSUSByZXNvdXJjZSBpbmZvXG4iKTsNCj4gPiArICAg ICAgICAgICAgICAgZXJyID0gaGRldi0+aXJxOw0KPiA+ICsgICAgICAgICAgICAgICBnb3RvIHJl c19lcnI7DQo+ID4gKyAgICAgICB9DQo+ID4gKw0KPiA+ICsgICAgICAgZXJyID0gZGV2bV9yZXF1 ZXN0X2lycShkZXYsIGhkZXYtPmlycSwgaW1nX2lycV9oYW5kbGVyLCAwLA0KPiA+ICsgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBkZXZfbmFtZShkZXYpLCBoZGV2KTsNCj4gPiArICAgICAg IGlmIChlcnIpIHsNCj4gPiArICAgICAgICAgICAgICAgZGV2X2VycihkZXYsICJ1bmFibGUgdG8g cmVxdWVzdCAlcyBpcnFcbiIsDQo+ID4gKyBkZXZfbmFtZShkZXYpKTsNCj4gDQo+IGRldl8qIGFs cmVhZHkgcHJpbnRzIGRldl9uYW1lKCkuDQoNClllcywgcmVtb3ZlZCBpdA0KDQo+IA0KPiA+ICsg ICAgICAgICAgICAgICBnb3RvIHJlc19lcnI7DQo+ID4gKyAgICAgICB9DQo+ID4gKyAgICAgICBk ZXZfZGJnKGRldiwgInVzaW5nIElSUSBjaGFubmVsICVkXG4iLCBoZGV2LT5pcnEpOw0KPiA+ICsN Cj4gPiArICAgICAgIGhkZXYtPmljbGsgPSBkZXZtX2Nsa19nZXQoJnBkZXYtPmRldiwgImhhc2hf Y2xrIik7DQo+ID4gKyAgICAgICBpZiAoSVNfRVJSKGhkZXYtPmljbGspKSB7DQo+ID4gKyAgICAg ICAgICAgICAgIGRldl9lcnIoZGV2LCAiY2xvY2sgaW5pdGlhbGl6YXRpb24gZmFpbGVkLlxuIik7 DQo+ID4gKyAgICAgICAgICAgICAgIGVyciA9IFBUUl9FUlIoaGRldi0+aWNsayk7DQo+ID4gKyAg ICAgICAgICAgICAgIGdvdG8gcmVzX2VycjsNCj4gPiArICAgICAgIH0NCj4gPiArDQo+ID4gKyAg ICAgICBoZGV2LT5mY2xrID0gZGV2bV9jbGtfZ2V0KCZwZGV2LT5kZXYsICJoYXNoX3JlZ19jbGsi KTsNCj4gDQo+IEkgZG9uJ3Qgc2VlIHRoaXMgY2xvY2sgZ2V0dGluZyBlbmFibGVkIGFueXdoZXJl Lg0KDQpHb29kIGNhdGNoIC0gbm93IGFkZGVkIHRvIGltZ19oYXNoX2h3X2luaXQuICANCg0KPiAN Cj4gPiArICAgICAgIGlmIChJU19FUlIoaGRldi0+ZmNsaykpIHsNCj4gPiArICAgICAgICAgICAg ICAgZGV2X2VycihkZXYsICJjbG9jayBpbml0aWFsaXphdGlvbiBmYWlsZWQuXG4iKTsNCj4gPiAr ICAgICAgICAgICAgICAgZXJyID0gUFRSX0VSUihoZGV2LT5mY2xrKTsNCj4gPiArICAgICAgICAg ICAgICAgZ290byByZXNfZXJyOw0KPiA+ICsgICAgICAgfQ0KPiA+ICsNCj4gPiArICAgICAgIGVy ciA9IGltZ19oYXNoX2RtYV9pbml0KGhkZXYpOw0KPiA+ICsgICAgICAgaWYgKGVycikNCj4gPiAr ICAgICAgICAgICAgICAgZ290byBlcnJfZG1hOw0KPiA+ICsNCj4gPiArICAgICAgIGRldl9kYmco ZGV2LCAidXNpbmcgJXMgZm9yIERNQSB0cmFuc2ZlcnNcbiIsDQo+ID4gKyAgICAgICAgICAgICAg IGRtYV9jaGFuX25hbWUoaGR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