···77import { schema } from "./types.ts";
88import * as check from "./check.ts";
99import { crypto } from "@std/crypto";
1010-import { concat, equals, fromString, toString } from "@atp/ui8";
1010+import { concat, equals, fromString, toString } from "@atp/bytes";
11111212export const cborEncode = cborCodec.encode;
1313export const cborDecode = cborCodec.decode;
+1-1
common/streams.ts
···11-import { concat } from "@std/bytes";
11+import { concat } from "@atp/bytes";
22import { Buffer } from "@std/io";
3344export const forwardStreamErrors = (..._streams: ReadableStream[]) => {
+1-1
common/tests/ipld-multi_test.ts
···11import { CID } from "multiformats/cid";
22-import * as ui8 from "uint8arrays";
22+import * as ui8 from "@atp/bytes";
33import { cborDecodeMulti, cborEncode, type CborObject } from "../mod.ts";
44import { assert, assertEquals } from "@std/assert";
55
+1-1
common/tests/ipld_test.ts
···11-import * as ui8 from "uint8arrays";
11+import * as ui8 from "@atp/bytes";
22import {
33 cborDecode,
44 cborEncode,
···11-import * as uint8arrays from "@atp/ui8";
11+import * as uint8arrays from "@atp/bytes";
22import { BASE58_MULTIBASE_PREFIX, DID_KEY_PREFIX } from "./const.ts";
33import { plugins } from "./plugins.ts";
44import { extractMultikey, extractPrefixedBytes, hasPrefix } from "./utils.ts";
+1-1
crypto/multibase.ts
···11-import { fromString, type SupportedEncodings, toString } from "@atp/ui8";
11+import { fromString, type SupportedEncodings, toString } from "@atp/bytes";
2233export const multibaseToBytes = (mb: string): Uint8Array => {
44 const base = mb[0];
+1-1
crypto/p256/encoding.ts
···11import { p256 } from "@noble/curves/nist.js";
22-import { toString } from "@atp/ui8";
22+import { toString } from "@atp/bytes";
3344export const compressPubkey = (pubkeyBytes: Uint8Array): Uint8Array => {
55 // Check if key is already compressed (33 bytes starting with 0x02 or 0x03)
+5-2
crypto/p256/keypair.ts
···11import { p256 } from "@noble/curves/nist.js";
22import { sha256 } from "@noble/hashes/sha2.js";
33-import { fromString as ui8FromString, toString as ui8ToString } from "@atp/ui8";
44-import type { SupportedEncodings } from "uint8arrays/to-string";
33+import {
44+ fromString as ui8FromString,
55+ type SupportedEncodings,
66+ toString as ui8ToString,
77+} from "@atp/bytes";
58import { P256_JWT_ALG } from "../const.ts";
69import * as did from "../did.ts";
710import type { Keypair } from "../types.ts";
+1-1
crypto/p256/operations.ts
···11import { p256 } from "@noble/curves/nist.js";
22import { sha256 } from "@noble/hashes/sha2.js";
33-import { equals as ui8equals } from "@atp/ui8";
33+import { equals as ui8equals } from "@atp/bytes";
44import { P256_DID_PREFIX } from "../const.ts";
55import type { VerifyOptions } from "../types.ts";
66import { extractMultikey, extractPrefixedBytes, hasPrefix } from "../utils.ts";
+1-1
crypto/random.ts
···11import * as noble from "@noble/hashes/utils.js";
22-import { type SupportedEncodings, toString } from "@atp/ui8";
22+import { type SupportedEncodings, toString } from "@atp/bytes";
33import { sha256 } from "./sha.ts";
4455export const randomBytes = noble.randomBytes;
+1-1
crypto/secp256k1/encoding.ts
···11import { secp256k1 as k256 } from "@noble/curves/secp256k1.js";
22-import { toString } from "@atp/ui8";
22+import { toString } from "@atp/bytes";
3344export const compressPubkey = (pubkeyBytes: Uint8Array): Uint8Array => {
55 // Check if key is already compressed (33 bytes starting with 0x02 or 0x03)
+1-1
crypto/secp256k1/keypair.ts
···44 fromString as ui8FromString,
55 type SupportedEncodings,
66 toString as ui8ToString,
77-} from "@atp/ui8";
77+} from "@atp/bytes";
88import { SECP256K1_JWT_ALG } from "../const.ts";
99import * as did from "../did.ts";
1010import type { Keypair } from "../types.ts";
+1-1
crypto/secp256k1/operations.ts
···11import { secp256k1 as k256 } from "@noble/curves/secp256k1.js";
22import { sha256 } from "@noble/hashes/sha2.js";
33-import { equals } from "@atp/ui8";
33+import { equals } from "@atp/bytes";
44import { SECP256K1_DID_PREFIX } from "../const.ts";
55import type { VerifyOptions } from "../types.ts";
66import { extractMultikey, extractPrefixedBytes, hasPrefix } from "../utils.ts";
+1-1
crypto/sha.ts
···11import * as noble from "@noble/hashes/sha2.js";
22-import * as uint8arrays from "@atp/ui8";
22+import * as uint8arrays from "@atp/bytes";
3344// takes either bytes of utf8 input
55// @TODO this can be sync
+1-1
crypto/tests/did_test.ts
···11-import { equals, fromString } from "@atp/ui8";
11+import { equals, fromString } from "@atp/bytes";
22import { P256Keypair, Secp256k1Keypair } from "../mod.ts";
33import * as did from "../did.ts";
44import { assert, assertEquals } from "@std/assert";
+1-1
crypto/tests/generate-vectors.ts
···11import { writeFileSync } from "node:fs";
22import { dirname, join } from "node:path";
33import { fileURLToPath } from "node:url";
44-import { equals, fromString, toString } from "@atp/ui8";
44+import { equals, fromString, toString } from "@atp/bytes";
55import { cborEncode } from "@atp/common";
66import {
77 bytesToMultibase,
+1-1
crypto/tests/signatures_test.ts
···11import fs from "node:fs";
22-import * as uint8arrays from "@atp/ui8";
22+import * as uint8arrays from "@atp/bytes";
33import {
44 multibaseToBytes,
55 P256_JWT_ALG,
+1-1
crypto/utils.ts
···11-import { equals, fromString } from "@atp/ui8";
11+import { equals, fromString } from "@atp/bytes";
22import { BASE58_MULTIBASE_PREFIX, DID_KEY_PREFIX } from "./const.ts";
3344export const extractMultikey = (did: string): string => {
+1-1
crypto/verify.ts
···11-import { fromString } from "@atp/ui8";
11+import { fromString } from "@atp/bytes";
22import { parseDidKey } from "./did.ts";
33import { plugins } from "./plugins.ts";
44import type { VerifyOptions } from "./types.ts";
···11-import * as ui8 from "uint8arrays";
11+import * as ui8 from "@atp/bytes";
22import * as common from "@atp/common";
33import { MINUTE } from "@atp/common";
44-import * as crypto from "@atproto/crypto";
44+import * as crypto from "@atp/crypto";
55import { AuthRequiredError } from "./errors.ts";
6677type ServiceJwtParams = {
···8686 msgBytes: Uint8Array,
8787 sigBytes: Uint8Array,
8888 alg: string,
8989-) => Promise<boolean>;
8989+) => boolean;
90909191export const verifyJwt = async (
9292 jwtStr: string,
···112112 // service tokens are not OAuth 2.0 access tokens
113113 // https://datatracker.ietf.org/doc/html/rfc9068
114114 header["typ"] === "at+jwt" ||
115115- // "refresh+jwt" is a non-standard type used by the @atproto packages
115115+ // "refresh+jwt" is a non-standard type used by atproto packages
116116 header["typ"] === "refresh+jwt" ||
117117 // "DPoP" proofs are not meant to be used as service tokens
118118 // https://datatracker.ietf.org/doc/html/rfc9449
···11import { MINUTE } from "@atp/common";
22-import { Secp256k1Keypair } from "@atproto/crypto";
22+import { Secp256k1Keypair } from "@atp/crypto";
33import type { LexiconDoc } from "@atp/lexicon";
44import { XrpcClient, XRPCError } from "@atp/xrpc";
55import * as xrpcServer from "../mod.ts";
+1-1
xrpc-server/tests/bodies_test.ts
···11import { cidForCbor } from "@atp/common";
22-import { randomBytes } from "@atproto/crypto";
22+import { randomBytes } from "@atp/crypto";
33import type { LexiconDoc } from "@atp/lexicon";
44import { ResponseType, XrpcClient, XRPCError } from "@atp/xrpc";
55import * as xrpcServer from "../mod.ts";
+1-1
xrpc-server/tests/frames_test.ts
···11import { encodeCbor } from "@std/cbor";
22-import * as uint8arrays from "uint8arrays";
22+import * as uint8arrays from "@atp/bytes";
33import { ErrorFrame, Frame, FrameType, MessageFrame } from "../mod.ts";
44import { assertEquals, assertThrows } from "@std/assert";
55