Package com.securityinnovation.jNeo.ntruencrypt

Examples of com.securityinnovation.jNeo.ntruencrypt.KeyParams


        throws ParamSetNotSupportedException
    {
        // Parse the header, recover the key parameters.
        if (keyBlob[0] != tag)
          throw new IllegalArgumentException("key blob tag not recognized");
        KeyParams keyParams = KeyFormatterUtil.parseOID(keyBlob, 1, 3);

        // Make sure the input will be fully consumed
        int headerLen = KeyFormatterUtil.getHeaderEndOffset(keyBlob);
        int packedHLen = BitPack.unpack(keyParams.N, keyParams.q);
        int packedFLen = (keyParams.N + 4) / 5;
View Full Code Here


        throws ParamSetNotSupportedException
    {
        // Parse the header, recover the key parameters.
        if (keyBlob[0] != tag)
          throw new IllegalArgumentException("key blob tag not recognized");
        KeyParams keyParams = KeyFormatterUtil.parseOID(keyBlob, 1, 3);

        // Make sure the input will be fully consumed
        int headerLen = KeyFormatterUtil.getHeaderEndOffset(keyBlob);
        int packedHLen = BitPack.unpack(keyParams.N, keyParams.q);
        int listedFLen = BitPack.unpack(2*keyParams.df, keyParams.N);
View Full Code Here

    @Test public void test_encodePubKey_v1()
        throws NtruException
    {
        for (int t=0; t<tests.length; t++)
        {
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);
            FullPolynomial h = new FullPolynomial(tests[t].h);
           
            // Build a blob using the code being tested.
            PubKeyFormatter encoder = new PubKeyFormatter_PUBLIC_KEY_v1();
            byte pubBlob[] = encoder.encode(keyParams,h);
View Full Code Here

    @Test public void test_decodePubKey()
        throws NtruException
    {
        for (int t=0; t<tests.length; t++)
        {
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);

            // Build a blob
            byte blob[] = buildPubBlob(keyParams, tests[t].packedH);

            // Parse the test blob
View Full Code Here

    {
        byte            blob[] = null;
        PubKeyFormatter encoder = null;
        try {
            int t = 0;
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);

            // Build a blob
            blob = buildPubBlob(keyParams, tests[t].packedH);
            // Change the oid
            blob[2] = (byte)0xff;
View Full Code Here

        // Do the setup inside a try statement so we don't accidentally
        // trigger a false positive.
        try
        {
            int t = 0;
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);

            // Build a blob and make a short copy of it
            byte blob[] = buildPubBlob(keyParams, tests[t].packedH);
            blob2 = new byte[blob.length-2];
            System.arraycopy(blob, 0, blob2, 0, blob2.length);
View Full Code Here

       
        // Do the setup inside a try statement so we don't accidentally
        // trigger a false positive.
        try {
            int t = 0;
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);

            // Build a blob and make a long copy of it
            byte blob[] = buildPubBlob(keyParams, tests[t].packedH);
            blob2 = new byte[blob.length+2];
            System.arraycopy(blob, 0, blob2, 0, blob.length);
View Full Code Here

    @Test public void test_encodePrivKey()
        throws NtruException
    {
        for (int t=0; t<tests.length; t++)
        {
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);
            FullPolynomial h = new FullPolynomial(tests[t].h);
            FullPolynomial f = recoverf(tests[t].f, keyParams.q);

            // Build the test blob
            PrivKeyFormatter encoder = new PrivKeyFormatter_PrivateKeyListedFv1();
View Full Code Here

    public void test_decodePubKey()
        throws NtruException
    {
        for (int t=0; t<tests.length; t++)
        {
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);

            // Build a blob
            byte blob[] = buildPrivBlob(
                keyParams, tests[t].packedH, tests[t].packedListedF);
           
View Full Code Here

    {
        byte             blob[] = null;
        PrivKeyFormatter encoder = null;
        try {
            int t = 0;
            KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);

            // Build a blob
            blob = buildPrivBlob(
                keyParams, tests[t].packedH, tests[t].packedListedF);
            // Change the oid
View Full Code Here

TOP

Related Classes of com.securityinnovation.jNeo.ntruencrypt.KeyParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.