### Get Public Key (secp256k1) - Example with specific key Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/ed25519/vectors.txt Demonstrates retrieving an uncompressed secp256k1 public key from a specific private key. The 'false' argument disables compression. ```typescript import { getPublicKey } from "noble-curves/secp256k1"; const privateKey = "a1b2c3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef"; const publicKeyUncompressed = getPublicKey(privateKey, false); console.log(publicKeyUncompressed); ``` -------------------------------- ### Point Addition Example Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/ed25519/vectors.txt Demonstrates point addition on a secp256k1 curve. Ensure the 'noble-curves' library is installed. ```typescript import { Point } from "@noble/curves/abstract/modular"; import { secp256k1 } from "@noble/curves/secp256k1"; const P1: Point = secp256k1.ProjectivePoint.fromHex( "82435f39790106b3af72f91f14c928d2465f98cdd10084c4a44d19af71a1927cc52a92646f5adb21c6dde0de58786837f8a3414c09aedfc27c812218a7e7239e" ); const P2: Point = secp256k1.ProjectivePoint.fromHex( "1bea7726d912c55ec78b0c161a1ad3c9dd7bc329f85d26f62b92e31d16d83b48c9ddb42106ccef4e0ef4794551d21df94a6306872f231663e47e241f77cc3e82" ); const P3 = P1.add(P2); console.log(P3.toHex()); // Expected output: "c52a92646f5adb21c6dde0de58786837f8a3414c09aedfc27c812218a7e7239e1daa44ef06d4c10ddb48678423c5f103a1b568d42b20cc64af110fce9d7679a2dee412b4980585c26c320dbaa601c472defc3c85415daecdd6d2d9eacac85e07f3d6c46ac5248d5386b6b68462597d647039f544bb01ac2d1067daaaa397d2dbaf125a1cf8fdf280a6afec324d5311f543688a156c849819bb046b911c42ea3ca01b99808c4d1f3b8b15da3efe2f32523ec3b09c84b48cffd13c17c9e26c912d9c3e9346dfae3fd0c56c8858780782f61a4c4dbfff1e9cb4b362cd8001f9cdfeb1a72082dce9c9ade52effc9744688ac0b86c88266b53d895c17ead9e89ed8d24d40642f3ad3b9bf9bbc4dda7966ef8328289fb31e17c81fd028ef1bd9a1d4c792e86ec2dbdce3f937eecc3eeb5188d325941919bbf75b4388e2399507a3d7fb387502a95f421c85826c1c9176c923e316310a4ba45c8a5ef7557cf87b77020b24f5ba2bfd1228109566307fea65ec015019691217bce69aee16f76249c58bb3e52171cfefd5254e5e0f397169186dc7cd9c1a85c81034e037183d6ea22aee8bb74720d34ac7a5af1e92fb8185ace01d9bf0f0f9006101fcfac8bbad171b437036ef16cdae1881fc3255ca359bba1e94f79f645555950c4783bab0a944f7de8df69258b6afe2b5932217195da245fee12ac343824a0b6403dfe462d43d288db31f99097ec3edc6e76547a3742f03c777efb158f58d4053fa6cc8d68b196af4f9de516fd9fb7a6d5d9ee4a89f9b9bce1e4dee357a1e52c0544cfb35b7092d1aa5a6f7f4c7602610e9c00ef5b8761bc72279ba228a18b8400bd76d5b2bfd7c3c04aac4436dae2e98" ); ``` -------------------------------- ### Example Key Pair and Signature 10 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt A tenth example of a key pair and signature, providing more data points for validation. ```text bac507dc6edf7569f366512af88237d356ce017d89b78c5f7f9cd286d14781db:adabc96525ebb16a:af76b85670c18945cf66f8b5a16bc542ef1626d81cd47a68e4efbdbbc1e60a0c3947d4fb6e101c05b58f1c8cbabf5feb0e52127fdf6d268ef7bc9f9fd153d6a86d5f93441e60051348e3197b85bd5c565270cdd491572d4975b1a4e8a0852b7b ``` -------------------------------- ### Commit Hash Example Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/ed25519/vectors.txt This is an example of a commit hash used in the project. It represents a specific version of the codebase. ```text 7186f8d168d9ddf17edbaf0e7b1abcb26da3e4c0272d9879c7fdff6421c4ea5096b4a656232029fc1b8364703cbea7a5d7387518a88ced1a915ec8d886848132:96b4a656232029fc1b8364703cbea7a5d7387518a88ced1a915ec8d886848132:a3e6cb6b84cc5cf1fb1a848b4b8ea7cb7c87e0445750c61f9aa5d77deddf949463ecd39bfc71f2610c2a9424847fb76f84c5da1fa10ef718a34566cec1b3e899e7252e8d4d346016498ff119972750061660baed312827583181073d1dc74b76c430ca30d409e4e8439c0fc48c00680629d43ae2a77d69228f7f8a1253af15bd2cb6bb1c1696550c4c790f449869630ab92b9c11cde1f961aa2103ec23f7d9f0fe9c3c4132582efa79a66ae3426e5105b80bfe5e04dc8bb1e38a3110cd72984b3ef02a0ca62ab638cbcfbc8a6b593d2613dc06ec86fee34f6518d4a3fbdc157237174564daeb6674cdc34f4d6537cf81d8aa9bddbf3aeda312daaeee336f9ed8bff81e294bc7d44d25cd787072e6cb414b65fb7a846fc065367ba8e37beffdf0b7ba8f98cdf1eb870f4e8b7130fa3429d2e24bce5994daf1aa65e5f603b631053dc510b2f097e86e9b9b552302757968d0136ee6754c42a32c990add9cb529bc89751dfa4e5e3a0badaf4cc40b6a09507f9fcd24c3ca72259599c6ee58d857b3a189e048902e885a3607426093cb0fab437c0fb0ed2f1e96e9441a7e954fe3ef7646e26a39a07033d0a1555dfeed9a6f57794af3a2abf0057e9f853ae5c30138fd80e2f29c2f4a93ad3145da10a3e31ce9ff9786ac65d86037d98b7aa6d11de8800010e133869eb67a5039b9b8feb6ef903d0cc746412607da725ce2dc6a352109dbc6a5e40b170c23050bc4fb1efa0c34fec00eae3219c29040e8f5978c9384ee915d8c9398dd120d5c3cba38f8526b06197cb2c261dec7d726ae130f9bee17261700e99931fac4b4dca0f758701acbf3707d47df5321130ec10bb3b13078c4dc5de3470f158b57dbeb878b3a8524e0ed2c9547545f0fddf13125e45bb23d6a7b383a187f4c5d54a7b4c83d5957f2cd7e6fbc:a9c0499fc216a14532d736365c6355f938f8d8194fa1132848f83e490454d4bbf69269f12259fc6c074c1015e425e4f4f27c029c93334951361a35ad1176540ea3e6cb6b84cc5cf1fb1a848b4b8ea7cb7c87e0445750c61f9aa5d77deddf949463ecd39bfc71f2610c2a9424847fb76f84c5da1fa10ef718a34566cec1b3e899e7252e8d4d346016498ff119972750061660baed312827583181073d1dc74b76c430ca30d409e4e8439c0fc48c00680629d43ae2a77d69228f7f8a1253af15bd2cb6bb1c1696550c4c790f449869630ab92b9c11cde1f961aa2103ec23f7d9f0fe9c3c4132582efa79a66ae3426e5105b80bfe5e04dc8bb1e38a3110cd72984b3ef02a0ca62ab638cbcfbc8a6b593d2613dc06ec86fee34f6518d4a3fbdc157237174564daeb6674cdc34f4d6537cf81d8aa9bddbf3aeda312daaeee336f9ed8bff81e294bc7d44d25cd787072e6cb414b65fb7a846fc065367ba8e37beffdf0b7ba8f98cdf1eb870f4e8b7130fa3429d2e24bce5994daf1aa65e5f603b631053dc510b2f097e86e9b9b552302757968d0136ee6754c42a32c990add9cb529bc89751dfa4e5e3a0badaf4cc40b6a09507f9fcd24c3ca72259599c6ee58d857b3a189e048902e885a3607426093cb0fab437c0fb0ed2f1e96e9441a7e954fe3ef7646e26a39a07033d0a1555dfeed9a6f57794af3a2abf0057e9f853ae5c30138fd80e2f29c2f4a93ad3145da10a3e31ce9ff9786ac65d86037d98b7aa6d11de8800010e133869eb67a5039b9b8feb6ef903d0cc746412607da725ce2dc6a352109dbc6a5e40b170c23050bc4fb1efa0c34fec00eae3219c29040e8f5978c9384ee915d8c9398dd120d5c3cba38f8526b06197cb2c261dec7d726ae130f9bee17261700e99931fac4b4dca0f758701acbf3707d47df5321130ec10bb3b13078c4dc5de3470f158b57dbeb878b3a8524e0ed2c9547545f0fddf13125e45bb23d6a7b383a187f4c5d54a7b4c83d5957f2cd7e6fbc ``` -------------------------------- ### Example Key Pair and Signature 4 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt A fourth example of a key pair and signature, providing more data points for validation. ```text fab9d07eef72aeb16536abc68bd311f6a67fe0e8bffbb900a8ea40bc9239a652:412bd122c9:a1955d63b0b78e1bb0c1e661f918d21ce9f9a35a47ac6032e622525bd48fa5f32b84f0671b92fb157004972ab6b7041313410ab2e13c61ff7e0f50a6a3c4e552bb55978dfd631d11a2e0a26e337f6e91e9db53fa702c0477760349ae56167401 ``` -------------------------------- ### Example Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt This example shows a combined representation of a key pair, likely including private and public key components. ```plaintext 868a1e248f596caa36ae397726d79456fdb69341c619191940a244af6690e0b1:0e3e0406:91d463c1a0bdd8dd9d2adc0cde8b8a54572f6b9b530978a52a2562d448a1ba741e403a58dbe2ecc34876b1ed5117aef009daaa1271fdba64fe820e5e93a47d29403479e5417b6199b84356f8ab6f0d7006a2f7e79c97bcba57a489cdef4e0f10 ``` -------------------------------- ### Example Key Pair and Signature 16 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt A sixteenth example of a key pair and signature, providing additional test data. ```text c3e1b5e8bbd163deb75cc4603809a7f186d6abed4bd868b3807c583492ee4d2e:d6cf8d3b69b4fc9784127f:96cd710812c0d6c46835430536690b1636a9fd2a8a554eb65d99f991849af4159bf00dca18a458f4df45bc474c4bb916056eb413bc1305a7399a2eb0c4a1aa7a060dada885b9fe64213fadb87135c51785c42048d0705bca81c06692722aacb9 ``` -------------------------------- ### Example Key Pair and Signature 8 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt An eighth example of a key pair and signature, providing additional test data. ```text fc02b27cdaab567346a3fb31e21e5280cf7dfc8caed228152cb602b2f5fefaa3:6b78dfecbe686c:99a058012e607d0a350e8b66193d0f0eefbad1fd31184ae01178a08a4959efa329a82666156d6ad81b6d97cca66ae3851630e61fd629e7f003d71a22389cab9ecb0533a4fe8c59b45f7f80d29080a9c0b90ee7d4b351cb1258c7b3a57fb6cf4c ``` -------------------------------- ### Example Usage of secp256k1 Curve Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/ed25519/vectors.txt Demonstrates basic usage of the secp256k1 curve, including generating a private key, deriving a public key, and performing a signature. Ensure the 'noble-secp256k1' package is installed. ```typescript import { secp256k1 } from "@noble/curves/secp256k1"; import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils"; // Generate a private key const privateKey = secp256k1.utils.randomPrivateKey(); console.log("Private key:", bytesToHex(privateKey)); // Derive the public key const publicKey = secp256k1.getPublicKey(privateKey); console.log("Public key:", bytesToHex(publicKey)); // Message to sign const message = utf8ToBytes("Hello, Noble Curves!"); // Sign the message const signature = secp256k1.sign(message, privateKey); console.log("Signature:", bytesToHex(signature.toDERR())); // Verify the signature const isValid = secp256k1.verify(signature, message, publicKey); console.log("Signature valid:", isValid); ``` -------------------------------- ### Example Key Pair and Signature 6 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt A sixth example of a key pair and signature, contributing to a comprehensive set of test vectors. ```text 31e6a9f2bfd89057675b9986a2326af50fc5b4fa6900e06392500d6a7cb8281e:41e77882d77d:83a3cf3e0e9b4726f76ce301c93db6d15e563bfdb5f93e885c37f0fcf28362e54c86e30d0e6a63f831f097eb624c153e15f8061c8dfd215e7d3a3da513b8f35061b2376457391db393bbafcf43e032f4b3c39a8dd20a1f4e8df3a217113ca007 ``` -------------------------------- ### Example Private Key (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt This is an example of a private key in hexadecimal format, commonly used with the secp256k1 curve. ```plaintext b4c18feeb2ed734bbb97f2fd07bcf2b35c38aaef27b018ac20feb8c14c4990be:018426:b26329f66abf3d00f25c0ae8e4a94e3395b6550f9b9991e7ee9172f75de000167d84d02194af324a05b2f284eede6660143838070a7fc976e73c5ec443aae831f2f1656be1644aa006f153894dd488748e18c645da305a3bab7699654fa4cd43 ``` -------------------------------- ### Example Key Pair and Signature 12 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt A twelfth example of a key pair and signature, contributing to a comprehensive set of test vectors. ```text 764e65205f49486a2412d73a620c9cc56337b8b30efd0a6254085738095215f3:17582f469cfed9598c:9613a905fbd8e1f4ada58df87c91ab9335d5f72d813949ad14977d4a524660f00c12f63e4e65d16456c227de3bba02df14a4d61362fe8a7af7d7fe679e5d51cd1b979a81facb26d2501303d41f161c3443a975605fb0daee341fba692e3ef4d3 ``` -------------------------------- ### Example Key Pair and Signature 18 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt An eighteenth example of a key pair and signature, providing additional test data. ```text 29bcd632044c3f3d1f2b6c37b60a1fa531cbc380902ca7ea5e417081337631a4:5dd355519020c4a2979f09a3:b6400ded257d0e63d8ce4ff8935e6b312be17f24395b26563fe4e532e176906aa0d60d5efe7cdb8855f900dff31bb4b017b7675545f874d80e1e5fb4c0ca85d64b4bdb439a723c337226f70ea3fd9509b364665b3aac65b2e272a3f6a5e902ad ``` -------------------------------- ### Example Key Pair and Signature 14 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt A fourteenth example of a key pair and signature, providing additional test data. ```text bd2056e3125f653fa473265980d9c7e3f1a067466373baf59afaa1f62e448ee4:e9c6493ea4cc32c62780:80098bfd48c4026acb497e9bfcd33439f97aef045eb269cf271eca64a0631d99eb3a470ba53c2cde1c3b353760778ac8052311a016f8fc68de6520fce68228b56fd467b0f8527ef9ae0f50f42a28da05a3f27255be97c040a989be480df348f7 ``` -------------------------------- ### Example Key Pair and Signature 2 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt Another example of a cryptographic key pair and signature, likely for different test vectors. ```text 4c7469ccb41795860f7e228a4a50665828cf1ea62f64ca5af3dbcc90026b5173:e444ff3e:b06c465da8342a430774e64595e567e03a905735f443afd74e0d2dd06b99f8ae460062271e1e41ca7dad9e78ead9404e0e9f626b8af3275c84111956a7a146b29619435f357f5310276221c8c425023a792a561f7159ae4bea27eb6be013fb28 ``` -------------------------------- ### Example Usage of secp256k1 Curve Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/ed25519/vectors.txt Demonstrates the usage of the secp256k1 curve for cryptographic operations. This example shows how to generate a key pair and perform a signature. ```rust use elliptic_curves::secp256k1::Secp256k1; use elliptic_curves::Curve; fn main() { let curve = Secp256k1::new(); let mut rng = rand::thread_rng(); let private_key = curve.generate_private_key(&mut rng); let public_key = curve.public_key_from_private_key(&private_key); let message = b"hello world"; let signature = curve.sign(message, &private_key, &mut rng); assert!(curve.verify(message, &signature, &public_key)); } ``` -------------------------------- ### Another Key Identifier Example Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt This example provides another unique identifier, likely serving a similar purpose to other identifiers in the system. ```plaintext d6baf02a6ca31e6e8c4194ee80eae4137ac267a7f0389eed15cbe814c934f34a:43e20cfa8e:8f9487a6ce3a9b5153009a606de649d36148180d50efad4b0655fef459cd34b92fe8b729d7935479f6276fc9a7364cb9022939ec84463c080f9d161b990e2d8c79ecb013b6d3913ec37e8a21f1515a9d9c07679bff74b182e5ef0b325b83fbd9 ``` -------------------------------- ### Example Private Key (Hex) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt Represents a private key in hexadecimal format. ```plaintext 98d07d9f94dfbebafbb10c3411428262750973ac8f5bfff4f3218ddcd09d95e3 ``` ```plaintext 5770504add317933bdbe89f35463e784d798ce20b5b1dd258569955e8df4068d ``` ```plaintext 24612966cd6601308edbd27423d622dfbcb27746b31b3e9f6939b571cc865f14 ``` ```plaintext e058866deca74d7becf8ad839ab19345c6fffbeba03bb5551569e6a77fc271a6 ``` ```plaintext 6716da7e6965ea890857c0fae1c57828ce35279eb69f7dd8ba29c8aef11fbeec ``` ```plaintext ff076024d1dcd908540d3cff13e39a12544e033e5fe33e351850fd75fec62 ``` ```plaintext 893af0a540d8972ffb5b0a7fa4d24fb180230acc3960f9f30d654cf6ae5c1531 ``` ```plaintext c81191beccf7c48bef093eb0fe53536d02ac32d01ecb86358ba90303d0fcc10f ``` ```plaintext a3f68634413db07bc22c448748011efddc9c0ff5e3ddff037559299f16199373 ``` ```plaintext 6a6f8a98610a5a4acdf6da669ea3990fb299e1aedf2ac327c97b0ce96adc753b ``` ```plaintext 6422d62c14662cc8ad1fc10875ae58813fa9ee349c019c452a917d2b7ec98404 ``` ```plaintext 67cb55964dfc93f1ea615a89ea49b26c677ccb4a2a0f512935b45b3a54bf70a2 ``` ```plaintext 80e2aa0ce9bf22a06147e0b3d5dec44922422e976eec32493bb4f70a2c205082 ``` ```plaintext f8722dd9394845c2744e556933d4d7ed838e983f7088fd2ad69a769385005509 ``` ```plaintext d9ecf27ad6dd98e0ff55c5f8562eb5a7e4f46ef38a9245dffd788d6bb638cbe1 ``` ```plaintext 295b144cdec443e032d21c906e46b3594a1e50b3e6f29118028767f189ce12b6 ``` ```plaintext 2b614a7871bf0d74e53bc6c7714372353b4a22ed47f1f627d3bbb1ef7532dc77 ``` ```plaintext 422ad85c60720ef2d06cfc26ad0e7ee1af49cfd6ba025692d405b1cb41fcf71f ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 0d59c2cbc5a01509788f8d78768f6b4c70e1e56a3d064ee3a5d214b051373de0:1fb41c046728bc666e16ad566131a5c38b8562942c0f8ab175f2a82886e710e55c3af18be343a496f2426144f985c1101a08ecdd9c39081d650c7192af82a203272661c8424aad5dfd70afbff908f8cdf1b6a12cb3078663e836e317b37b47c7f986b1b4e97f7166dfaaef116205e763eb9998d64964e4:ab511a041e0ada5b71f4699a8b52479c181e1ad068ecd2f5d87fb124f2ecae402f7672851f368ec78d1d0e5ee7514cab ``` -------------------------------- ### Another Key Pair Example (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g2-test-vectors.txt This entry presents another example of a key pair, potentially with different associated data or a different curve. ```plaintext 6c3639c6647ea53eaa46bc577bbba99b305b2cb9853dfb2cfdc702665fbcb546:7ec9dcd7:85cdb3b39c6db0633cd69f414d984a990149d391314a179a8df5ca53aec19d99ff5589bc6ac1ead6194a176450760eb518631ccf74397565fe7d0f141c33c5d990df1d92aec61c7774673e6db2bc9c010660d1a960bd9bf04b34cfbbe7ec16fd ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 502ee3c386728a0c1b0cd6787ca78b7d6eb8aed2a9fa0ce7cc50b7c91869917c:7f5a1e1ab71a43bf38cd7accfd20af1e99ae55fba55ec043c5f71e4bce2535ca4c8e50f2e85432658670b6b20a8a1d9620b204938fa1aab412b959a364a5272b7364a0204fc3de15490bca3ecb572ab1ae0dba017619cfabbd10138e65399687c9288caac4ad7f2e81e6156dcfe30ee7d1f7770e03c4:94ab75ad8fc599d4a0f077df652a0c9992486dafcacfd5a5d2d8ba3b5ba0db4fd64f322106d9647aff961766aa6ec719 ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 46c3fc71ef1b3c5a5297f9e6a8e3298838c014ab9598eb9f9adbfe067edb4e16:cd6290b58efc9e7b269dd477525cf240a050b30aebf8784a9749183a139f2c8f2b620cb1555d0006cfb0e6610f5b2b3505cf3541c37ad881c898e8f49d6b1f2618792b3c122f93148c14abebc3be947443f968af0c6a0a77ed159eff04e18852d8ffa2f35ec73e21640a1408a51526011fd7a33161:b04276d98fd1b27645187512e20927e735df17d9dc5bf003cb45661119875a6353286f3dcae081df36f0fda36e71e367 ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 527fce2b29171bbdb60fb573e3639342633b1266e3f695ebce316abc86dd371c:2e549082f9eeb2534d30b90664e5091cf3411ba33fe14e1d86c353837cef4ce5178a59c68f6fea06507291770b52c8f8f28c7791961b2809a0ba682ac78a36de351bc0bd0c54a2916723d5ff2be3c73fb754e7bef4c0388f914ddd31b0f27581369d7a69b78dffc0018f2e1cd9bb840891:a94d698e8362efb86b25b7249fa09c5e627b8f976793ecb85d0f9b06e2ff8077ebafcc8ca104ff869e29f403d9cc9dc7 ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 5672c6aeba5dfecc8314b1625f509a4e0dcc36846035bab283e547a5f6d1d4f4:92ed1627ec780c62d968d13bcc181dfaf6470fc1704c92cf7a068a85eae494b7630159f5e044f42a9a7c02e2dde16c8ec81eaf650b4ded6e6cb4e92ac5e54ca4e0d69a4ad3c6d93a0e91a5eaafe989c96c07f5785bdc0b73295eecac04cb71f85fa3744da3cefb9689674d994b52f98ae6a4c784:ac129ded0f581e58ae8f7616633712c68194923db58498290a267552b2885715e437f9414a9b9fb99080f968b56d836a ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 5a03fe3b4164b562d93e129103200ce033da05153fb1a1dc35452c00c8133f6d:7be5bfa4f0ae60a0c2f5258de564ea6f6a42ccd2802928a3fd14b513262b040d78825696aa9e3891947625af2a8e5ab0f663892eb6afc4d463034ff5e7480538f7b32f93f1cb326a52af92d26305d8f3555807597cc66973d29421ce1721872753fa882a3665536f7a9e05ca536b11f8cc4d:84b36b5b7ede2b059a87e6f6b8d7daeb253b9c39438ec407b5885d4186d958e9388af554e236475642eb1102f774a956 ``` -------------------------------- ### Fast Fourier Transform (FFT) Setup Source: https://github.com/paulmillr/noble-curves/blob/main/README.md Demonstrates how to set up and use the Fast Fourier Transform (FFT) for finite fields. This implementation is experimental and subject to change. ```typescript import * as fft from '@noble/curves/abstract/fft.js'; import { bls12_381 } from '@noble/curves/bls12-381.js'; const Fr = bls12_381.fields.Fr; const roots = fft.rootsOfUnity(Fr, 7n); const fftFr = fft.FFT(roots, Fr); ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 6294ef0407265a0d19bb3ff7530babd8e32f10a34dff0b37135cd28e82984a8b:f822e5229abe4eabbc054bb516ac3586e182beabdcae28d33336fdbdd23cda050e06a33e03e652165c4a5c32734138126b970308bf20086e9074a3bc8a9d5bdd391fdf7205b21716ba441782fd91245be12ef7a68a07e66b22ada6235f1b3c480f78ce4f945f3b7f985d89106831adfb:a58f90af0ee34e2bc2d13ee421aa90d80bb7c2007cce5b65ac0991a0558dc3a1ea46a8c55819bff404ab297c6ae45066 ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 50034db59355c0cc3205033a648315c297c6bd57f33c5335a66b6d0dd3ce54fa:8f15974518b575933f99af74fa1305c13c6ccb5b004e379c3df457e05eed5e03aacff98d3dbfb5f4b0ef54decfa025cf83765db9a4c9d39054b3e146ad0b4fde2e4a5c208b698d2ba3842544e9df5f6bc17aab787127329bbe8b45ff40245d77e88f437637cd9a1b71a9ca0dc00b77:b32b1cba0fe06dd6d780bcc1c631df9721e8d3fbcaef372da23f40bdf5f6354e366728185e41e6d2dc04ad3e01d8b4d0 ``` -------------------------------- ### Example Private/Public Key Pair (secp256k1) Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/bls12-381/bls12-381-g1-test-vectors.txt This key pair is another example of a private key and its public key. It is provided in hexadecimal format for cryptographic use. ```plaintext 6136e51d3eadb2a46fb631b099565e6e3cc9feff15f33b9c08b49598d4a664f3:c72773b9026f66fa1299f4412a3e0df893a53a1f9c890a1cd653097459691b72387acaaf5574e293f83820117dc074d7396fee2ebbac34fb69a14ad5a528c03ca409438047e02e9c0ea765c200e3b482224af6874e03484ae19595827374b6eb4ca23d399e9e66f2c8a3732a3f2a27a796703e:98b9ad1abf6655723b2d685b84cb29861d19f8244f505a7ae4d2e4cc97eb203fadb87d2eaec040b07c100b5a790f0432 ``` -------------------------------- ### Key Generation Example Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/ed25519/vectors.txt Shows how to generate a public and private key pair using secp256k1. The private key is a random scalar. ```rust let mut rng = OsRng; let sk = Scalar::random(&mut rng); let pk = Point::mul(&Point::generator(), &sk); ``` -------------------------------- ### Get the Base Point of Curve25519 Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/ed25519/vectors.txt Retrieves the standard base point (generator) for Curve25519. This point is used as the starting point for many cryptographic operations. ```javascript import { BASE_POINT } from '@noble/curves/ed25519'; import { bytesToHex } from '@noble/hashes/utils'; console.log(bytesToHex(BASE_POINT)); ``` -------------------------------- ### Key Generation Example Source: https://github.com/paulmillr/noble-curves/blob/main/test/vectors/ed25519/vectors.txt Demonstrates the process of generating a new cryptographic key pair. This is a foundational step for secure communication. ```rust 1044ee3708c0b0e909a8cb2ba2cd0af8d28a5de01d962e826087fb232df7b2d246d241ea0c702c1889d44655824629b67284d4e644a48fa45455d27ac5f62529:46d241ea0c702c1889d44655824629b67284d4e644a48fa45455d27ac5f62529:b8a445455fb66e17e3143d35204c9ea93474eebeef93963ee5c1d377ca217acd4ca63e5755da08fbffdbd4352bf165193896c8d6f76bb4cd3bc2d3a476a4e320824a1210ce74d0014d747f111eec310c5c89ed4d0850e811f80a8bb28dcaf6f411df83e2c1dfd90c4ad23561454eb5d756b63b4ea7f37dc5d466c16ef70d11190c4f5316fe2aa8597440e88bbebaeb35ea5f04f07b0339264158ef909ad5163bfc248cd724133e274f812695f290e57176a96b9393d07bb310299f5d2a6b6dd1dabcb51bf29c5afa7ebb0701c6c84767ac137793091fe0ed6e47d780628a32c84f83e00e9c16742a523ecb63c24f4a338ed299a06194924f44c5a5d3c937ff9b0945982ad24a2d1c79:7d6bed7f87d090abe013c31e1203903bac9c93445d06c7b53d31d15f970d88647a7ed2c3a63050ba19d68043aadd18bd861de1ac4715b8e828b2b16f8a92b001b8a445455fb66e17e3143d35204c9ea93474eebeef93963ee5c1d377ca217acd4ca63e5755da08fbffdbd4352bf165193896c8d6f76bb4cd3bc2d3a476a4e320824a1210ce74d0014d747f111eec310c5c89ed4d0850e811f80a8bb28dcaf6f411df83e2c1dfd90c4ad23561454eb5d756b63b4ea7f37dc5d466c16ef70d11190c4f5316fe2aa8597440e88bbebaeb35ea5f04f07b0339264158ef909ad5163bfc248cd724133e274f812695f290e57176a96b9393d07bb310299f5d2a6b6dd1dabcb51bf29c5afa7ebb0701c6c84767ac137793091fe0ed6e47d780628a32c84f83e00e9c16742a523ecb63c24f4a338ed299a06194924f44c5a5d3c937ff9b0945982ad24a2d1c79 ```