Skip to content

Type Property

byteRanges

Specifies the byte ranges in which the X and Y coordinates of an ECDSA public key appear for the P256 curve. For P256, the public key is typically 65 bytes long: a single byte prefix (usually 0x04 for uncompressed keys), followed by 32 bytes for the X coordinate, and then 32 bytes for the Y coordinate.
static let byteRanges: (x: Range<Int>, y: Range<Int>)

Discussion

Thus:

  • The X coordinate spans bytes 1 through 32 (byte 0 is for the prefix).

  • The Y coordinate spans bytes 33 through 64.