pub fn affine_point_multiplication(
        &mut self,
        curve: &EllipticCurve,
        k: &[u8],
        x: &mut [u8],
        y: &mut [u8],
    ) -> Result<(), Error> {
        let curve = match curve {
            EllipticCurve::P192 => {
                if k.len() != 24 || x.len() != 24 || y.len() != 24 {
                    return Err(Error::SizeMismatchCurve);
                }
                false
            }
            EllipticCurve::P256 => {
                if k.len() != 32 || x.len() != 32 || y.len() != 32 {
                    return Err(Error::SizeMismatchCurve);
                }
                true
            }
        };
        let mode = WorkMode::PointMultiMode;

        let mut tmp = [0_u8; 32];
        self.reverse_words(k, &mut tmp);
        self.alignment_helper
            .volatile_write_regset(self.regs().k_mem(0).as_ptr(), tmp.as_ref(), 8);
        self.reverse_words(x, &mut tmp);
        self.alignment_helper.volatile_write_regset(
            self.regs().px_mem(0).as_ptr(),
            tmp.as_ref(),
            8,
        );
        self.reverse_words(y, &mut tmp);
        self.alignment_helper.volatile_write_regset(
            self.regs().py_mem(0).as_ptr(),
            tmp.as_ref(),
            8,
        );

        self.regs().mult_conf().write(|w| unsafe {
            w.work_mode()
                .bits(mode as u8)
                .key_length()
                .bit(curve)
                .start()
                .set_bit()
        });

        // wait for interrupt
        while self.is_busy() {}

        self.alignment_helper
            .volatile_read_regset(self.regs().px_mem(0).as_ptr(), &mut tmp, 8);
        self.reverse_words(tmp.as_ref(), x);
        self.alignment_helper
            .volatile_read_regset(self.regs().py_mem(0).as_ptr(), &mut tmp, 8);
        self.reverse_words(tmp.as_ref(), y);

        Ok(())
    }
# Base point multiplication

Base Point Multiplication can be represented as:
(Q_x, Q_y) = k * (P_x, P_y)

Output is stored in `x` and `y`.

# Error

This function will return an error if any bitlength value is different
from the bitlength of the prime fields of the curve.
esp-hal/src/ecc.rs