jscofhe
Version:
Implements js library for CoFHE
41 lines • 2.82 kB
TypeScript
import type { CLHSM2kCiphertext, CLHSM2kCleartext, CLHSM2kPartialDecryptionResult } from '../cryptosystems/cpu_cryptosystem/internals/clhsm2k.js';
import type { CPUCryptoSystem } from '../cryptosystems/index.js';
import type { PKCEncryptor, Reencryptor } from './reencryptor.js';
export type RSAEncryptorPublicKey = CryptoKey;
export type RSAEncryptorPrivateKey = CryptoKey;
type RSAEncryptorPlainText = Uint8Array;
type RSAEncryptorCipherText = Uint8Array;
export declare class RSAEncryptor implements PKCEncryptor<RSAEncryptorPrivateKey, RSAEncryptorPublicKey, RSAEncryptorPlainText, RSAEncryptorCipherText> {
private key_size;
constructor(key_size: number);
encrypt(pk: RSAEncryptorPublicKey, pt: Uint8Array): Promise<Uint8Array>;
decrypt(sk: RSAEncryptorPrivateKey, ct: Uint8Array): Promise<Uint8Array>;
generate_key(): Promise<{
public_key: RSAEncryptorPublicKey;
secret_key: RSAEncryptorPrivateKey;
}>;
serialize_public_key(pk: RSAEncryptorPublicKey): Promise<Uint8Array>;
serialize_secret_key(sk: RSAEncryptorPrivateKey): Promise<Uint8Array>;
deserialize_public_key(serialized_pub_key: Uint8Array): Promise<RSAEncryptorPublicKey>;
deserialize_secret_key(serialized_secret_key: Uint8Array): Promise<RSAEncryptorPrivateKey>;
serialize_ciphertext(ct: RSAEncryptorCipherText): Promise<Uint8Array>;
}
export declare class CPURSAReencryptor implements Reencryptor<CLHSM2kCiphertext, CLHSM2kCleartext, CLHSM2kPartialDecryptionResult, RSAEncryptorPrivateKey, RSAEncryptorPublicKey> {
private rsaEncryptor;
private cs;
constructor(rsaEncryptor: RSAEncryptor, clhsm2k: CPUCryptoSystem);
reencrypt(partial_decryption_result: CLHSM2kPartialDecryptionResult, pkc_public_key: RSAEncryptorPublicKey): Promise<Uint8Array>;
decrypt(reencrypted_partial_decryption_results: Uint8Array[], ct: CLHSM2kCiphertext, reencryption_private_key: RSAEncryptorPrivateKey): Promise<CLHSM2kCleartext>;
generate_reencryption_key_pair(): Promise<{
public_key: RSAEncryptorPublicKey;
secret_key: RSAEncryptorPrivateKey;
}>;
serialize_reencryption_private_key(sk: RSAEncryptorPrivateKey): Promise<Uint8Array>;
serialize_reencryption_public_key(pk: RSAEncryptorPublicKey): Promise<Uint8Array>;
deserialize_reencryption_private_key(serialized_reencryption_private_key: Uint8Array): Promise<RSAEncryptorPrivateKey>;
deserialize_reencryption_public_key(serialized_reencryption_public_key: Uint8Array): Promise<RSAEncryptorPublicKey>;
concatenate_reencrypted_partial_decryption_results(reencrypted_partial_decryption_results: Uint8Array[]): Promise<Uint8Array>;
split_reencrypted_partial_decryption_results(reencrypted_partial_decryption_results: Uint8Array): Promise<Uint8Array[]>;
}
export {};
//# sourceMappingURL=rsa.d.ts.map