@joe-p/react-native-falcon
v0.1.0
Published
Falcon is based on NTRU lattices, used with a hash-and-sign structure
Readme
🦅 react-native-falcon
[!IMPORTANT] This is a primitive library used for interacting with the underlying native falcon code. It is not a Falcon LSIG Account; this library only provides the primitives for signing and verifying messages.
Falcon is based on NTRU lattices, used with a hash-and-sign structure.
📦 Installation
react-native-nitro-modulesis required as this library relies on Nitro Modules.
pnpm add react-native-falcon react-native-nitro-modules🚀 Usage
import { FalconModule } from "react-native-falcon";
// 1. Generate a key pair
const { publicKey, privateKey } = FalconModule.generateKey();
// 2. Sign a message
const message = new TextEncoder().encode("Hello, Falcon!").buffer as ArrayBuffer;
const signature = FalconModule.signCompressed(privateKey, message);
// 3. Verify a signature
try {
FalconModule.verify(publicKey, signature, message);
console.log("Signature is valid!");
} catch (error) {
console.error("Signature verification failed:", error.message);
}
// Access constants
console.log(`Public Key Size: ${FalconModule.publicKeySize}`);
console.log(`Private Key Size: ${FalconModule.privateKeySize}`);🤝 Contributing
📄 License
Apache-2.0
Made with create-react-native-library
