import EcCurves from '../models/EcCurves.js';
/**
 * Length of public key
 *
 * @param curveName CurveNameEnum
 * @returns number length of the public key
 */
export function lengthOfPublicKey(curveName) {
    return Math.ceil(EcCurves.getCurveLength(curveName) / 8);
}
/**
 * Length of signature
 *
 * ECDSA signatures are 2 times longer than the signer's private key for the curve used during the signing process.
 * For example, for 256-bit elliptic curves (like secp256k1 ) the ECDSA signature is 512 bits (64 bytes) and for 521-bit
 * curves (like secp521r1 ) the signature is 1042 bits.
 *
 * @param curveName CurveNameEnum
 * @returns number length of the signature
 */
export function lengthOfSignature(curveName) {
    return Math.ceil((EcCurves.getCurveLength(curveName) * 2) / 8);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsY3VsYXRlQnlDdXJ2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9uYW5vdGRmL2hlbHBlcnMvY2FsY3VsYXRlQnlDdXJ2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLFFBQVEsTUFBTSxvQkFBb0IsQ0FBQztBQUUxQzs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSxpQkFBaUIsQ0FBQyxTQUF3QjtJQUN4RCxPQUFPLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLGNBQWMsQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztBQUMzRCxDQUFDO0FBRUQ7Ozs7Ozs7OztHQVNHO0FBQ0gsTUFBTSxVQUFVLGlCQUFpQixDQUFDLFNBQXdCO0lBQ3hELE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDLFFBQVEsQ0FBQyxjQUFjLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFDakUsQ0FBQyJ9