Function toCompressedSec1 [src]
Serialize a point using the compressed SEC-1 format.
Prototype
pub fn toCompressedSec1(p: P384) [49]u8
Parameters
p: P384
Source
pub fn toCompressedSec1(p: P384) [49]u8 {
var out: [49]u8 = undefined;
const xy = p.affineCoordinates();
out[0] = if (xy.y.isOdd()) 3 else 2;
out[1..].* = xy.x.toBytes(.big);
return out;
}