@deltarocks/pykrete-front 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/client.d.ts +15 -0
  2. package/client.js +89 -0
  3. package/client.js.map +1 -0
  4. package/control/gen/ActiveOrganizationSelection.d.ts +8 -0
  5. package/control/gen/ActiveOrganizationSelection.js +16 -0
  6. package/control/gen/ActiveOrganizationSelection.js.map +1 -0
  7. package/control/gen/App.d.ts +9 -0
  8. package/control/gen/App.js +21 -0
  9. package/control/gen/App.js.map +1 -0
  10. package/control/gen/AppKeyData.d.ts +10 -0
  11. package/control/gen/AppKeyData.js +27 -0
  12. package/control/gen/AppKeyData.js.map +1 -0
  13. package/control/gen/AppKeys.d.ts +6 -0
  14. package/control/gen/AppKeys.js +14 -0
  15. package/control/gen/AppKeys.js.map +1 -0
  16. package/control/gen/Challenge.d.ts +12 -0
  17. package/control/gen/Challenge.js +25 -0
  18. package/control/gen/Challenge.js.map +1 -0
  19. package/control/gen/ChallengeRequest.d.ts +44 -0
  20. package/control/gen/ChallengeRequest.js +159 -0
  21. package/control/gen/ChallengeRequest.js.map +1 -0
  22. package/control/gen/ChallengeUpdate.d.ts +10 -0
  23. package/control/gen/ChallengeUpdate.js +26 -0
  24. package/control/gen/ChallengeUpdate.js.map +1 -0
  25. package/control/gen/ControlInit.d.ts +9 -0
  26. package/control/gen/ControlInit.js +20 -0
  27. package/control/gen/ControlInit.js.map +1 -0
  28. package/control/gen/ControlInitKind.d.ts +25 -0
  29. package/control/gen/ControlInitKind.js +108 -0
  30. package/control/gen/ControlInitKind.js.map +1 -0
  31. package/control/gen/CreatePasswordWithSecretCodeResponse.d.ts +9 -0
  32. package/control/gen/CreatePasswordWithSecretCodeResponse.js +20 -0
  33. package/control/gen/CreatePasswordWithSecretCodeResponse.js.map +1 -0
  34. package/control/gen/DisplayPermission.d.ts +12 -0
  35. package/control/gen/DisplayPermission.js +27 -0
  36. package/control/gen/DisplayPermission.js.map +1 -0
  37. package/control/gen/EncryptAppKeys.d.ts +9 -0
  38. package/control/gen/EncryptAppKeys.js +20 -0
  39. package/control/gen/EncryptAppKeys.js.map +1 -0
  40. package/control/gen/FactorResponse.d.ts +15 -0
  41. package/control/gen/FactorResponse.js +50 -0
  42. package/control/gen/FactorResponse.js.map +1 -0
  43. package/control/gen/IdentifyResponse.d.ts +14 -0
  44. package/control/gen/IdentifyResponse.js +50 -0
  45. package/control/gen/IdentifyResponse.js.map +1 -0
  46. package/control/gen/KeybaseEnvelope.d.ts +9 -0
  47. package/control/gen/KeybaseEnvelope.js +20 -0
  48. package/control/gen/KeybaseEnvelope.js.map +1 -0
  49. package/control/gen/KeybaseSource.d.ts +17 -0
  50. package/control/gen/KeybaseSource.js +61 -0
  51. package/control/gen/KeybaseSource.js.map +1 -0
  52. package/control/gen/KeybaseUnlocked.d.ts +9 -0
  53. package/control/gen/KeybaseUnlocked.js +24 -0
  54. package/control/gen/KeybaseUnlocked.js.map +1 -0
  55. package/control/gen/LegacyKeybase.d.ts +10 -0
  56. package/control/gen/LegacyKeybase.js +30 -0
  57. package/control/gen/LegacyKeybase.js.map +1 -0
  58. package/control/gen/LegacyKeybaseMaterial.d.ts +9 -0
  59. package/control/gen/LegacyKeybaseMaterial.js +19 -0
  60. package/control/gen/LegacyKeybaseMaterial.js.map +1 -0
  61. package/control/gen/LogoutConfirmation.d.ts +10 -0
  62. package/control/gen/LogoutConfirmation.js +24 -0
  63. package/control/gen/LogoutConfirmation.js.map +1 -0
  64. package/control/gen/OrganizationAccess.d.ts +15 -0
  65. package/control/gen/OrganizationAccess.js +34 -0
  66. package/control/gen/OrganizationAccess.js.map +1 -0
  67. package/control/gen/OrganizationAccessResponse.d.ts +11 -0
  68. package/control/gen/OrganizationAccessResponse.js +27 -0
  69. package/control/gen/OrganizationAccessResponse.js.map +1 -0
  70. package/control/gen/OrganizationChoice.d.ts +12 -0
  71. package/control/gen/OrganizationChoice.js +30 -0
  72. package/control/gen/OrganizationChoice.js.map +1 -0
  73. package/control/gen/OrganizationChoiceAccess.d.ts +19 -0
  74. package/control/gen/OrganizationChoiceAccess.js +88 -0
  75. package/control/gen/OrganizationChoiceAccess.js.map +1 -0
  76. package/control/gen/PasskeyAssertion.d.ts +13 -0
  77. package/control/gen/PasskeyAssertion.js +33 -0
  78. package/control/gen/PasskeyAssertion.js.map +1 -0
  79. package/control/gen/PasskeyCreationRequest.d.ts +13 -0
  80. package/control/gen/PasskeyCreationRequest.js +36 -0
  81. package/control/gen/PasskeyCreationRequest.js.map +1 -0
  82. package/control/gen/PasskeyInput.d.ts +11 -0
  83. package/control/gen/PasskeyInput.js +25 -0
  84. package/control/gen/PasskeyInput.js.map +1 -0
  85. package/control/gen/PasskeyRegistration.d.ts +14 -0
  86. package/control/gen/PasskeyRegistration.js +33 -0
  87. package/control/gen/PasskeyRegistration.js.map +1 -0
  88. package/control/gen/PasskeyRequest.d.ts +10 -0
  89. package/control/gen/PasskeyRequest.js +28 -0
  90. package/control/gen/PasskeyRequest.js.map +1 -0
  91. package/control/gen/PasswordChallengeRequest.d.ts +12 -0
  92. package/control/gen/PasswordChallengeRequest.js +47 -0
  93. package/control/gen/PasswordChallengeRequest.js.map +1 -0
  94. package/control/gen/PasswordChallengeResponse.d.ts +13 -0
  95. package/control/gen/PasswordChallengeResponse.js +55 -0
  96. package/control/gen/PasswordChallengeResponse.js.map +1 -0
  97. package/control/gen/PasswordInput.d.ts +9 -0
  98. package/control/gen/PasswordInput.js +20 -0
  99. package/control/gen/PasswordInput.js.map +1 -0
  100. package/control/gen/PermissionConfirmation.d.ts +15 -0
  101. package/control/gen/PermissionConfirmation.js +35 -0
  102. package/control/gen/PermissionConfirmation.js.map +1 -0
  103. package/control/gen/PermissionGroup.d.ts +10 -0
  104. package/control/gen/PermissionGroup.js +25 -0
  105. package/control/gen/PermissionGroup.js.map +1 -0
  106. package/control/gen/PermissionIcon.d.ts +13 -0
  107. package/control/gen/PermissionIcon.js +49 -0
  108. package/control/gen/PermissionIcon.js.map +1 -0
  109. package/control/gen/PowChallenge.d.ts +9 -0
  110. package/control/gen/PowChallenge.js +20 -0
  111. package/control/gen/PowChallenge.js.map +1 -0
  112. package/control/gen/Publisher.d.ts +9 -0
  113. package/control/gen/Publisher.js +20 -0
  114. package/control/gen/Publisher.js.map +1 -0
  115. package/control/gen/RegisterPasskeyResponse.d.ts +13 -0
  116. package/control/gen/RegisterPasskeyResponse.js +47 -0
  117. package/control/gen/RegisterPasskeyResponse.js.map +1 -0
  118. package/control/gen/RegisteredPasskey.d.ts +9 -0
  119. package/control/gen/RegisteredPasskey.js +20 -0
  120. package/control/gen/RegisteredPasskey.js.map +1 -0
  121. package/control/gen/Reply.d.ts +54 -0
  122. package/control/gen/Reply.js +204 -0
  123. package/control/gen/Reply.js.map +1 -0
  124. package/control/gen/Request.d.ts +33 -0
  125. package/control/gen/Request.js +127 -0
  126. package/control/gen/Request.js.map +1 -0
  127. package/control/gen/RequestDetail.d.ts +8 -0
  128. package/control/gen/RequestDetail.js +19 -0
  129. package/control/gen/RequestDetail.js.map +1 -0
  130. package/control/gen/SecondFactorInput.d.ts +11 -0
  131. package/control/gen/SecondFactorInput.js +26 -0
  132. package/control/gen/SecondFactorInput.js.map +1 -0
  133. package/control/gen/StoredCredentialsResponse.d.ts +9 -0
  134. package/control/gen/StoredCredentialsResponse.js +21 -0
  135. package/control/gen/StoredCredentialsResponse.js.map +1 -0
  136. package/control/gen/UnlockKeybase.d.ts +10 -0
  137. package/control/gen/UnlockKeybase.js +24 -0
  138. package/control/gen/UnlockKeybase.js.map +1 -0
  139. package/control/gen/UnlockKeybaseResponse.d.ts +13 -0
  140. package/control/gen/UnlockKeybaseResponse.js +47 -0
  141. package/control/gen/UnlockKeybaseResponse.js.map +1 -0
  142. package/control/gen/array/inline_0.d.ts +5 -0
  143. package/control/gen/array/inline_0.js +29 -0
  144. package/control/gen/array/inline_0.js.map +1 -0
  145. package/control/gen/array/inline_1.d.ts +6 -0
  146. package/control/gen/array/inline_1.js +29 -0
  147. package/control/gen/array/inline_1.js.map +1 -0
  148. package/control/gen/array/inline_2.d.ts +6 -0
  149. package/control/gen/array/inline_2.js +29 -0
  150. package/control/gen/array/inline_2.js.map +1 -0
  151. package/control/gen/array/inline_3.d.ts +6 -0
  152. package/control/gen/array/inline_3.js +29 -0
  153. package/control/gen/array/inline_3.js.map +1 -0
  154. package/control/gen/array/inline_4.d.ts +6 -0
  155. package/control/gen/array/inline_4.js +29 -0
  156. package/control/gen/array/inline_4.js.map +1 -0
  157. package/control/gen/array/inline_5.d.ts +6 -0
  158. package/control/gen/array/inline_5.js +29 -0
  159. package/control/gen/array/inline_5.js.map +1 -0
  160. package/control/gen/array/inline_6.d.ts +6 -0
  161. package/control/gen/array/inline_6.js +29 -0
  162. package/control/gen/array/inline_6.js.map +1 -0
  163. package/control/gen/array/inline_7.d.ts +5 -0
  164. package/control/gen/array/inline_7.js +29 -0
  165. package/control/gen/array/inline_7.js.map +1 -0
  166. package/control/gen/array/inline_8.d.ts +5 -0
  167. package/control/gen/array/inline_8.js +32 -0
  168. package/control/gen/array/inline_8.js.map +1 -0
  169. package/control/gen/array/mod.d.ts +9 -0
  170. package/control/gen/array/mod.js +11 -0
  171. package/control/gen/array/mod.js.map +1 -0
  172. package/control/gen/bool.d.ts +5 -0
  173. package/control/gen/bool.js +6 -0
  174. package/control/gen/bool.js.map +1 -0
  175. package/control/gen/buffer/inline_0.d.ts +5 -0
  176. package/control/gen/buffer/inline_0.js +18 -0
  177. package/control/gen/buffer/inline_0.js.map +1 -0
  178. package/control/gen/buffer/mod.d.ts +2 -0
  179. package/control/gen/buffer/mod.js +4 -0
  180. package/control/gen/buffer/mod.js.map +1 -0
  181. package/control/gen/buffer/sized.d.ts +9 -0
  182. package/control/gen/buffer/sized.js +21 -0
  183. package/control/gen/buffer/sized.js.map +1 -0
  184. package/control/gen/i32.d.ts +5 -0
  185. package/control/gen/i32.js +6 -0
  186. package/control/gen/i32.js.map +1 -0
  187. package/control/gen/i64.d.ts +5 -0
  188. package/control/gen/i64.js +6 -0
  189. package/control/gen/i64.js.map +1 -0
  190. package/control/gen/map_0.d.ts +6 -0
  191. package/control/gen/map_0.js +35 -0
  192. package/control/gen/map_0.js.map +1 -0
  193. package/control/gen/mod.d.ts +64 -0
  194. package/control/gen/mod.js +66 -0
  195. package/control/gen/mod.js.map +1 -0
  196. package/control/gen/option_0.d.ts +6 -0
  197. package/control/gen/option_0.js +21 -0
  198. package/control/gen/option_0.js.map +1 -0
  199. package/control/gen/option_1.d.ts +5 -0
  200. package/control/gen/option_1.js +21 -0
  201. package/control/gen/option_1.js.map +1 -0
  202. package/control/gen/option_2.d.ts +6 -0
  203. package/control/gen/option_2.js +21 -0
  204. package/control/gen/option_2.js.map +1 -0
  205. package/control/gen/option_3.d.ts +6 -0
  206. package/control/gen/option_3.js +21 -0
  207. package/control/gen/option_3.js.map +1 -0
  208. package/control/gen/option_4.d.ts +6 -0
  209. package/control/gen/option_4.js +21 -0
  210. package/control/gen/option_4.js.map +1 -0
  211. package/control/gen/option_5.d.ts +5 -0
  212. package/control/gen/option_5.js +21 -0
  213. package/control/gen/option_5.js.map +1 -0
  214. package/control/gen/option_6.d.ts +6 -0
  215. package/control/gen/option_6.js +21 -0
  216. package/control/gen/option_6.js.map +1 -0
  217. package/control/gen/pstring_6.d.ts +5 -0
  218. package/control/gen/pstring_6.js +20 -0
  219. package/control/gen/pstring_6.js.map +1 -0
  220. package/control/gen/u32.d.ts +5 -0
  221. package/control/gen/u32.js +6 -0
  222. package/control/gen/u32.js.map +1 -0
  223. package/control/gen/u8.d.ts +5 -0
  224. package/control/gen/u8.js +6 -0
  225. package/control/gen/u8.js.map +1 -0
  226. package/control/gen/varint.d.ts +5 -0
  227. package/control/gen/varint.js +6 -0
  228. package/control/gen/varint.js.map +1 -0
  229. package/control/gen/void.d.ts +5 -0
  230. package/control/gen/void.js +6 -0
  231. package/control/gen/void.js.map +1 -0
  232. package/control/mod.d.ts +40 -0
  233. package/control/mod.js +29 -0
  234. package/control/mod.js.map +1 -0
  235. package/control/pds.d.ts +1 -0
  236. package/control/pds.js +2 -0
  237. package/control/pds.js.map +1 -0
  238. package/control/pds_native.d.ts +2 -0
  239. package/control/pds_native.js +3 -0
  240. package/control/pds_native.js.map +1 -0
  241. package/control/schema_hash.d.ts +1 -0
  242. package/control/schema_hash.js +2 -0
  243. package/control/schema_hash.js.map +1 -0
  244. package/lib/pykrete_front.d.ts +60 -0
  245. package/lib/pykrete_front.internal.js +489 -0
  246. package/lib/pykrete_front.js +12 -0
  247. package/lib/pykrete_front.wasm +0 -0
  248. package/package.json +275 -3
  249. package/webauthn.d.ts +16 -0
  250. package/webauthn.js +135 -0
  251. package/webauthn.js.map +1 -0
  252. package/worker.d.ts +30 -0
  253. package/worker.js +92 -0
  254. package/worker.js.map +1 -0
  255. package/README.md +0 -3
