Skip to content
Snippets Groups Projects
Select Git revision
  • ff68c47c0c47d84f1b5ca6886edb7659af6ebd95
  • master default
  • wip-slh-dsa-sha2-128s
  • master-updates
  • release-3.10-fixes
  • getopt-prototype
  • fix-bcrypt-warning
  • refactor-hmac
  • wip-use-alignas
  • trim-sha3-context
  • fix-gitlab-ci
  • check-fat-emulate
  • delete-digest_func-size
  • slh-dsa-shake-128f-nettle
  • slh-dsa-shake-128s-nettle
  • slh-dsa-shake-128s
  • delete-openpgp
  • ppc64-sha512
  • delete-md5-compat
  • cleanup-hmac-tests
  • ppc64-sha256
  • nettle_3.10.2_release_20250626
  • nettle_3.10.1_release_20241230
  • nettle_3.10_release_20240616
  • nettle_3.10rc2
  • nettle_3.10rc1
  • nettle_3.9.1_release_20230601
  • nettle_3.9_release_20230514
  • nettle_3.8.1_release_20220727
  • nettle_3.8_release_20220602
  • nettle_3.7.3_release_20210606
  • nettle_3.7.2_release_20210321
  • nettle_3.7.1_release_20210217
  • nettle_3.7_release_20210104
  • nettle_3.7rc1
  • nettle_3.6_release_20200429
  • nettle_3.6rc3
  • nettle_3.6rc2
  • nettle_3.6rc1
  • nettle_3.5.1_release_20190627
  • nettle_3.5_release_20190626
41 results

curve25519.h

Blame
  • XML.pmod 1.45 KiB
    import ".";
    
    string *from=({"&#a0;","&","<",">"});
    string *to=({"","&","<",">"});
    
    string unquote(string x) { return replace(x,from,to); }
    string quote(string x) { return replace(x,to,from); }
    
    string *from_data=({"&#a0;","&amp;","&lt;","&gt;","&apos;","&quot;"});
    string *to_data=({"","&","<",">","'","\""});
    
    string unquote_data(string x) { return replace(x,from_data,to_data); }
    string quote_data(string x) { return replace(x,to_data,from_data); }
    
    #define TAG object(Sgml.Tag)|string
    #define SGML array(TAG)
    
    string mktag(string tag, mapping params, int end)
    {
      string ret="<"+tag;
      foreach(indices(params),string i)
        if(params[i])
          ret+=" "+i+"='"+quote_data(stringp(params[i])?params[i]:i)+"'";
    
      return ret + (end?"/>":">");
    }
    
    string generate(SGML data, void|function mkt)
    {
      string ret="";
      if(!mkt)
      {
        mkt=mktag;
      }
      foreach(data, TAG foo)
        {
          if(stringp(foo))
          {
    	ret+=quote(foo);
          }
          else if (objectp(foo))
          {
    	ret+=mkt(foo->tag,foo->params,!foo->data);
    	if(foo->data)
    	{
    #if 0
    	  if(foo->tag=="script")
    	  {
    	    // Magic for javascript!
    	    ret+="\n<!--\n"+
    	      foo->data*""+
    	      "// -->\n";
    	  }else
    #endif
    	    ret+=generate(foo->data,mkt);
    
    	  ret+=mkt("/"+foo->tag,([]),0);
    	}
          }
          else error("got an illegal tag or string : %O\n"
    		 "in: %O\n",foo,data);
        }
    
      return ret;
    }
    
    
    #ifdef TEST
    int main()
    {
      write(sprintf("%O\n",group(lex(Stdio.read_file("tutorial.wmml")))));
    }
    #endif