23 lines
822 B
TypeScript
23 lines
822 B
TypeScript
/**
|
|
* RFC 5054 Appendix A — 1024-bit group `(N_1024, g_1024 = 2)`. Required
|
|
* for the Appendix B test-vector suite; otherwise legacy.
|
|
*/
|
|
|
|
const N_1024_HEX =
|
|
"EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576" +
|
|
"D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE48E495C1D6089DAD1" +
|
|
"5DC7D7B46154D6B6CE8EF4AD69B15D4982559B297BCF1885C529F566660E57EC" +
|
|
"68EDBC3C05726CC02FD4CBF4976EAA9AFD5138FE8376435B9FC61D2FC0EB06E3";
|
|
|
|
function hexToBytes(hex: string): Uint8Array {
|
|
const out = new Uint8Array(hex.length / 2);
|
|
for (let i = 0; i < out.length; i++) {
|
|
out[i] = Number.parseInt(hex.substr(i * 2, 2), 16);
|
|
}
|
|
return out;
|
|
}
|
|
|
|
export const N_1024: Uint8Array = hexToBytes(N_1024_HEX);
|
|
export const g_1024: Uint8Array = new Uint8Array([2]);
|
|
export const BIT_LENGTH = 1024;
|