@Override
	protected void read(InputBuffer b) throws IOException, ParsingException {
		iv = b.get(0, 16);

		int curve = Util.getShort(b.get(16, 2));

		if (curve != 714) {
			throw new ParsingException("Unknown curve: " + 714);
		}

		int xLength = Util.getShort(b.get(18, 2));

		if (xLength > 32 || xLength < 0) {
			throw new ParsingException("xLength must be between 0 and 32: " + xLength);
		}

		BigInteger x = Util.getUnsignedBigInteger(b.get(20, xLength), 0, xLength);
		b = b.getSubBuffer(xLength + 20);

		int yLength = Util.getShort(b.get(0, 2));

		if (yLength > 32 || yLength < 0) {
			throw new ParsingException("yLength must be between 0 and 32: " + yLength);
		}

		BigInteger y = Util.getUnsignedBigInteger(b.get(2, yLength), 0, yLength);
		b = b.getSubBuffer(2 + yLength);

		publicKey = CryptManager.getInstance().createPublicEncryptionKey(x, y);

		encrypted = b.get(0, b.length() - 32);
		mac = b.get(b.length() - 32, 32);
	}