Calculating s_t * B * s