const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
const require_forge$1 = require('./forge.cjs');
const require_util$1 = require('./util.cjs');

//#region ../../node_modules/node-forge/lib/mgf1.js
var require_mgf1 = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/node-forge/lib/mgf1.js": ((exports, module) => {
	/**
	* Javascript implementation of mask generation function MGF1.
	*
	* @author Stefan Siegl
	* @author Dave Longley
	*
	* Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
	* Copyright (c) 2014 Digital Bazaar, Inc.
	*/
	var forge = require_forge$1.default;
	require_util$1.default;
	forge.mgf = forge.mgf || {};
	var mgf1 = module.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {};
	/**
	* Creates a MGF1 mask generation function object.
	*
	* @param md the message digest API to use (eg: forge.md.sha1.create()).
	*
	* @return a mask generation function object.
	*/
	mgf1.create = function(md) {
		return { generate: function(seed, maskLen) {
			var t = new forge.util.ByteBuffer();
			var len = Math.ceil(maskLen / md.digestLength);
			for (var i = 0; i < len; i++) {
				var c = new forge.util.ByteBuffer();
				c.putInt32(i);
				md.start();
				md.update(seed + c.getBytes());
				t.putBuffer(md.digest());
			}
			t.truncate(t.length() - maskLen);
			return t.getBytes();
		} };
	};
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_mgf1();
  }
});
//# sourceMappingURL=mgf1.cjs.map