import { GMAC_BINDING_LEN } from '../constants.js';
import { lengthOfSignature } from './calculateByCurve.js';
/**
 * Length of binding in bytes
 *
 * Get the binding length based on whether ECDSA binding is used and the curve name.
 * If no ECDSA then use GMAC binding.
 *
 * @param useEcdsaBinding boolean whether an ECDSA binding is used
 * @param curveName CurveNameEnum name of the curve
 * @returns number length of the binding
 */
export function lengthOfBinding(useEcdsaBinding, curve) {
    if (useEcdsaBinding) {
        return lengthOfSignature(curve);
    }
    return GMAC_BINDING_LEN;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsY3VsYXRlQnlDaXBoZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbmFub3RkZi9oZWxwZXJzL2NhbGN1bGF0ZUJ5Q2lwaGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUVoRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUV2RDs7Ozs7Ozs7O0dBU0c7QUFDSCxNQUFNLFVBQVUsZUFBZSxDQUFDLGVBQXdCLEVBQUUsS0FBb0I7SUFDNUUsSUFBSSxlQUFlLEVBQUU7UUFDbkIsT0FBTyxpQkFBaUIsQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUNqQztJQUNELE9BQU8sZ0JBQWdCLENBQUM7QUFDMUIsQ0FBQyJ9