fix: bn clipping in create_program_address (#11951)
This commit is contained in:
@ -105,7 +105,7 @@ export class PublicKey {
|
||||
Buffer.from('ProgramDerivedAddress'),
|
||||
]);
|
||||
let hash = await sha256(new Uint8Array(buffer));
|
||||
let publicKeyBytes = new BN(hash, 16).toArray();
|
||||
let publicKeyBytes = new BN(hash, 16).toArray(null, 32);
|
||||
if (is_on_curve(publicKeyBytes)) {
|
||||
throw new Error(`Invalid seeds, address must fall off the curve`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user