@@ -0,0 +1,2 @@
1
+ export { pds_bool, pds_i32, pds_i64, pds_u32, pds_u8, pds_void, } from '@deltarocks/pds-bytes-runtime';
2
+ export { pds_int32 as pds_varint } from '@deltarocks/pds-bytes-runtime/protobuf';
@@ -0,0 +1,3 @@
1
+ export { pds_bool, pds_i32, pds_i64, pds_u32, pds_u8, pds_void } from '@deltarocks/pds-bytes-runtime';
2
+ export { pds_int32 as pds_varint } from '@deltarocks/pds-bytes-runtime/protobuf';
3
+ //# sourceMappingURL=pds_native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["pds_native.ts"],"sourcesContent":["export {\n\tpds_bool,\n\tpds_i32,\n\tpds_i64,\n\tpds_u32,\n\tpds_u8,\n\tpds_void,\n} from '@deltarocks/pds-bytes-runtime';\nexport { pds_int32 as pds_varint } from '@deltarocks/pds-bytes-runtime/protobuf';\n"],"mappings":"AAAA,SACC,QAAQ,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,QACF,+BAA+B;AACtC,SAAS,SAAS,IAAI,UAAU,QAAQ,wCAAwC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const SCHEMA_HASH: Uint8Array<ArrayBuffer>;
@@ -0,0 +1,2 @@
1
+ export const SCHEMA_HASH = new Uint8Array([0xfe, 0xf9, 0xd9, 0xa0, 0x36, 0xf8, 0x40, 0xbc, 0xa2, 0xd0, 0x8b, 0xaf, 0xa7, 0x2e, 0x44, 0x70, 0x62, 0xa9, 0x49, 0x36, 0xd3, 0x62, 0xd4, 0xac, 0x56, 0x07, 0xea, 0xd4, 0x5d, 0xeb, 0x09, 0x54]);
2
+ //# sourceMappingURL=schema_hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["schema_hash.ts"],"sourcesContent":["export const SCHEMA_HASH = new Uint8Array([0xfe, 0xf9, 0xd9, 0xa0, 0x36, 0xf8, 0x40, 0xbc, 0xa2, 0xd0, 0x8b, 0xaf, 0xa7, 0x2e, 0x44, 0x70, 0x62, 0xa9, 0x49, 0x36, 0xd3, 0x62, 0xd4, 0xac, 0x56, 0x07, 0xea, 0xd4, 0x5d, 0xeb, 0x09, 0x54]);\n"],"mappings":"AAAA,OAAO,MAAM,WAAW,GAAG,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ // @generated file from wasmbuild -- do not edit
2
+ // deno-lint-ignore-file
3
+ // deno-fmt-ignore-file
4
+
5
+ /**
6
+ * Finalized keybase state held between `FinalizeKeybase` and `EncryptAppKeys`.
7
+ * Mirrors `KeybaseData` in `frontend/web/src/lib.rs`.
8
+ */
9
+ export class Keybase {
10
+ private constructor();
11
+ free(): void;
12
+ [Symbol.dispose](): void;
13
+ /**
14
+ * Recover `kb` from the server-stored wrapped value, derive scoped app keys
15
+ * via HKDF, and JWE-encrypt the resulting JWK set to the relying party.
16
+ * `app_keys` is the `EncryptAppKeys.app_keys` map; `keys_jwk_b64` is the
17
+ * base64url-encoded recipient JWK from the OAuth `keys_jwk` parameter.
18
+ */
19
+ encrypt_app_keys(
20
+ app_keys: Uint8Array | number[],
21
+ keys_jwk_b64: string,
22
+ ): string;
23
+ static fresh(uid: string): Keybase;
24
+ static from_envelope(
25
+ uid: string,
26
+ material: Uint8Array | number[],
27
+ envelope: Uint8Array | number[],
28
+ ): Keybase | undefined;
29
+ static from_legacy(
30
+ uid: string,
31
+ sorts: Uint32Array | number[],
32
+ materials: Uint8Array | number[],
33
+ wrapped: Uint8Array | number[],
34
+ material_hash: Uint8Array | number[],
35
+ ): Keybase | undefined;
36
+ wrap(material: Uint8Array | number[]): Uint8Array;
37
+ readonly fingerprint: Uint8Array;
38
+ }
39
+
40
+ export class ProtectPwOut {
41
+ private constructor();
42
+ free(): void;
43
+ [Symbol.dispose](): void;
44
+ get kbm(): Uint8Array;
45
+ set kbm(value: Uint8Array | number[]);
46
+ get ppw(): Uint8Array;
47
+ set ppw(value: Uint8Array | number[]);
48
+ }
49
+
50
+ export function pow_captcha(
51
+ challenge: Uint8Array | number[],
52
+ cost: number,
53
+ ): Uint8Array;
54
+
55
+ export function protect_pw_v0(pw: Uint8Array | number[]): ProtectPwOut;
56
+
57
+ export function protect_pw_v1(
58
+ pw: Uint8Array | number[],
59
+ user_salt: Uint8Array | number[],
60
+ ): ProtectPwOut;
@@ -0,0 +1,489 @@
1
+ // @generated file from wasmbuild -- do not edit
2
+ // @ts-nocheck: generated
3
+ // deno-lint-ignore-file
4
+ // deno-fmt-ignore-file
5
+
6
+ /**
7
+ * Finalized keybase state held between `FinalizeKeybase` and `EncryptAppKeys`.
8
+ * Mirrors `KeybaseData` in `frontend/web/src/lib.rs`.
9
+ */
10
+ export class Keybase {
11
+ static __wrap(ptr) {
12
+ const obj = Object.create(Keybase.prototype);
13
+ obj.__wbg_ptr = ptr;
14
+ KeybaseFinalization.register(obj, obj.__wbg_ptr, obj);
15
+ return obj;
16
+ }
17
+ __destroy_into_raw() {
18
+ const ptr = this.__wbg_ptr;
19
+ this.__wbg_ptr = 0;
20
+ KeybaseFinalization.unregister(this);
21
+ return ptr;
22
+ }
23
+ free() {
24
+ const ptr = this.__destroy_into_raw();
25
+ wasm.__wbg_keybase_free(ptr, 0);
26
+ }
27
+ /**
28
+ * Recover `kb` from the server-stored wrapped value, derive scoped app keys
29
+ * via HKDF, and JWE-encrypt the resulting JWK set to the relying party.
30
+ * `app_keys` is the `EncryptAppKeys.app_keys` map; `keys_jwk_b64` is the
31
+ * base64url-encoded recipient JWK from the OAuth `keys_jwk` parameter.
32
+ * @param {Uint8Array | number[]} app_keys
33
+ * @param {string} keys_jwk_b64
34
+ * @returns {string}
35
+ */
36
+ encrypt_app_keys(app_keys, keys_jwk_b64) {
37
+ let deferred3_0;
38
+ let deferred3_1;
39
+ try {
40
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
41
+ let ptr0, len0, ptr1, len1;
42
+ try {
43
+ ptr0 = passArray8ToWasm0(app_keys, wasm.__wbindgen_export4);
44
+ len0 = WASM_VECTOR_LEN;
45
+ ptr1 = passStringToWasm0(
46
+ keys_jwk_b64,
47
+ wasm.__wbindgen_export4,
48
+ wasm.__wbindgen_export5,
49
+ );
50
+ len1 = WASM_VECTOR_LEN;
51
+ } catch (e) {
52
+ if (ptr1) wasm.__wbindgen_export3(ptr1, len1 * 1, 1);
53
+ if (ptr0) wasm.__wbindgen_export3(ptr0, len0 * 1, 1);
54
+ throw e;
55
+ }
56
+ wasm.keybase_encrypt_app_keys(
57
+ retptr,
58
+ this.__wbg_ptr,
59
+ ptr0,
60
+ len0,
61
+ ptr1,
62
+ len1,
63
+ );
64
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
65
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
66
+ deferred3_0 = r0;
67
+ deferred3_1 = r1;
68
+ return getStringFromWasm0(r0, r1);
69
+ } finally {
70
+ wasm.__wbindgen_add_to_stack_pointer(16);
71
+ wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
72
+ }
73
+ }
74
+ /**
75
+ * @returns {Uint8Array}
76
+ */
77
+ get fingerprint() {
78
+ try {
79
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
80
+ wasm.keybase_fingerprint(retptr, this.__wbg_ptr);
81
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
82
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
83
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
84
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
85
+ return v1;
86
+ } finally {
87
+ wasm.__wbindgen_add_to_stack_pointer(16);
88
+ }
89
+ }
90
+ /**
91
+ * @param {string} uid
92
+ * @returns {Keybase}
93
+ */
94
+ static fresh(uid) {
95
+ const ptr0 = passStringToWasm0(
96
+ uid,
97
+ wasm.__wbindgen_export4,
98
+ wasm.__wbindgen_export5,
99
+ );
100
+ const len0 = WASM_VECTOR_LEN;
101
+ const ret = wasm.keybase_fresh(ptr0, len0);
102
+ return Keybase.__wrap(ret);
103
+ }
104
+ /**
105
+ * @param {string} uid
106
+ * @param {Uint8Array | number[]} material
107
+ * @param {Uint8Array | number[]} envelope
108
+ * @returns {Keybase | undefined}
109
+ */
110
+ static from_envelope(uid, material, envelope) {
111
+ let ptr0, len0, ptr1, len1, ptr2, len2;
112
+ try {
113
+ ptr0 = passStringToWasm0(
114
+ uid,
115
+ wasm.__wbindgen_export4,
116
+ wasm.__wbindgen_export5,
117
+ );
118
+ len0 = WASM_VECTOR_LEN;
119
+ ptr1 = passArray8ToWasm0(material, wasm.__wbindgen_export4);
120
+ len1 = WASM_VECTOR_LEN;
121
+ ptr2 = passArray8ToWasm0(envelope, wasm.__wbindgen_export4);
122
+ len2 = WASM_VECTOR_LEN;
123
+ } catch (e) {
124
+ if (ptr2) wasm.__wbindgen_export3(ptr2, len2 * 1, 1);
125
+ if (ptr1) wasm.__wbindgen_export3(ptr1, len1 * 1, 1);
126
+ if (ptr0) wasm.__wbindgen_export3(ptr0, len0 * 1, 1);
127
+ throw e;
128
+ }
129
+ const ret = wasm.keybase_from_envelope(ptr0, len0, ptr1, len1, ptr2, len2);
130
+ return ret === 0 ? undefined : Keybase.__wrap(ret);
131
+ }
132
+ /**
133
+ * @param {string} uid
134
+ * @param {Uint32Array | number[]} sorts
135
+ * @param {Uint8Array | number[]} materials
136
+ * @param {Uint8Array | number[]} wrapped
137
+ * @param {Uint8Array | number[]} material_hash
138
+ * @returns {Keybase | undefined}
139
+ */
140
+ static from_legacy(uid, sorts, materials, wrapped, material_hash) {
141
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4;
142
+ try {
143
+ ptr0 = passStringToWasm0(
144
+ uid,
145
+ wasm.__wbindgen_export4,
146
+ wasm.__wbindgen_export5,
147
+ );
148
+ len0 = WASM_VECTOR_LEN;
149
+ ptr1 = passArray32ToWasm0(sorts, wasm.__wbindgen_export4);
150
+ len1 = WASM_VECTOR_LEN;
151
+ ptr2 = passArray8ToWasm0(materials, wasm.__wbindgen_export4);
152
+ len2 = WASM_VECTOR_LEN;
153
+ ptr3 = passArray8ToWasm0(wrapped, wasm.__wbindgen_export4);
154
+ len3 = WASM_VECTOR_LEN;
155
+ ptr4 = passArray8ToWasm0(material_hash, wasm.__wbindgen_export4);
156
+ len4 = WASM_VECTOR_LEN;
157
+ } catch (e) {
158
+ if (ptr4) wasm.__wbindgen_export3(ptr4, len4 * 1, 1);
159
+ if (ptr3) wasm.__wbindgen_export3(ptr3, len3 * 1, 1);
160
+ if (ptr2) wasm.__wbindgen_export3(ptr2, len2 * 1, 1);
161
+ if (ptr1) wasm.__wbindgen_export3(ptr1, len1 * 4, 4);
162
+ if (ptr0) wasm.__wbindgen_export3(ptr0, len0 * 1, 1);
163
+ throw e;
164
+ }
165
+ const ret = wasm.keybase_from_legacy(
166
+ ptr0,
167
+ len0,
168
+ ptr1,
169
+ len1,
170
+ ptr2,
171
+ len2,
172
+ ptr3,
173
+ len3,
174
+ ptr4,
175
+ len4,
176
+ );
177
+ return ret === 0 ? undefined : Keybase.__wrap(ret);
178
+ }
179
+ /**
180
+ * @param {Uint8Array | number[]} material
181
+ * @returns {Uint8Array}
182
+ */
183
+ wrap(material) {
184
+ try {
185
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
186
+ const ptr0 = passArray8ToWasm0(material, wasm.__wbindgen_export4);
187
+ const len0 = WASM_VECTOR_LEN;
188
+ wasm.keybase_wrap(retptr, this.__wbg_ptr, ptr0, len0);
189
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
190
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
191
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
192
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
193
+ return v2;
194
+ } finally {
195
+ wasm.__wbindgen_add_to_stack_pointer(16);
196
+ }
197
+ }
198
+ }
199
+ if (Symbol.dispose) Keybase.prototype[Symbol.dispose] = Keybase.prototype.free;
200
+
201
+ export class ProtectPwOut {
202
+ static __wrap(ptr) {
203
+ const obj = Object.create(ProtectPwOut.prototype);
204
+ obj.__wbg_ptr = ptr;
205
+ ProtectPwOutFinalization.register(obj, obj.__wbg_ptr, obj);
206
+ return obj;
207
+ }
208
+ __destroy_into_raw() {
209
+ const ptr = this.__wbg_ptr;
210
+ this.__wbg_ptr = 0;
211
+ ProtectPwOutFinalization.unregister(this);
212
+ return ptr;
213
+ }
214
+ free() {
215
+ const ptr = this.__destroy_into_raw();
216
+ wasm.__wbg_protectpwout_free(ptr, 0);
217
+ }
218
+ /**
219
+ * @returns {Uint8Array}
220
+ */
221
+ get kbm() {
222
+ try {
223
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
224
+ wasm.__wbg_get_protectpwout_kbm(retptr, this.__wbg_ptr);
225
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
226
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
227
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
228
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
229
+ return v1;
230
+ } finally {
231
+ wasm.__wbindgen_add_to_stack_pointer(16);
232
+ }
233
+ }
234
+ /**
235
+ * @returns {Uint8Array}
236
+ */
237
+ get ppw() {
238
+ try {
239
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
240
+ wasm.__wbg_get_protectpwout_ppw(retptr, this.__wbg_ptr);
241
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
242
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
243
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
244
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
245
+ return v1;
246
+ } finally {
247
+ wasm.__wbindgen_add_to_stack_pointer(16);
248
+ }
249
+ }
250
+ /**
251
+ * @param {Uint8Array | number[]} arg0
252
+ */
253
+ set kbm(arg0) {
254
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_export4);
255
+ const len0 = WASM_VECTOR_LEN;
256
+ wasm.__wbg_set_protectpwout_kbm(this.__wbg_ptr, ptr0, len0);
257
+ }
258
+ /**
259
+ * @param {Uint8Array | number[]} arg0
260
+ */
261
+ set ppw(arg0) {
262
+ const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_export4);
263
+ const len0 = WASM_VECTOR_LEN;
264
+ wasm.__wbg_set_protectpwout_ppw(this.__wbg_ptr, ptr0, len0);
265
+ }
266
+ }
267
+ if (Symbol.dispose) {
268
+ ProtectPwOut.prototype[Symbol.dispose] = ProtectPwOut.prototype.free;
269
+ }
270
+
271
+ /**
272
+ * @param {Uint8Array | number[]} challenge
273
+ * @param {number} cost
274
+ * @returns {Uint8Array}
275
+ */
276
+ export function pow_captcha(challenge, cost) {
277
+ try {
278
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
279
+ const val2 = +cost;
280
+ const ptr0 = passArray8ToWasm0(challenge, wasm.__wbindgen_export4);
281
+ const len0 = WASM_VECTOR_LEN;
282
+ wasm.pow_captcha(retptr, ptr0, len0, val2);
283
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
284
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
285
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
286
+ wasm.__wbindgen_export3(r0, r1 * 1, 1);
287
+ return v3;
288
+ } finally {
289
+ wasm.__wbindgen_add_to_stack_pointer(16);
290
+ }
291
+ }
292
+
293
+ /**
294
+ * @param {Uint8Array | number[]} pw
295
+ * @returns {ProtectPwOut}
296
+ */
297
+ export function protect_pw_v0(pw) {
298
+ const ptr0 = passArray8ToWasm0(pw, wasm.__wbindgen_export4);
299
+ const len0 = WASM_VECTOR_LEN;
300
+ const ret = wasm.protect_pw_v0(ptr0, len0);
301
+ return ProtectPwOut.__wrap(ret);
302
+ }
303
+
304
+ /**
305
+ * @param {Uint8Array | number[]} pw
306
+ * @param {Uint8Array | number[]} user_salt
307
+ * @returns {ProtectPwOut}
308
+ */
309
+ export function protect_pw_v1(pw, user_salt) {
310
+ let ptr0, len0, ptr1, len1;
311
+ try {
312
+ ptr0 = passArray8ToWasm0(pw, wasm.__wbindgen_export4);
313
+ len0 = WASM_VECTOR_LEN;
314
+ ptr1 = passArray8ToWasm0(user_salt, wasm.__wbindgen_export4);
315
+ len1 = WASM_VECTOR_LEN;
316
+ } catch (e) {
317
+ if (ptr1) wasm.__wbindgen_export3(ptr1, len1 * 1, 1);
318
+ if (ptr0) wasm.__wbindgen_export3(ptr0, len0 * 1, 1);
319
+ throw e;
320
+ }
321
+ const ret = wasm.protect_pw_v1(ptr0, len0, ptr1, len1);
322
+ return ProtectPwOut.__wrap(ret);
323
+ }
324
+ export function __wbg___wbindgen_throw_4c88d8bf264fd984(arg0, arg1) {
325
+ throw new Error(getStringFromWasm0(arg0, arg1));
326
+ }
327
+ export function __wbg_getRandomValues_46e92be488664c1f() {
328
+ return handleError(function (arg0, arg1) {
329
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
330
+ }, arguments);
331
+ }
332
+ export function __wbindgen_init_externref_table() {
333
+ const table = wasm.__wbindgen_externrefs;
334
+ table.set(0, undefined);
335
+ table.set(1024, undefined);
336
+ table.set(1025, null);
337
+ table.set(1026, true);
338
+ table.set(1027, false);
339
+ }
340
+ const KeybaseFinalization = (typeof FinalizationRegistry === 'undefined')
341
+ ? { register: () => {}, unregister: () => {} }
342
+ : new FinalizationRegistry((ptr) => wasm.__wbg_keybase_free(ptr, 1));
343
+ const ProtectPwOutFinalization = (typeof FinalizationRegistry === 'undefined')
344
+ ? { register: () => {}, unregister: () => {} }
345
+ : new FinalizationRegistry((ptr) => wasm.__wbg_protectpwout_free(ptr, 1));
346
+
347
+ function addToExternrefTable0(obj) {
348
+ const idx = wasm.__wbindgen_export2();
349
+ wasm.__wbindgen_externrefs.set(idx, obj);
350
+ return idx;
351
+ }
352
+
353
+ function getArrayU8FromWasm0(ptr, len) {
354
+ ptr = ptr >>> 0;
355
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
356
+ }
357
+
358
+ let cachedDataViewMemory0 = null;
359
+ function getDataViewMemory0() {
360
+ if (
361
+ cachedDataViewMemory0 === null ||
362
+ cachedDataViewMemory0.buffer.detached === true ||
363
+ (cachedDataViewMemory0.buffer.detached === undefined &&
364
+ cachedDataViewMemory0.buffer !== wasm.memory.buffer)
365
+ ) {
366
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
367
+ }
368
+ return cachedDataViewMemory0;
369
+ }
370
+
371
+ function getStringFromWasm0(ptr, len) {
372
+ ptr = ptr >>> 0;
373
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
374
+ }
375
+
376
+ let cachedUint32ArrayMemory0 = null;
377
+ function getUint32ArrayMemory0() {
378
+ if (
379
+ cachedUint32ArrayMemory0 === null ||
380
+ cachedUint32ArrayMemory0.byteLength === 0
381
+ ) {
382
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
383
+ }
384
+ return cachedUint32ArrayMemory0;
385
+ }
386
+
387
+ let cachedUint8ArrayMemory0 = null;
388
+ function getUint8ArrayMemory0() {
389
+ if (
390
+ cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
391
+ ) {
392
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
393
+ }
394
+ return cachedUint8ArrayMemory0;
395
+ }
396
+
397
+ function handleError(f, args) {
398
+ try {
399
+ return f.apply(this, args);
400
+ } catch (e) {
401
+ const idx = addToExternrefTable0(e);
402
+ wasm.__wbindgen_export(idx);
403
+ }
404
+ }
405
+
406
+ function passArray32ToWasm0(arg, malloc) {
407
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
408
+ getUint32ArrayMemory0().set(arg, ptr / 4);
409
+ WASM_VECTOR_LEN = arg.length;
410
+ return ptr;
411
+ }
412
+
413
+ function passArray8ToWasm0(arg, malloc) {
414
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
415
+ getUint8ArrayMemory0().set(arg, ptr / 1);
416
+ WASM_VECTOR_LEN = arg.length;
417
+ return ptr;
418
+ }
419
+
420
+ function passStringToWasm0(arg, malloc, realloc) {
421
+ if (realloc === undefined) {
422
+ const buf = cachedTextEncoder.encode(arg);
423
+ const ptr = malloc(buf.length, 1) >>> 0;
424
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
425
+ WASM_VECTOR_LEN = buf.length;
426
+ return ptr;
427
+ }
428
+
429
+ let len = arg.length;
430
+ let ptr = malloc(len, 1) >>> 0;
431
+
432
+ const mem = getUint8ArrayMemory0();
433
+
434
+ let offset = 0;
435
+
436
+ for (; offset < len; offset++) {
437
+ const code = arg.charCodeAt(offset);
438
+ if (code > 0x7F) break;
439
+ mem[ptr + offset] = code;
440
+ }
441
+ if (offset !== len) {
442
+ if (offset !== 0) {
443
+ arg = arg.slice(offset);
444
+ }
445
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
446
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
447
+ const ret = cachedTextEncoder.encodeInto(arg, view);
448
+
449
+ offset += ret.written;
450
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
451
+ }
452
+
453
+ WASM_VECTOR_LEN = offset;
454
+ return ptr;
455
+ }
456
+
457
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
458
+ cachedTextDecoder.decode();
459
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
460
+ let numBytesDecoded = 0;
461
+ function decodeText(bytes) {
462
+ numBytesDecoded += bytes.length;
463
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
464
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
465
+ cachedTextDecoder.decode();
466
+ numBytesDecoded = bytes.length;
467
+ }
468
+ return cachedTextDecoder.decode(bytes);
469
+ }
470
+
471
+ const cachedTextEncoder = new TextEncoder();
472
+
473
+ if (!('encodeInto' in cachedTextEncoder)) {
474
+ cachedTextEncoder.encodeInto = function (arg, view) {
475
+ const buf = cachedTextEncoder.encode(arg);
476
+ view.set(buf);
477
+ return {
478
+ read: arg.length,
479
+ written: buf.length,
480
+ };
481
+ };
482
+ }
483
+
484
+ let WASM_VECTOR_LEN = 0;
485
+
486
+ let wasm;
487
+ export function __wbg_set_wasm(val) {
488
+ wasm = val;
489
+ }
@@ -0,0 +1,12 @@
1
+ // @generated file from wasmbuild -- do not edit
2
+ // @ts-nocheck: generated
3
+ // deno-lint-ignore-file
4
+ // deno-fmt-ignore-file
5
+ // @ts-self-types="./pykrete_front.d.ts"
6
+
7
+ // source-hash: 4a35ebf9aea128ac1e5e9a8757822857423a266c
8
+ import * as wasm from "./pykrete_front.wasm";
9
+ export * from "./pykrete_front.internal.js";
10
+ import { __wbg_set_wasm } from "./pykrete_front.internal.js";
11
+ __wbg_set_wasm(wasm);
12
+ wasm.__wbindgen_start();
Binary file